Commit e2bf8a065f969e1502d79e0023f08fa0441f754e

Authored by 肖超群
1 parent a0955f04

增加悬臂库暂存区入库

ant-design-vue-jeecg/src/api/api.js
... ... @@ -279,6 +279,8 @@ export const flatQuickReceipt = (params) => postAction('/receipt/receiveHeader/f
279 279 export const quickReceipt = (params) => postAction('/task/taskHeader/quickReceipt', params)
280 280 //悬臂库入库
281 281 export const cantaleverReceipt = (params) => postAction('/task/taskHeader/cantaleverReceipt', params)
  282 +//悬臂暂存区入库
  283 +export const receiptStageingReceipt = (params) => postAction('/task/taskHeader/receiptStageingReceipt', params)
282 284 //快速入库
283 285 export const stageingReceipt = (params) => postAction('/task/taskHeader/stageingReceipt', params)
284 286 //快速出库,批量快速出整托
... ... @@ -337,6 +339,8 @@ export const reduceInventoryDetail = (params) => postAction('/inventory/inventor
337 339 export const getInventoryDetailByLocationCode = (params) => getAction('/inventory/inventoryDetail/list', params)
338 340 //快速出库
339 341 export const quickShipment = (params) => postAction('/task/taskHeader/quickShipment', params)
  342 +//悬臂库出库
  343 +export const cantaleverShipment = (params) => postAction('/task/taskHeader/cantaleverShipment', params)
340 344 //出库复核
341 345 export const shipmentCheck = (params) => postAction('/shipment/shipmentCombination/shipmentCheck', params)
342 346 //查询盘点明细子表
... ...
ant-design-vue-jeecg/src/views/system/task/AllTaskHeaderList.vue
... ... @@ -90,13 +90,15 @@
90 90 <div class="table-operator">
91 91 <a-button v-has="'taskHeader:emptyIn'" @click="createEmptyIn()" type="primary">空托入库</a-button>
92 92 <a-button v-has="'taskHeader:manyEmptyIn'" @click="createManyEmptyIn()" type="primary">空托组入库</a-button>
93   - <a-button v-has="'taskHeader:quickReceipt'" @click="quickReceipt()" type="primary">快速入库</a-button>
94   - <a-button v-has="'taskHeader:quickReceipt'" @click="stageingReceipt()" type="primary">暂存区入库</a-button>
  93 + <a-button v-has="'taskHeader:quickReceipt'" @click="quickReceipt()" type="primary">货架库入库</a-button>
  94 + <a-button v-has="'taskHeader:quickReceipt'" @click="stageingReceipt()" type="primary">货架暂存区入库</a-button>
95 95 <a-button v-has="'taskHeader:quickReceipt'" @click="cantaleverReceipt()" type="primary">悬臂库入库</a-button>
  96 + <a-button v-has="'taskHeader:quickReceipt'" @click="cantaleverStageingReceipt()" type="primary">悬臂库暂存区入库</a-button>
96 97 <a-button v-has="'taskHeader:callReceiptBox'" @click="callReceiptBox()" type="primary" >呼叫入库有货托盘</a-button>
97 98 <a-button v-has="'taskHeader:callReceiptBox'" @click="callReceiptEmptyBox()" type="primary" >呼叫入库空托盘</a-button>
98 99 <a-button v-has="'taskHeader:emptyOut'" @click="createEmptyOut()" type="primary">空托出库</a-button>
99   - <a-button v-has="'taskHeader:quickShipment'" @click="quickShipment()" type="primary">快速出库</a-button>
  100 + <a-button v-has="'taskHeader:quickShipment'" @click="quickShipment()" type="primary">货架库出库</a-button>
  101 + <a-button v-has="'taskHeader:quickShipment'" @click="cantaleverShipment()" type="primary">悬臂库出库</a-button>
100 102 <a-button v-has="'taskHeader:manyEmptyOut'" @click="batchCreateEmptyOut()" type="primary">批量空托出库</a-button>
101 103 <a-button v-has="'taskHeader:manyEmptyOut'" @click="createManyEmptyOut()" type="primary">空托组出库</a-button>
102 104 <a-button v-has="'taskHeader:callShipmentBox'" @click="callShipmentBox()" type="primary" >呼叫出库托盘</a-button>
... ... @@ -210,6 +212,8 @@
210 212 <over-station-task-modal ref="overStationModal" @ok="modalFormOk"></over-station-task-modal>
211 213 <StageingReceiptModal ref="stageingReceiptModal" @ok="modalFormOk"></StageingReceiptModal>
212 214 <shipment-material-modal ref="shipmentMaterialModal" @ok="modalFormOk"></shipment-material-modal>
  215 + <CantaleverShipmentModal ref="cantaleverShipmentModal" @ok="modalFormOk"></CantaleverShipmentModal>
  216 + <CantaleverStageingReceiptModal ref="cantaleverStageingReceiptModal" @ok="modalFormOk"></CantaleverStageingReceiptModal>
213 217  
214 218 </a-card>
215 219 </template>
... ... @@ -241,11 +245,15 @@ import OverStationTaskModal from &quot;@views/system/task/modules/OverStationTaskModa
241 245 import StageingReceiptModal from "@views/system/task/modules/StageingReceiptModal.vue";
242 246 import ShipmentMaterialModal from "@views/system/task/modules/ShipmentMaterialModal.vue";
243 247 import CantaleverTaskModal from "@views/system/task/modules/CantaleverTaskModal.vue";
  248 +import CantaleverShipmentModal from "@views/system/task/modules/CantaleverShipmentModal.vue";
  249 +import CantaleverStageingReceiptModal from "@views/system/task/modules/CantaleverStageingReceiptModal.vue";
244 250  
245 251 export default {
246 252 name: "AllTaskHeaderList",
247 253 mixins: [JeecgListMixin],
248 254 components: {
  255 + CantaleverStageingReceiptModal,
  256 + CantaleverShipmentModal,
249 257 CantaleverTaskModal,
250 258 ShipmentMaterialModal,
251 259 StageingReceiptModal,
... ... @@ -529,6 +537,10 @@ export default {
529 537 this.$refs.shipmentMaterialModal.edit();
530 538 this.$refs.shipmentMaterialModal.title = "快速出库";
531 539 },
  540 + cantaleverShipment(){
  541 + this.$refs.cantaleverShipmentModal.edit();
  542 + this.$refs.cantaleverShipmentModal.title = "悬臂库出库";
  543 + },
532 544 stageingReceipt(){
533 545 this.$refs.stageingReceiptModal.edit();
534 546 this.$refs.stageingReceiptModal.title = "暂存区入库";
... ... @@ -588,6 +600,10 @@ export default {
588 600 this.$refs.cantaleverTaskModal.edit();
589 601 this.$refs.cantaleverTaskModal.title = "悬臂库入库";
590 602 },
  603 + cantaleverStageingReceipt(){
  604 + this.$refs.cantaleverStageingReceiptModal.edit();
  605 + this.$refs.cantaleverStageingReceiptModal.title = "悬臂暂存区入库";
  606 + },
591 607 callReceiptBox() {
592 608 this.$refs.modalForm5.edit();
593 609 this.$refs.modalForm5.title = "呼叫入库有货托盘";
... ...
ant-design-vue-jeecg/src/views/system/task/modules/CantaleverShipmentModal.vue 0 → 100644
  1 +<template>
  2 + <a-modal
  3 + :title="title"
  4 + :width="800"
  5 + :visible="visible"
  6 + :maskClosable="false"
  7 + :confirmLoading="confirmLoading"
  8 + @ok="handleOk"
  9 + @cancel="handleCancel">
  10 +
  11 + <a-spin :spinning="confirmLoading">
  12 + <a-form-model ref="form" :label-col="labelCol" :wrapper-col="wrapperCol" :model="model">
  13 + <!-- 主表单区域 -->
  14 +<!-- <a-row class="form-row" :gutter="24">-->
  15 +<!-- <a-col :lg="8">-->
  16 +<!-- <a-form-model-item label="托盘号" :rules="[{ required: true, message: '请输入托盘号!' }]">-->
  17 +<!-- <a-input placeholder="请输入托盘号" v-model="quickMainModel.containerCode"/>-->
  18 +<!-- </a-form-model-item>-->
  19 +<!-- </a-col>-->
  20 +<!-- <a-col :lg="10">-->
  21 +<!-- <a-form-model-item label="入库口">-->
  22 +<!--&lt;!&ndash; <a-input placeholder="请输入入库口" v-model="quickMainModel.toPort"/>&ndash;&gt;-->
  23 +<!-- <j-search-select-tag-->
  24 +<!-- placeholder="请选择入库口"-->
  25 +<!-- v-model="quickMainModel.toPort"-->
  26 +<!-- dict="port,name,code,type!='2'"-->
  27 +<!-- :pageSize="5"-->
  28 +<!-- :async="true">-->
  29 +<!-- </j-search-select-tag>-->
  30 +<!-- </a-form-model-item>-->
  31 +<!-- </a-col>-->
  32 +<!-- </a-row>-->
  33 + <!-- 子表单区域 -->
  34 + <a-tabs defaultActiveKey="1">
  35 + <a-tab-pane tab="物料信息" key="1">
  36 + <div>
  37 + <a-row type="flex" style="margin-bottom:10px" :gutter="24">
  38 + <a-col :span="12">物料编码</a-col>
  39 + <a-col :span="8">数量</a-col>
  40 + <a-col :span="4">操作</a-col>
  41 + </a-row>
  42 + <a-row type="flex" style="margin-bottom:-20px" :gutter="24" v-for="(item, index) in quickMainModel.receiptEntityList" :key="index">
  43 + <a-col style="display: none">
  44 + <a-form-model-item>
  45 + <a-input placeholder="id" v-model="item.id"/>
  46 + </a-form-model-item>
  47 + </a-col>
  48 + <a-col :span="12">
  49 + <a-form-model-item>
  50 + <j-search-select-tag
  51 + placeholder="请选择"
  52 + v-model="item.materialCode"
  53 + :dict="'material,name,code'"
  54 + :pageSize="5"
  55 + :async="true">
  56 + </j-search-select-tag>
  57 + </a-form-model-item>
  58 + </a-col>
  59 + <a-col :span="8">
  60 + <a-form-model-item>
  61 + <a-input placeholder="数量" v-model="item.qty"/>
  62 + </a-form-model-item>
  63 + </a-col>
  64 + <a-col :span="4">
  65 + <a-form-model-item>
  66 + <a-icon type="minus-circle" @click="delRowCustom(index)" style="fontSize :20px"/>
  67 + </a-form-model-item>
  68 + </a-col>
  69 + </a-row>
  70 + <a-button type="dashed" style="width: 100%;margin-top: 10px" @click="addRowCustom"><a-icon type="plus"/>添加物料信息</a-button>
  71 + </div>
  72 + </a-tab-pane>
  73 + </a-tabs>
  74 + </a-form-model>
  75 + </a-spin>
  76 + </a-modal>
  77 +</template>
  78 +
  79 +<script>
  80 +
  81 +import JEditableTable from '@/components/jeecg/JEditableTable'
  82 +import {cantaleverShipment, execute, quickReceipt, quickShipment} from '@/api/api'
  83 +import JDate from '@/components/jeecg/JDate'
  84 +import JSelectMultiCanUseContainer from "../../../../components/jeecgbiz/JSelectMultiCanUseContainer";
  85 +
  86 +export default {
  87 + name: 'CantaleverShipmentModal',
  88 + components: {
  89 + JDate, JEditableTable,JSelectMultiCanUseContainer
  90 + },
  91 + data() {
  92 + return {
  93 + title: '悬臂库出库',
  94 + visible: false,
  95 + confirmLoading: false,
  96 + model: {},
  97 + labelCol: {
  98 + xs: {span: 24},
  99 + sm: {span: 4}
  100 + },
  101 + wrapperCol: {
  102 + xs: {span: 24},
  103 + sm: {span: 24}
  104 + },
  105 + activeKey: '1',
  106 + quickMainModel: {
  107 + receiptEntityList: [{}],
  108 + },
  109 + // 客户信息
  110 + url: {
  111 + add: '/test/jeecgOrderMain/add',
  112 + edit: '/test/jeecgOrderMain/edit',
  113 + }
  114 + }
  115 + },
  116 + created() {
  117 + },
  118 + methods: {
  119 + handleOk() {
  120 + this.validateFields()
  121 + },
  122 + handleCancel() {
  123 + this.visible = false
  124 + },
  125 +
  126 + addRowCustom() {
  127 + this.quickMainModel.receiptEntityList.push({});
  128 + this.$forceUpdate();
  129 + },
  130 + delRowCustom(index) {
  131 + console.log(index)
  132 + this.quickMainModel.receiptEntityList.splice(index, 1);
  133 + this.$forceUpdate();
  134 + },
  135 + addRowTicket() {
  136 + this.quickMainModel.jeecgOrderTicketList.push({});
  137 + console.log(this.quickMainModel.jeecgOrderTicketList)
  138 + this.$forceUpdate();
  139 + },
  140 + delRowTicket(index) {
  141 + console.log(index)
  142 + this.quickMainModel.jeecgOrderTicketList.splice(index, 1);
  143 + this.$forceUpdate();
  144 + },
  145 +
  146 + edit(record) {
  147 + this.visible = true
  148 + this.activeKey = '1'
  149 + this.quickMainModel = Object.assign({
  150 + receiptEntityList: [{}]
  151 + }, record);
  152 + },
  153 + /** 触发表单验证 */
  154 + validateFields() {
  155 + // 触发表单验证
  156 + this.$refs.form.validate(valid => {
  157 + //alert(JSON.stringify(this.quickMainModel));
  158 + this.quickShipment(this.quickMainModel);
  159 + })
  160 + },
  161 +
  162 + quickShipment(record) {
  163 + this.confirmLoading = true
  164 + this.model = Object.assign({}, record);
  165 + cantaleverShipment(this.model).then((res) => {
  166 + this.loading = false;
  167 + if (res.success) {
  168 + this.$message.success(res.message);
  169 + this.$emit('ok');
  170 + this.visible = false
  171 + } else {
  172 + this.$message.error(res.message);
  173 + }
  174 + this.confirmLoading = false
  175 + });
  176 + },
  177 + }
  178 +}
  179 +</script>
0 180 \ No newline at end of file
... ...
ant-design-vue-jeecg/src/views/system/task/modules/CantaleverStageingReceiptModal.vue 0 → 100644
  1 +<template>
  2 + <a-modal
  3 + :title="title"
  4 + :width="800"
  5 + :visible="visible"
  6 + :maskClosable="false"
  7 + :confirmLoading="confirmLoading"
  8 + @ok="handleOk"
  9 + @cancel="handleCancel">
  10 +
  11 + <a-spin :spinning="confirmLoading">
  12 + <a-form-model ref="form" :label-col="labelCol" :wrapper-col="wrapperCol" :model="model">
  13 + <!-- 主表单区域 -->
  14 + <a-row class="form-row" :gutter="24">
  15 +<!-- <a-col :lg="12">-->
  16 +<!-- <a-form-model-item label="托盘号" :rules="[{ required: true, message: '请输入托盘号!' }]">-->
  17 +<!-- <a-input placeholder="请输入托盘号" v-model="quickMainModel.containerCode"/>-->
  18 +<!-- </a-form-model-item>-->
  19 +<!-- </a-col>-->
  20 + <a-col :lg="12">
  21 + <a-form-model-item label="暂存区" :rules="[{ required: true, message: '请输入暂存区位置!' }]">
  22 + <a-input placeholder="请输入暂存区位置" v-model="quickMainModel.fromPort"/>
  23 + </a-form-model-item>
  24 + </a-col>
  25 + </a-row>
  26 + <!-- 子表单区域 -->
  27 + <a-tabs defaultActiveKey="1">
  28 + <a-tab-pane tab="物料信息" key="1">
  29 + <div>
  30 + <a-row type="flex" style="margin-bottom:10px" :gutter="24">
  31 + <a-col :span="12">物料编码</a-col>
  32 + <a-col :span="8">数量</a-col>
  33 + <a-col :span="4">操作</a-col>
  34 + </a-row>
  35 + <a-row type="flex" style="margin-bottom:-20px" :gutter="24" v-for="(item, index) in quickMainModel.receiptEntityList" :key="index">
  36 + <a-col style="display: none">
  37 + <a-form-model-item>
  38 + <a-input placeholder="id" v-model="item.id"/>
  39 + </a-form-model-item>
  40 + </a-col>
  41 + <a-col :span="12">
  42 + <a-form-model-item>
  43 + <j-search-select-tag
  44 + placeholder="请选择"
  45 + v-model="item.materialCode"
  46 + :dict="'material,name,code'"
  47 + :pageSize="5"
  48 + :async="true">
  49 + </j-search-select-tag>
  50 + </a-form-model-item>
  51 + </a-col>
  52 + <a-col :span="8">
  53 + <a-form-model-item>
  54 + <a-input placeholder="数量" v-model="item.qty"/>
  55 + </a-form-model-item>
  56 + </a-col>
  57 + <a-col :span="4">
  58 + <a-form-model-item>
  59 + <a-icon type="minus-circle" @click="delRowCustom(index)" style="fontSize :20px"/>
  60 + </a-form-model-item>
  61 + </a-col>
  62 + </a-row>
  63 + <a-button type="dashed" style="width: 100%;margin-top: 10px" @click="addRowCustom"><a-icon type="plus"/>添加物料信息</a-button>
  64 + </div>
  65 + </a-tab-pane>
  66 + </a-tabs>
  67 + </a-form-model>
  68 + </a-spin>
  69 + </a-modal>
  70 +</template>
  71 +
  72 +<script>
  73 +
  74 +import JEditableTable from '@/components/jeecg/JEditableTable'
  75 +import {execute, quickReceipt, receiptStageingReceipt, stageingReceipt} from '@/api/api'
  76 +import JDate from '@/components/jeecg/JDate'
  77 +import JSelectMultiCanUseContainer from "../../../../components/jeecgbiz/JSelectMultiCanUseContainer";
  78 +
  79 +export default {
  80 + name: 'CantaleverStageingReceiptModal',
  81 + components: {
  82 + JDate, JEditableTable,JSelectMultiCanUseContainer
  83 + },
  84 + data() {
  85 + return {
  86 + title: '悬臂暂存区入库',
  87 + visible: false,
  88 + confirmLoading: false,
  89 + model: {},
  90 + labelCol: {
  91 + xs: {span: 24},
  92 + sm: {span: 4}
  93 + },
  94 + wrapperCol: {
  95 + xs: {span: 24},
  96 + sm: {span: 24}
  97 + },
  98 + activeKey: '1',
  99 + quickMainModel: {
  100 + receiptEntityList: [{}],
  101 + },
  102 + // 客户信息
  103 + url: {
  104 + add: '/test/jeecgOrderMain/add',
  105 + edit: '/test/jeecgOrderMain/edit',
  106 + }
  107 + }
  108 + },
  109 + created() {
  110 + },
  111 + methods: {
  112 + handleOk() {
  113 + this.validateFields()
  114 + },
  115 + handleCancel() {
  116 + this.visible = false
  117 + },
  118 +
  119 + addRowCustom() {
  120 + this.quickMainModel.receiptEntityList.push({});
  121 + this.$forceUpdate();
  122 + },
  123 + delRowCustom(index) {
  124 + console.log(index)
  125 + this.quickMainModel.receiptEntityList.splice(index, 1);
  126 + this.$forceUpdate();
  127 + },
  128 + addRowTicket() {
  129 + this.quickMainModel.jeecgOrderTicketList.push({});
  130 + console.log(this.quickMainModel.jeecgOrderTicketList)
  131 + this.$forceUpdate();
  132 + },
  133 + delRowTicket(index) {
  134 + console.log(index)
  135 + this.quickMainModel.jeecgOrderTicketList.splice(index, 1);
  136 + this.$forceUpdate();
  137 + },
  138 +
  139 + edit(record) {
  140 + this.visible = true
  141 + this.activeKey = '1'
  142 + this.quickMainModel = Object.assign({
  143 + receiptEntityList: [{}]
  144 + }, record);
  145 + },
  146 + /** 触发表单验证 */
  147 + validateFields() {
  148 + // 触发表单验证
  149 + this.$refs.form.validate(valid => {
  150 + //alert(JSON.stringify(this.quickMainModel));
  151 + this.receipt(this.quickMainModel);
  152 + })
  153 + },
  154 +
  155 + receipt(record) {
  156 + this.confirmLoading = true
  157 + this.model = Object.assign({}, record);
  158 + receiptStageingReceipt(this.model).then((res) => {
  159 + this.loading = false;
  160 + if (res.success) {
  161 + this.$message.success(res.message);
  162 + this.$emit('ok');
  163 + this.visible = false
  164 + } else {
  165 + this.$message.error(res.message);
  166 + }
  167 + this.confirmLoading = false
  168 + });
  169 + },
  170 + }
  171 +}
  172 +</script>
0 173 \ No newline at end of file
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/service/IShipmentCombinationService.java
... ... @@ -31,6 +31,8 @@ public interface IShipmentCombinationService {
31 31  
32 32 Result autoCombination(String shipmentCode, boolean advice, String warehouseCode);
33 33  
  34 + Result autoCombinationCantalever(String shipmentCode, boolean advice, String warehouseCode);
  35 +
34 36 Result stockUp(List<ShipmentHeader> shipmentHeaderList, String warehouseCode);
35 37  
36 38 Result createShipmentTask(ShipmentContainerHeader shipmentContainerHeader, String warehouseCode, long shipmentOrder, int sequence, int sequenceNumber);
... ... @@ -54,6 +56,8 @@ public interface IShipmentCombinationService {
54 56  
55 57 Result autoCombinationDetail(ShipmentDetail shipmentDetail, boolean advice, BigDecimal shipQty);
56 58  
  59 + Result autoCombinationDetailCantalever(ShipmentDetail shipmentDetail, boolean advice, BigDecimal shipQty);
  60 +
57 61 Result stockUp(ShipmentDetail shipmentDetail);
58 62  
59 63 Result stockUpMove(Location location);
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/service/impl/ShipmentCombinationServiceImpl.java
... ... @@ -299,6 +299,40 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi
299 299  
300 300 @Override
301 301 @Transactional(rollbackFor = Exception.class)
  302 + public Result autoCombinationCantalever(String shipmentCode, boolean advice, String warehouseCode) {
  303 + log.info("开始自动配盘,单号" + shipmentCode);
  304 + ShipmentHeader shipmentHeader = shipmentHeaderService.getShipmentHeaderByCode(shipmentCode, warehouseCode);
  305 + if (shipmentHeader == null) {
  306 + return Result.error("自动配盘, 系统没有此单据" + shipmentCode);
  307 + }
  308 + if (shipmentHeader.getLastStatus() >= QuantityConstant.SHIPMENT_HEADER_COMPLETED) {
  309 + return Result.OK("自动配盘,出库单已经作业完毕");
  310 + }
  311 + LambdaQueryWrapper<ShipmentDetail> shipmentDetailLambdaQueryWrapper = Wrappers.lambdaQuery();
  312 + shipmentDetailLambdaQueryWrapper.eq(ShipmentDetail::getShipmentCode, shipmentCode).eq(ShipmentDetail::getWarehouseCode, warehouseCode);
  313 + List<ShipmentDetail> shipmentDetailList = shipmentDetailService.list(shipmentDetailLambdaQueryWrapper);
  314 + if (shipmentDetailList.isEmpty()) {
  315 + return Result.error("自动配盘, 出库单没有明细", null);
  316 + }
  317 + boolean over = true;
  318 + for (ShipmentDetail shipmentDetail : shipmentDetailList) {
  319 + if (shipmentDetail.getTaskQty().compareTo(shipmentDetail.getQty()) < 0) {
  320 + over = false;
  321 + }
  322 + Result result = shipmentCombinationService.autoCombinationDetailCantalever(shipmentDetail, advice, null);
  323 + if (!result.isSuccess()) {
  324 + throw new JeecgBootException(result.getMessage());
  325 + }
  326 + }
  327 + log.info("完成自动配盘,单号" + shipmentCode);
  328 + if (over) {
  329 + return Result.error("出库单已经配盘", null);
  330 + }
  331 + return Result.OK("自动组盘成功", null);
  332 + }
  333 +
  334 + @Override
  335 + @Transactional(rollbackFor = Exception.class)
302 336 public Result stockUp(List<ShipmentHeader> shipmentHeaderList, String warehouseCode) {
303 337 log.info("备货,单号" + shipmentHeaderList);
304 338 List<String> shipmentCodeList = shipmentHeaderList.stream().map(ShipmentHeader::getCode).collect(Collectors.toList());
... ... @@ -453,6 +487,101 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi
453 487 return Result.OK("自动配盘成功", null);
454 488 }
455 489  
  490 + /**
  491 + * 出库单据明细自动配盘
  492 + */
  493 + @Override
  494 + @Transactional(rollbackFor = Exception.class)
  495 + public Result autoCombinationDetailCantalever(ShipmentDetail shipmentDetail, boolean advice, BigDecimal shipQty) {
  496 + // 出库数量
  497 + BigDecimal shipmentQty = shipmentDetail.getQty().subtract(shipmentDetail.getTaskQty());
  498 + // 判断是否还有需要出库的物料,如果没有就跳过该物料
  499 + if (shipmentQty.compareTo(BigDecimal.ZERO) <= 0) {
  500 + return Result.OK("自动配盘时, 出库数量必须大于0");
  501 + }
  502 + if (shipQty != null) {
  503 + shipmentQty = shipQty;
  504 + }
  505 + List<InventoryDetail> inventoryList = shipmentCombinationService.getInventorys(shipmentDetail);
  506 + // 去除已锁的库存
  507 + ArrayList<InventoryDetail> removeInventoryList = new ArrayList<>();
  508 + List<ReceiptContainerHeader> receiptContainerHeaderList = receiptContainerHeaderService.getUnCompleteCombineList();
  509 + List<ShipmentContainerHeader> shipmentContainerHeaderList = shipmentContainerHeaderService.getNotCombineList();
  510 + for (InventoryDetail inventoryDetail : inventoryList) {
  511 + String containerCode = inventoryDetail.getContainerCode();
  512 + String warehouseCode = inventoryDetail.getWarehouseCode();
  513 + Container container = containerService.getContainerByCode(containerCode, warehouseCode);
  514 + if (container == null) {
  515 + return Result.error("自动配盘时,没有找到容器:" + containerCode);
  516 + }
  517 + if (container.getStatus().equals(QuantityConstant.STATUS_CONTAINER_LOCK)) {
  518 + removeInventoryList.add(inventoryDetail);
  519 + continue;
  520 + }
  521 + for (ReceiptContainerHeader receiptContainerHeader : receiptContainerHeaderList) {
  522 + if (receiptContainerHeader.getContainerCode().equals(containerCode)) {
  523 + removeInventoryList.add(inventoryDetail);
  524 + continue;
  525 + }
  526 + }
  527 + for (ShipmentContainerHeader shipmentContainerHeader : shipmentContainerHeaderList) {
  528 + if (shipmentContainerHeader.getContainerCode().equals(containerCode)) {
  529 + removeInventoryList.add(inventoryDetail);
  530 + continue;
  531 + }
  532 + }
  533 + }
  534 + inventoryList.removeAll(removeInventoryList);
  535 + if (inventoryList.size() < 1) {
  536 + return Result.error("自动配盘时," + shipmentDetail.getMaterialName() + "没有符合出库条件的库存");
  537 + }
  538 +
  539 + if (StringUtils.isNotEmpty(inventoryList)) {
  540 + inventoryList = inventoryList.stream()
  541 + .sorted((o1, o2) -> o2.getPosition().compareTo(o1.getPosition())).collect(Collectors.toList());
  542 + inventoryList = inventoryList.stream()
  543 + .collect(Collectors.toMap(
  544 + InventoryDetail::getContainerCode, // 以 containerCode 为键
  545 + detail -> detail, // 以 InventoryDetail 对象为值
  546 + (existing, replacement) -> existing // 如果键冲突,保留现有的对象
  547 + ))
  548 + .values()
  549 + .stream()
  550 + .collect(Collectors.toList());
  551 + }
  552 +
  553 + for (InventoryDetail inventoryDetail : inventoryList) {
  554 + BigDecimal inventoryQty = inventoryDetail.getQty().subtract(inventoryDetail.getTaskQty());
  555 + if (inventoryQty.compareTo(BigDecimal.ZERO) == 0) {
  556 + continue;
  557 + }
  558 + // 判断需要配盘数量是否等于0,等于0代表配盘完毕,完毕就退出内循环
  559 + if (shipmentQty.compareTo(BigDecimal.ZERO) == 0) {
  560 + break;
  561 + }
  562 + if (shipmentQty.compareTo(BigDecimal.ZERO) < 0) {
  563 + throw new JeecgBootException("配盘时,出库数量不能小于0");
  564 + }
  565 + CombinationModel combinationModel = new CombinationModel();
  566 + combinationModel.setShipmentDetail(shipmentDetail);
  567 + combinationModel.setInventoryDetail(inventoryDetail);
  568 + if (inventoryQty.compareTo(shipmentQty) >= 0) {
  569 + combinationModel.setShipQty(shipmentQty);
  570 + shipmentQty = BigDecimal.ZERO;
  571 + } else {
  572 + combinationModel.setShipQty(inventoryQty);
  573 + shipmentQty = shipmentQty.subtract(inventoryQty);
  574 + }
  575 +
  576 + Result result = shipmentCombinationService.combination(combinationModel);
  577 + if (!result.isSuccess()) {
  578 + throw new JeecgBootException(result.getMessage());
  579 + }
  580 +
  581 + }
  582 + return Result.OK("自动配盘成功", null);
  583 + }
  584 +
456 585 @Override
457 586 @Transactional(rollbackFor = Exception.class)
458 587 public Result stockUp(ShipmentDetail shipmentDetail) {
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/service/IShipmentHeaderService.java
... ... @@ -50,6 +50,8 @@ public interface IShipmentHeaderService extends IService&lt;ShipmentHeader&gt; {
50 50  
51 51 Result autoShipment(String shipmentCode, String warehouseCode);
52 52  
  53 + Result autoShipmentCantalever(String shipmentCode, String warehouseCode);
  54 +
53 55 Result autoShipmentAdvice(String shipmentCode, String warehouseCode);
54 56  
55 57 Result autoFlatShipmentAdvice(String shipmentCode, String warehouseCode);
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/service/impl/ShipmentHeaderServiceImpl.java
... ... @@ -542,6 +542,99 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl&lt;ShipmentHeaderMapper,
542 542 return Result.OK("自动出库成功");
543 543 }
544 544  
  545 + @Override
  546 + @Transactional(rollbackFor = Exception.class)
  547 + public Result autoShipmentCantalever(String shipmentCode, String warehouseCode) {
  548 + if (StringUtils.isEmpty(shipmentCode)) {
  549 + return Result.error("自动出库, 出库单编码为空");
  550 + }
  551 + if (StringUtils.isEmpty(warehouseCode)) {
  552 + return Result.error("自动出库, 仓库编码为空");
  553 + }
  554 + ShipmentHeader shipmentHeader = shipmentHeaderService.getShipmentHeaderByCode(shipmentCode, warehouseCode);
  555 + if (shipmentHeader == null) {
  556 + throw new JeecgBootException("自动出库, 没有找到出库单");
  557 + }
  558 + String zoneCode = shipmentHeader.getZoneCode();
  559 + if (StringUtils.isEmpty(zoneCode)) {
  560 + throw new JeecgBootException("自动出库, 库区编码为空");
  561 + }
  562 + Zone zone = zoneService.getZoneByCode(zoneCode, warehouseCode);
  563 + if (zone == null) {
  564 + throw new JeecgBootException("自动出库, 库区为空");
  565 + }
  566 + String zoneType = zone.getType();
  567 + if (StringUtils.isEmpty(zoneType)) {
  568 + throw new JeecgBootException("自动出库, 库区类型编码为空");
  569 + }
  570 + if (!zoneType.equals(QuantityConstant.ZONE_TYPE_STEREOSCOPIC)) {
  571 + throw new JeecgBootException("自动出库, 库区类型必须为立库区类型");
  572 + }
  573 + Result result = shipmentCombinationService.autoCombinationCantalever(shipmentCode, false, warehouseCode);
  574 + if (!result.isSuccess()) {
  575 + throw new JeecgBootException("自动出库," + result.getMessage());
  576 + }
  577 + List<ShipmentContainerDetail> shipmentContainerDetailList = shipmentContainerDetailService.getShipmentContainerDetailListByShipmentCode(shipmentCode);
  578 + if (CollectionUtils.isEmpty(shipmentContainerDetailList)) {
  579 + throw new JeecgBootException("自动出库, 没有找到出库配盘详情");
  580 + }
  581 + List<Integer> shipmentContainerIdList =
  582 + shipmentContainerDetailList.stream().map(ShipmentContainerDetail::getShipmentContainerId).distinct().collect(Collectors.toList());
  583 + long shipmentOrder = System.currentTimeMillis();
  584 + int sequenceNumber = shipmentContainerIdList.size();
  585 + int sequence = 0;
  586 + for (int shipmentContainerId : shipmentContainerIdList) {
  587 + sequence++;
  588 + ShipmentContainerHeader shipmentContainerHeader = shipmentContainerHeaderService.getById(shipmentContainerId);
  589 + if (shipmentContainerHeader == null) {
  590 + throw new JeecgBootException("自动出库, 没有找到出库表头:" + shipmentContainerId);
  591 + }
  592 + if (shipmentContainerHeader.getStatus().intValue() > QuantityConstant.SHIPMENT_CONTAINER_BUILD) {
  593 + continue;
  594 + }
  595 + int taskType = shipmentContainerHeader.getTaskType();
  596 + int type = QuantityConstant.PORT_TYPE_PICK;
  597 + if (taskType == QuantityConstant.TASK_TYPE_WHOLESHIPMENT) {
  598 + type = QuantityConstant.PORT_TYPE_OUT;
  599 + }
  600 + if (zoneCode.equals(QuantityConstant.ZONE_B)) {
  601 + type = QuantityConstant.PORT_TYPE_OUT;
  602 + }
  603 + String fromLocationCode = shipmentContainerHeader.getFromLocationCode();
  604 + if (StringUtils.isEmpty(fromLocationCode)) {
  605 + throw new JeecgBootException("自动出库, 没有起始库位编码");
  606 + }
  607 + Location fromLocation = locationService.getLocationByCode(fromLocationCode, warehouseCode);
  608 + if (fromLocation == null) {
  609 + throw new JeecgBootException("自动出库, 没有起始库位" + fromLocationCode);
  610 + }
  611 + Integer roadWay = fromLocation.getRoadWay();
  612 + List<Port> portList = portService.getPortListByType(type, roadWay, zoneCode, warehouseCode);
  613 + if (portList == null) {
  614 + throw new JeecgBootException("自动出库, 没有合适的出库口");
  615 + }
  616 + Port port = portList.get(0);
  617 + shipmentContainerHeader.setToPort(port.getCode());
  618 + boolean success = shipmentContainerHeaderService.updateById(shipmentContainerHeader);
  619 + if (!success) {
  620 + throw new JeecgBootException("自动出库, 更新出库组盘头失败");
  621 + }
  622 + result = huahengMultiHandlerService.createShipmentTask(shipmentContainerHeader, warehouseCode, shipmentOrder, sequence, sequenceNumber);
  623 + if (!result.isSuccess()) {
  624 + throw new JeecgBootException("自动出库, " + result.getMessage());
  625 + }
  626 + String containerCode = shipmentContainerHeader.getContainerCode();
  627 + if (StringUtils.isEmpty(containerCode)) {
  628 + throw new JeecgBootException("自动出库, 容器号为空");
  629 + }
  630 + TaskHeader taskHeader = taskHeaderService.getUnCompleteTaskByContainerCode(containerCode, warehouseCode);
  631 + if (taskHeader == null) {
  632 + throw new JeecgBootException("自动出库, 没有找到容器号对应任务" + containerCode);
  633 + }
  634 + }
  635 + return Result.OK("自动出库成功");
  636 + }
  637 +
545 638 /**
546 639 * 自动预配盘出库
547 640 */
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/controller/TaskHeaderController.java
... ... @@ -947,6 +947,27 @@ public class TaskHeaderController extends HuahengBaseController {
947 947 return result;
948 948 }
949 949  
  950 +
  951 + /**
  952 + * 快速入库
  953 + * @return
  954 + */
  955 + @AutoLog(value = "悬臂库暂存区入库", operateType = 2)
  956 + @PostMapping("receiptStageingReceipt")
  957 + @ApiOperation("悬臂库暂存区入库")
  958 + public Result receiptStageingReceipt(@RequestBody QucikReceiptEntity qucikReceiptEntity, HttpServletRequest req) {
  959 + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req);
  960 + qucikReceiptEntity.setWarehouseCode(warehouseCode);
  961 + Result result = handleMultiProcess("receiptStageingReceipt", new MultiProcessListener() {
  962 + @Override
  963 + public Result<?> doProcess() {
  964 + Result result = taskHeaderService.receiptStageingReceipt(qucikReceiptEntity);
  965 + return result;
  966 + }
  967 + });
  968 + return result;
  969 + }
  970 +
950 971 /**
951 972 * 快速出库
952 973 * @return
... ... @@ -968,6 +989,26 @@ public class TaskHeaderController extends HuahengBaseController {
968 989 }
969 990  
970 991 /**
  992 + * 悬臂库出库
  993 + * @return
  994 + */
  995 + @AutoLog(value = "悬臂库出库", operateType = 3)
  996 + @PostMapping("cantaleverShipment")
  997 + @ApiOperation("悬臂库出库")
  998 + public Result cantaleverShipment(@RequestBody QucikReceiptEntity qucikReceiptEntity, HttpServletRequest req) {
  999 + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req);
  1000 + qucikReceiptEntity.setWarehouseCode(warehouseCode);
  1001 + Result result = handleMultiProcess("cantaleverShipment", new MultiProcessListener() {
  1002 + @Override
  1003 + public Result<?> doProcess() {
  1004 + Result result = taskHeaderService.cantaleverShipment(qucikReceiptEntity);
  1005 + return result;
  1006 + }
  1007 + });
  1008 + return result;
  1009 + }
  1010 +
  1011 + /**
971 1012 * 质检登记
972 1013 * @return
973 1014 */
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/entity/QucikReceiptEntity.java
... ... @@ -8,6 +8,7 @@ import lombok.Data;
8 8 public class QucikReceiptEntity {
9 9  
10 10 private String containerCode;
  11 + private String fromPort;
11 12 private String toPort;
12 13 private String warehouseCode;
13 14 private List<ReceiptEntity> receiptEntityList;
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/ITaskHeaderService.java
... ... @@ -507,6 +507,12 @@ public interface ITaskHeaderService extends IService&lt;TaskHeader&gt; {
507 507 */
508 508 Result cantaleverReceipt(QucikReceiptEntity qucikReceiptEntity);
509 509  
  510 + /**
  511 + * add
  512 + * @return
  513 + */
  514 + Result receiptStageingReceipt(QucikReceiptEntity qucikReceiptEntity);
  515 +
510 516  
511 517 /**
512 518 * add
... ... @@ -536,8 +542,14 @@ public interface ITaskHeaderService extends IService&lt;TaskHeader&gt; {
536 542 Result updatePriority(String id, String priority);
537 543  
538 544 /**
539   - * add
  545 + * 快速出库
540 546 * @return
541 547 */
542 548 Result quickShipment(QucikReceiptEntity qucikReceiptEntity);
  549 +
  550 + /**
  551 + * 悬臂库出库
  552 + * @return
  553 + */
  554 + Result cantaleverShipment(QucikReceiptEntity qucikReceiptEntity);
543 555 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java
... ... @@ -3223,7 +3223,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
3223 3223 throw new JeecgBootException("悬臂库入库,每次只能入1个");
3224 3224 }
3225 3225 String receiptType = QuantityConstant.RECEIPT_BILL_TYPE_QTR;
3226   - String remark = "快速入库";
  3226 + String remark = "悬臂库入库";
3227 3227 ReceiptHeader receiptHeader = new ReceiptHeader();
3228 3228 receiptHeader.setWarehouseCode(warehouseCode);
3229 3229 receiptHeader.setCompanyCode(QuantityConstant.DEFAULT_COMPANY);
... ... @@ -3231,19 +3231,19 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
3231 3231 receiptHeader.setRemark(remark);
3232 3232 Result result = receiptHeaderService.saveReceiptHeader(receiptHeader);
3233 3233 if (!result.isSuccess()) {
3234   - throw new JeecgBootException("快速入库, 创建入库单头失败" + result.getMessage());
  3234 + throw new JeecgBootException("悬臂库入库, 创建入库单头失败" + result.getMessage());
3235 3235 }
3236 3236 for (ReceiptEntity receiptEntity : receiptEntityList) {
3237 3237 BigDecimal qty = receiptEntity.getQty();
3238 3238 String materialCode = receiptEntity.getMaterialCode();
3239 3239 if (StringUtils.isEmpty(materialCode)) {
3240   - throw new JeecgBootException("快速入库, 物料编码为空");
  3240 + throw new JeecgBootException("悬臂库入库, 物料编码为空");
3241 3241 }
3242 3242 if (qty == null) {
3243   - throw new JeecgBootException("快速入库, 数量必须填写");
  3243 + throw new JeecgBootException("悬臂库入库, 数量必须填写");
3244 3244 }
3245 3245 if (qty.compareTo(BigDecimal.ZERO) <= 0) {
3246   - throw new JeecgBootException("快速入库, 数量必须大于0");
  3246 + throw new JeecgBootException("悬臂库入库, 数量必须大于0");
3247 3247 }
3248 3248 ReceiptDetail receiptDetail = new ReceiptDetail();
3249 3249 receiptDetail.setWarehouseCode(warehouseCode);
... ... @@ -3254,7 +3254,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
3254 3254 receiptDetail.setQty(qty);
3255 3255 Material material = materialService.getMaterialByCode(materialCode);
3256 3256 if (material == null) {
3257   - throw new JeecgBootException("快速入库, 获取物料:" + materialCode + " 信息失败");
  3257 + throw new JeecgBootException("悬臂库入库, 获取物料:" + materialCode + " 信息失败");
3258 3258 }
3259 3259 receiptDetail.setInventoryStatus(QuantityConstant.QUALITY_GOOD);
3260 3260 receiptDetail.setMaterialCode(materialCode);
... ... @@ -3263,7 +3263,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
3263 3263 receiptDetail.setMaterialUnit(material.getUnit());
3264 3264 success = receiptDetailService.save(receiptDetail);
3265 3265 if (!success) {
3266   - throw new JeecgBootException("快速入库, 保存入库单详情失败");
  3266 + throw new JeecgBootException("悬臂库入库, 保存入库单详情失败");
3267 3267 }
3268 3268  
3269 3269 Receive receive = new Receive();
... ... @@ -3289,7 +3289,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
3289 3289 receiptContainerHeader.setToPort(toPort);
3290 3290 success = receiptContainerHeaderService.updateById(receiptContainerHeader);
3291 3291 if (!success) {
3292   - throw new JeecgBootException("快速入库,更新入库组盘头失败");
  3292 + throw new JeecgBootException("悬臂库入库,更新入库组盘头失败");
3293 3293 }
3294 3294 result = receiptContainerHeaderService.createReceiptTask(receiptContainerHeader, warehouseCode);
3295 3295 if (!result.isSuccess()) {
... ... @@ -3302,9 +3302,148 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
3302 3302 // }
3303 3303 // }
3304 3304 if (!receiptHeaderService.updateReceiptHeader(receiptHeader.getId())) {
3305   - throw new JeecgBootException("快速入库, 更新入库表单头失败");
  3305 + throw new JeecgBootException("悬臂库入库, 更新入库表单头失败");
3306 3306 }
3307   - return Result.OK("快速入库成功");
  3307 + return Result.OK("悬臂库入库成功");
  3308 + }
  3309 +
  3310 + @Override
  3311 + @Transactional(rollbackFor = Exception.class)
  3312 + public Result receiptStageingReceipt(QucikReceiptEntity qucikReceiptEntity) {
  3313 + boolean success = false;
  3314 + String containerCode = qucikReceiptEntity.getContainerCode();
  3315 + List<ReceiptEntity> receiptEntityList = qucikReceiptEntity.getReceiptEntityList();
  3316 + String toPort = qucikReceiptEntity.getToPort();
  3317 + toPort = "P1001";
  3318 + String fromPort = qucikReceiptEntity.getFromPort();
  3319 + String warehouseCode = qucikReceiptEntity.getWarehouseCode();
  3320 + List<Receive> receiveList = new ArrayList<>();
  3321 +// if (StringUtils.isEmpty(containerCode)) {
  3322 +// return Result.error("快速入库,容器编码为空");
  3323 +// }
  3324 + if (StringUtils.isEmpty(warehouseCode)) {
  3325 + return Result.error("悬臂库入库,仓库编码为空");
  3326 + }
  3327 + if (StringUtils.isEmpty(receiptEntityList)) {
  3328 + return Result.error("悬臂库入库,入库信息为空");
  3329 + }
  3330 + Container container = containerService.createLSContainer(warehouseCode);
  3331 + if (container == null) {
  3332 + return Result.error("悬臂库入库,没有找到容器" + containerCode);
  3333 + }
  3334 + containerCode = container.getCode();
  3335 +// Port port = portService.getPortByCode(toPort, warehouseCode);
  3336 +// if (port != null) {
  3337 +// int portType = Integer.parseInt(port.getType());
  3338 +// if (portType == QuantityConstant.PORT_TYPE_OUT) {
  3339 +// return Result.error("快速入库,不能选择出库口" + toPort);
  3340 +// }
  3341 +// }
  3342 + for (ReceiptEntity receiptEntity : receiptEntityList) {
  3343 + if(receiptEntity.getQty().compareTo(BigDecimal.ZERO) == 0) {
  3344 + continue;
  3345 + }
  3346 + if(receiptEntity.getQty().compareTo(BigDecimal.ONE) != 0) {
  3347 + throw new JeecgBootException("悬臂库入库,入库数量只能是1");
  3348 + }
  3349 + }
  3350 + if (receiptEntityList.size() > 1) {
  3351 + throw new JeecgBootException("悬臂库入库,每次只能入1个");
  3352 + }
  3353 + String receiptType = QuantityConstant.RECEIPT_BILL_TYPE_QTR;
  3354 + String remark = "悬臂库入库";
  3355 + ReceiptHeader receiptHeader = new ReceiptHeader();
  3356 + receiptHeader.setWarehouseCode(warehouseCode);
  3357 + receiptHeader.setCompanyCode(QuantityConstant.DEFAULT_COMPANY);
  3358 + receiptHeader.setType(receiptType);
  3359 + receiptHeader.setRemark(remark);
  3360 + Result result = receiptHeaderService.saveReceiptHeader(receiptHeader);
  3361 + if (!result.isSuccess()) {
  3362 + throw new JeecgBootException("悬臂库入库, 创建入库单头失败" + result.getMessage());
  3363 + }
  3364 + for (ReceiptEntity receiptEntity : receiptEntityList) {
  3365 + BigDecimal qty = receiptEntity.getQty();
  3366 + String materialCode = receiptEntity.getMaterialCode();
  3367 + if (StringUtils.isEmpty(materialCode)) {
  3368 + throw new JeecgBootException("悬臂库入库, 物料编码为空");
  3369 + }
  3370 + if (qty == null) {
  3371 + throw new JeecgBootException("悬臂库入库, 数量必须填写");
  3372 + }
  3373 + if (qty.compareTo(BigDecimal.ZERO) <= 0) {
  3374 + throw new JeecgBootException("悬臂库入库, 数量必须大于0");
  3375 + }
  3376 + ReceiptDetail receiptDetail = new ReceiptDetail();
  3377 + receiptDetail.setWarehouseCode(warehouseCode);
  3378 + receiptDetail.setCompanyCode(QuantityConstant.DEFAULT_COMPANY);
  3379 + receiptDetail.setReceiptCode(receiptHeader.getCode());
  3380 + receiptDetail.setReceiptId(receiptHeader.getId());
  3381 + receiptDetail.setStatus(QuantityConstant.RECEIPT_HEADER_BUILD);
  3382 + receiptDetail.setQty(qty);
  3383 + Material material = materialService.getMaterialByCode(materialCode);
  3384 + if (material == null) {
  3385 + throw new JeecgBootException("悬臂库入库, 获取物料:" + materialCode + " 信息失败");
  3386 + }
  3387 + receiptDetail.setInventoryStatus(QuantityConstant.QUALITY_GOOD);
  3388 + receiptDetail.setMaterialCode(materialCode);
  3389 + receiptDetail.setMaterialName(material.getName());
  3390 + receiptDetail.setMaterialSpec(material.getSpec());
  3391 + receiptDetail.setMaterialUnit(material.getUnit());
  3392 + success = receiptDetailService.save(receiptDetail);
  3393 + if (!success) {
  3394 + throw new JeecgBootException("悬臂库入库, 保存入库单详情失败");
  3395 + }
  3396 +
  3397 + Receive receive = new Receive();
  3398 + receive.setId(receiptDetail.getId());
  3399 + receive.setContainerCode(containerCode);
  3400 + receive.setMaterialCode(materialCode);
  3401 + receive.setMaterialName(receiptDetail.getMaterialName());
  3402 + receive.setMaterialSpec(receiptDetail.getMaterialSpec());
  3403 + receive.setMaterialUnit(receiptDetail.getMaterialUnit());
  3404 + receive.setInventoryStatus(receiptDetail.getInventoryStatus());
  3405 + receive.setQty(receiptDetail.getQty());
  3406 + receive.setTaskQty(receiptDetail.getQty());
  3407 + receiveList.add(receive);
  3408 + }
  3409 + result = receiveService.receiving(receiveList, warehouseCode);
  3410 + if (!result.isSuccess()) {
  3411 + throw new JeecgBootException(result.getMessage());
  3412 + }
  3413 + ReceiptContainerHeader receiptContainerHeader = receiptContainerHeaderService.getUnCompleteReceiptContainerByCode(containerCode, warehouseCode);
  3414 + if (receiptContainerHeader == null) {
  3415 + throw new JeecgBootException(result.getMessage());
  3416 + }
  3417 + receiptContainerHeader.setToPort(toPort);
  3418 + success = receiptContainerHeaderService.updateById(receiptContainerHeader);
  3419 + if (!success) {
  3420 + throw new JeecgBootException("悬臂库入库,更新入库组盘头失败");
  3421 + }
  3422 + result = receiptContainerHeaderService.createReceiptTask(receiptContainerHeader, warehouseCode);
  3423 + if (!result.isSuccess()) {
  3424 + throw new JeecgBootException(result.getMessage());
  3425 + }
  3426 +// TaskHeader taskHeader = (TaskHeader)result.getResult();
  3427 +// if (taskHeader.getTaskType() == QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT) {
  3428 +// if (port == null) {
  3429 +// throw new JeecgBootException("快速入库, 生成补充任务时必须有入库口");
  3430 +// }
  3431 +// }
  3432 + if (!receiptHeaderService.updateReceiptHeader(receiptHeader.getId())) {
  3433 + throw new JeecgBootException("悬臂库入库, 更新入库表单头失败");
  3434 + }
  3435 +
  3436 + AgvTask agvTask = new AgvTask();
  3437 + agvTask.setWarehouseCode(warehouseCode);
  3438 + agvTask.setTaskType(QuantityConstant.AGV_TYPE_TAKE_AND_RELEASE);
  3439 + agvTask.setStatus(QuantityConstant.AGV_TASK_STATUS_BUILD);
  3440 + agvTask.setContainerCode(containerCode);
  3441 + agvTask.setFromPort(fromPort);
  3442 + agvTask.setToPort(toPort);
  3443 + agvTask.setPriority(10);
  3444 + result = agvTaskService.addAgvTask(agvTask, warehouseCode);
  3445 + log.info(String.format("AutoCreateAgvTask 生成AGV任务执行:" + result.getMessage()));
  3446 + return Result.OK("悬臂库入库成功");
3308 3447 }
3309 3448  
3310 3449 @Override
... ... @@ -4906,4 +5045,81 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
4906 5045 }
4907 5046 return Result.OK("快速出库成功");
4908 5047 }
  5048 +
  5049 + @Override
  5050 + @Transactional(rollbackFor = Exception.class)
  5051 + public Result cantaleverShipment(QucikReceiptEntity qucikReceiptEntity) {
  5052 + boolean success = false;
  5053 + List<ReceiptEntity> receiptEntityList = qucikReceiptEntity.getReceiptEntityList();
  5054 + String warehouseCode = qucikReceiptEntity.getWarehouseCode();
  5055 + if (StringUtils.isEmpty(warehouseCode)) {
  5056 + return Result.error("快速出库,仓库编码为空");
  5057 + }
  5058 + if (StringUtils.isEmpty(receiptEntityList)) {
  5059 + return Result.error("快速出库,出库信息为空");
  5060 + }
  5061 + String receiptType = QuantityConstant.SHIPMENT_BILL_TYPE_QTC;
  5062 + String remark = "快速出库";
  5063 + String zoneCode = "A";
  5064 + for (ReceiptEntity receiptEntity : receiptEntityList) {
  5065 + BigDecimal qty = receiptEntity.getQty();
  5066 + String materialCode = receiptEntity.getMaterialCode();
  5067 + List<InventoryDetail> inventoryDetailList = inventoryDetailService.getInventoryDetailListByMaterialCode(materialCode, warehouseCode);
  5068 + if (CollectionUtils.isNotEmpty(inventoryDetailList)) {
  5069 + InventoryDetail inventoryDetail = inventoryDetailList.get(0);
  5070 + zoneCode = inventoryDetail.getZoneCode();
  5071 + }
  5072 + }
  5073 + ShipmentHeader shipmentHeader = new ShipmentHeader();
  5074 + shipmentHeader.setWarehouseCode(warehouseCode);
  5075 + shipmentHeader.setCompanyCode(QuantityConstant.DEFAULT_COMPANY);
  5076 + shipmentHeader.setType(receiptType);
  5077 + shipmentHeader.setRemark(remark);
  5078 + shipmentHeader.setZoneCode(zoneCode);
  5079 + shipmentHeader.setZoneType(QuantityConstant.ZONE_TYPE_STEREOSCOPIC);
  5080 + Result result = shipmentHeaderService.saveShipmentHeader(shipmentHeader);
  5081 + if (!result.isSuccess()) {
  5082 + throw new JeecgBootException("快速出库, 创建出库单头失败" + result.getMessage());
  5083 + }
  5084 + for (ReceiptEntity receiptEntity : receiptEntityList) {
  5085 + BigDecimal qty = receiptEntity.getQty();
  5086 + String materialCode = receiptEntity.getMaterialCode();
  5087 + if (StringUtils.isEmpty(materialCode)) {
  5088 + throw new JeecgBootException("快速出库, 物料编码为空");
  5089 + }
  5090 + if (qty.compareTo(BigDecimal.ZERO) <= 0) {
  5091 + throw new JeecgBootException("快速出库, 单据数量必须大于0");
  5092 + }
  5093 + ShipmentDetail shipmentDetail = new ShipmentDetail();
  5094 + shipmentDetail.setWarehouseCode(warehouseCode);
  5095 + shipmentDetail.setCompanyCode(QuantityConstant.DEFAULT_COMPANY);
  5096 + shipmentDetail.setShipmentCode(shipmentHeader.getCode());
  5097 + shipmentDetail.setShipmentId(shipmentHeader.getId());
  5098 + shipmentDetail.setStatus(QuantityConstant.RECEIPT_HEADER_BUILD);
  5099 + shipmentDetail.setZoneCode(zoneCode);
  5100 + shipmentDetail.setQty(qty);
  5101 + Material material = materialService.getMaterialByCode(materialCode);
  5102 + if (material == null) {
  5103 + throw new JeecgBootException("快速出库, 获取物料:" + materialCode + " 信息失败");
  5104 + }
  5105 + shipmentDetail.setInventoryStatus(QuantityConstant.QUALITY_GOOD);
  5106 + shipmentDetail.setMaterialCode(materialCode);
  5107 + shipmentDetail.setMaterialName(material.getName());
  5108 + shipmentDetail.setMaterialSpec(material.getSpec());
  5109 + shipmentDetail.setMaterialUnit(material.getUnit());
  5110 + success = shipmentDetailService.save(shipmentDetail);
  5111 + if (!success) {
  5112 + throw new JeecgBootException("快速出库, 保存出库单详情失败");
  5113 + }
  5114 +
  5115 + }
  5116 + if (!shipmentHeaderService.updateShipmentHeader(shipmentHeader.getId())) {
  5117 + throw new JeecgBootException("快速出库, 更新出库单失败");
  5118 + }
  5119 + result = shipmentHeaderService.autoShipmentCantalever(shipmentHeader.getCode(), warehouseCode);
  5120 + if (!result.isSuccess()) {
  5121 + throw new JeecgBootException("快速出库, 更新出库表单头失败");
  5122 + }
  5123 + return Result.OK("快速出库成功");
  5124 + }
4909 5125 }
... ...