diff --git a/ant-design-vue-jeecg/src/api/api.js b/ant-design-vue-jeecg/src/api/api.js index 1a9a39b..0a4fff0 100644 --- a/ant-design-vue-jeecg/src/api/api.js +++ b/ant-design-vue-jeecg/src/api/api.js @@ -257,7 +257,7 @@ export const auditShipment = (params) => getAction("/audit/audit/auditShipment", //查询是否开启审核流程 export const getDocumentAduitFlow = (params) => getAction("/config/parameterConfiguration/getDocumentAduitFlow", params); //库位监控-快速入库 -export const monitoringQuickReceipt = (params) => postAction("/config/location/quickReceipt", params); +export const monitoringQuickReceipt = (params) => postAction("/receipt/receiveHeader/flatQuickReceipt", params); //快速入库 export const quickReceipt = (params) => postAction("/task/taskHeader/quickReceipt", params); //快速出库,批量快速出整托 @@ -265,7 +265,7 @@ export const shipmentInventoryHeader = (params) => postAction('/inventory/invent //快速出库,批量快速出库存详情 export const shipmentInventoryDetail = (params) => postAction('/inventory/inventoryHeader/shipmentInventoryDetail', params); // 快速出库,通过库存ID -export const autoShipmentByID = (params) => postAction('/config/location/quickShipment', params); +export const flatQuickShipment = (params) => postAction('/shipment/shipmentCombination/flatQuickShipment', params); //呼叫入库托盘 export const callReceiptBox = (params) => postAction('/receipt/receiptHeader/callbox', params); //批量呼叫入库托盘 @@ -316,6 +316,8 @@ export const quickShipment = (params) => postAction("/task/taskHeader/quickShipm export const shipmentCheck = (params) => postAction("/shipment/shipmentCombination/shipmentCheck", params); //查询盘点明细子表 export const listCycleDetailChildByDetailId = (params) => postAction("/cycleCountDetail/cycleCountDetail/listCycleDetailChildByDetailId", params); +//平库上架 +export const flatOnShell = (params) => postAction("/receipt/receiveHeader/flatOnShell", params); // 中转HTTP请求 export const transitRESTful = { diff --git a/ant-design-vue-jeecg/src/views/system/config/MaterialList.vue b/ant-design-vue-jeecg/src/views/system/config/MaterialList.vue index 9e726c5..ba5f41d 100644 --- a/ant-design-vue-jeecg/src/views/system/config/MaterialList.vue +++ b/ant-design-vue-jeecg/src/views/system/config/MaterialList.vue @@ -5,7 +5,7 @@ <a-form layout="inline" @keyup.enter.native="searchQuery"> <a-row :gutter="24"> <a-col :xl="6" :lg="7" :md="8" :sm="24"> - <a-form-item label="物料编码">dy + <a-form-item label="物料编码"> <a-input placeholder="请输入物料编码" v-model="queryParam.code"></a-input> </a-form-item> </a-col> diff --git a/ant-design-vue-jeecg/src/views/system/monitor/modules/ExpressDeliveryModal.vue b/ant-design-vue-jeecg/src/views/system/monitor/modules/ExpressDeliveryModal.vue index 4165903..3b53b95 100644 --- a/ant-design-vue-jeecg/src/views/system/monitor/modules/ExpressDeliveryModal.vue +++ b/ant-design-vue-jeecg/src/views/system/monitor/modules/ExpressDeliveryModal.vue @@ -66,7 +66,7 @@ <script> import JEditableTable from '@/components/jeecg/JEditableTable' -import {execute, autoShipmentByID} from '@/api/api' +import {execute, flatQuickShipment} from '@/api/api' import JDate from '@/components/jeecg/JDate' import JSelectMultiCanUseContainer from "../../../../components/jeecgbiz/JSelectMultiCanUseContainer"; @@ -152,7 +152,7 @@ export default { debugger this.confirmLoading = true this.model = Object.assign({}, record); - autoShipmentByID(record.receiptEntityList).then((res) => { + flatQuickShipment(record.receiptEntityList).then((res) => { this.loading = false; if (res.success) { this.$message.success(res.message); diff --git a/ant-design-vue-jeecg/src/views/system/receipt/ReceiptContainerHeaderList.vue b/ant-design-vue-jeecg/src/views/system/receipt/ReceiptContainerHeaderList.vue index 3359572..2e4a057 100644 --- a/ant-design-vue-jeecg/src/views/system/receipt/ReceiptContainerHeaderList.vue +++ b/ant-design-vue-jeecg/src/views/system/receipt/ReceiptContainerHeaderList.vue @@ -133,7 +133,7 @@ <a v-if="record.status == 0 && record.taskType == 200" @click="selectPort(record)" v-has="'receiptContainerHeader:createTask'"><a-button type="primary">生成任务</a-button></a> <a v-else-if="record.status == 0" @click="createTask(record)" v-has="'receiptContainerHeader:createTask'"><a-button type="primary">生成任务</a-button></a> <a-popconfirm v-if="record.status == 0" v-has="'receiptContainerHeader:delete'" title="确定取消配盘吗?" @confirm="() => handleDelete(record.id)"> - <a><a-button type="danger">取消配盘</a-button> <a-divider type="vertical"/></a> + <a><a-button type="danger">取消配盘</a-button></a> </a-popconfirm> <a v-has="'receiptContainerHeader:edit'" @click="handleEdit(record)"><a-button type="default">编辑</a-button></a> @@ -151,6 +151,7 @@ <receiptContainerSelect-modal ref="modalForm2" @ok="modalFormOk"></receiptContainerSelect-modal> <receiptContainerFillSelect-modal ref="modalForm3" @ok="modalFormOk"></receiptContainerFillSelect-modal> <receiptContainerStatusSelect-modal ref="modalForm4" @ok="modalFormOk"></receiptContainerStatusSelect-modal> + <receipt-container-on-shell-modal ref="modalForm4" @ok="modalFormOk"></receipt-container-on-shell-modal> </a-card> </template> @@ -169,11 +170,13 @@ import ReceiptContainerSelectModal from "./modules/ReceiptContainerSelectModal"; import ReceiptContainerFillSelectModal from "./modules/ReceiptContainerFillSelectModal"; import ReceiptContainerStatusSelectModal from "./modules/ReceiptContainerStatusSelectModal"; import '@/assets/less/TableExpand.less' +import ReceiptContainerOnShellModal from "@views/system/receipt/modules/ReceiptContainerOnShellModal.vue"; export default { name: "ReceiptContainerHeaderList", mixins: [JeecgListMixin], components: { + ReceiptContainerOnShellModal, ReceiptContainerSelectModal, ReceiptContainerDetailList, ReceiptContainerHeaderModal, diff --git a/ant-design-vue-jeecg/src/views/system/receipt/modules/ReceiptContainerOnShellModal.vue b/ant-design-vue-jeecg/src/views/system/receipt/modules/ReceiptContainerOnShellModal.vue new file mode 100644 index 0000000..262cde1 --- /dev/null +++ b/ant-design-vue-jeecg/src/views/system/receipt/modules/ReceiptContainerOnShellModal.vue @@ -0,0 +1,111 @@ +<template> + <j-modal + :title="title" + :width="width" + :visible="visible" + :confirmLoading="confirmLoading" + switchFullscreen + @ok="handleOk" + @cancel="handleCancel" + cancelText="关闭"> + <div class="table-page-search-wrapper"> + <a-spin :spinning="confirmLoading"> + <a-form-model ref="form" :model="model" :rules="validatorRules" > + <a-row> + <a-col :span="24"> + <a-form-model-item label="库位编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="toLocationCode"> + <a-input v-model="model.remark" placeholder="请输入库位编码"></a-input> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </a-spin> + </div> + </j-modal> +</template> + +<script> + +import {httpAction} from '@/api/manage' +import {validateDuplicateValue} from '@/utils/util' +import {flatOnShell} from '@/api/api' + +export default { + name: "ReceiptContainerOnShellModal", + components: {}, + props: { + mainId: { + type: String, + required: false, + default: '' + } + }, + data() { + return { + title: "操作", + portList: [], + flag:'0', + width: 500, + visible: false, + model: {}, + labelCol: { + xs: {span: 24}, + sm: {span: 5}, + }, + wrapperCol: { + xs: {span: 24}, + sm: {span: 16}, + }, + confirmLoading: false, + validatorRules: { + toLocationCode: [{ required: true, message: '请输入库位编码!' }] + }, + url: { + } + } + }, + created() { + //备份model原始值 + this.modelDefault = JSON.parse(JSON.stringify(this.model)); + }, + methods: { + add() { + this.edit(this.modelDefault); + }, + edit(record) { + this.model = Object.assign({}, record); + this.visible = true; + }, + close() { + this.$emit('close'); + this.visible = false; + this.$refs.form.clearValidate(); + }, + handleOk() { + const that = this; + // 触发表单验证 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true; + flatOnShell(this.model).then((res) => { + if (res.success) { + that.$message.success(res.message); + that.$emit('ok'); + } else { + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + that.close(); + }); + } else { + return false + } + }); + }, + handleCancel() { + this.close() + }, + } +} +</script> diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/container/service/IContainerService.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/container/service/IContainerService.java index c59883c..4013380 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/container/service/IContainerService.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/container/service/IContainerService.java @@ -19,6 +19,8 @@ public interface IContainerService extends IService<Container> { Container getContainerByCode(String containCode, String warehouseCode); + Container getContainerByLocationCode(String locationCode, String warehouseCode); + boolean updateStatus(String containerCode, String status, String warehouseCode); boolean updateFillStatus(String containerCode, String fillStatus, String warehouseCode); diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/container/service/impl/ContainerServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/container/service/impl/ContainerServiceImpl.java index 2f097df..0a8069d 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/container/service/impl/ContainerServiceImpl.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/container/service/impl/ContainerServiceImpl.java @@ -91,6 +91,20 @@ public class ContainerServiceImpl extends ServiceImpl<ContainerMapper, Container } @Override + public Container getContainerByLocationCode(String locationCode, String warehouseCode) { + if (StringUtils.isEmpty(locationCode)) { + throw new JeecgBootException("库位编码为空"); + } + if (StringUtils.havaLowerCase(locationCode)) { + throw new JeecgBootException("库位不能有小字母" + locationCode); + } + LambdaQueryWrapper<Container> containerLambdaQueryWrapper = Wrappers.lambdaQuery(); + containerLambdaQueryWrapper.eq(Container::getLocationCode, locationCode).eq(Container::getWarehouseCode, warehouseCode); + Container container = containerService.getOne(containerLambdaQueryWrapper); + return container; + } + + @Override @Transactional public boolean updateStatus(String containerCode, String status, String warehouseCode) { LambdaUpdateWrapper<Container> updateWrapper = Wrappers.lambdaUpdate(); diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/controller/LocationController.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/controller/LocationController.java index b02a154..14d3cca 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/controller/LocationController.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/controller/LocationController.java @@ -12,19 +12,15 @@ import org.jeecg.common.api.vo.Result; import org.jeecg.common.aspect.annotation.AutoLog; import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.system.query.QueryGenerator; -import org.jeecg.modules.wms.api.mobile.entity.QuickReceiptBean; -import org.jeecg.modules.wms.config.container.service.IContainerService; import org.jeecg.modules.wms.config.location.dto.*; 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.modules.wms.framework.service.IHuahengMultiHandlerService; -import org.jeecg.modules.wms.shipment.shipmentCombination.entity.FlatShipment; import org.jeecg.utils.HuahengJwtUtil; import org.jeecg.utils.PageUtil; import org.jeecg.utils.StringUtils; import org.jeecg.utils.constant.QuantityConstant; -import org.jeecg.utils.support.ApiLogger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -94,9 +90,9 @@ public class LocationController extends JeecgController<Location, ILocationServi @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { Page<Location> page = new Page<Location>(pageNo, pageSize); HuahengJwtUtil.setWarehouseCode(req, location); - IPage<Location> pageList = locationService.getContainerInLocation(page, QuantityConstant.STATUS_LOCATION_EMPTY, - QuantityConstant.STATUS_CONTAINER_EMPTY, QuantityConstant.STATUS_CONTAINER_FILL_SOME, HuahengJwtUtil.getWarehouseCodeByToken(req), - location.getZoneCode(), location.getContainerCode(), location.getCode(), location.getRoadWay()); + IPage<Location> pageList = locationService.getContainerInLocation(page, QuantityConstant.STATUS_LOCATION_EMPTY, QuantityConstant.STATUS_CONTAINER_EMPTY, + QuantityConstant.STATUS_CONTAINER_FILL_SOME, HuahengJwtUtil.getWarehouseCodeByToken(req), location.getZoneCode(), location.getContainerCode(), + location.getCode(), location.getRoadWay()); return Result.OK(pageList); } @@ -111,9 +107,9 @@ public class LocationController extends JeecgController<Location, ILocationServi @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { Page<Location> page = new Page<Location>(pageNo, pageSize); HuahengJwtUtil.setWarehouseCode(req, location); - IPage<Location> pageList = locationService.getContainerInLocation(page, QuantityConstant.STATUS_LOCATION_EMPTY, - QuantityConstant.STATUS_CONTAINER_EMPTY, QuantityConstant.STATUS_CONTAINER_EMPTY, HuahengJwtUtil.getWarehouseCodeByToken(req), - location.getZoneCode(), location.getContainerCode(), location.getCode(), location.getRoadWay()); + IPage<Location> pageList = locationService.getContainerInLocation(page, QuantityConstant.STATUS_LOCATION_EMPTY, QuantityConstant.STATUS_CONTAINER_EMPTY, + QuantityConstant.STATUS_CONTAINER_EMPTY, HuahengJwtUtil.getWarehouseCodeByToken(req), location.getZoneCode(), location.getContainerCode(), + location.getCode(), location.getRoadWay()); return Result.OK(pageList); } @@ -128,9 +124,9 @@ public class LocationController extends JeecgController<Location, ILocationServi @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { Page<Location> page = new Page<Location>(pageNo, pageSize); HuahengJwtUtil.setWarehouseCode(req, location); - IPage<Location> pageList = locationService.getContainerInLocation(page, QuantityConstant.STATUS_LOCATION_EMPTY, - QuantityConstant.STATUS_CONTAINER_EMPTY, QuantityConstant.STATUS_CONTAINER_FILL_MANY, HuahengJwtUtil.getWarehouseCodeByToken(req), - location.getZoneCode(), location.getContainerCode(), location.getCode(), location.getRoadWay()); + IPage<Location> pageList = locationService.getContainerInLocation(page, QuantityConstant.STATUS_LOCATION_EMPTY, QuantityConstant.STATUS_CONTAINER_EMPTY, + QuantityConstant.STATUS_CONTAINER_FILL_MANY, HuahengJwtUtil.getWarehouseCodeByToken(req), location.getZoneCode(), location.getContainerCode(), + location.getCode(), location.getRoadWay()); return Result.OK(pageList); } @@ -317,23 +313,4 @@ public class LocationController extends JeecgController<Location, ILocationServi return Result.OK(compareContainerTaskDtoPage); } - /** - * 平库出库,通过库存ID - * @return - */ - @ApiOperation(value = "库位监控-快速出库,通过库存ID", notes = "库位监控,通过库存ID") - @PostMapping("/quickShipment") - public Result quickShipment(@RequestBody List<FlatShipment> flatShipmentList, HttpServletRequest req){ - String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); - return huahengMultiHandlerService.autoShipmentByIDService(flatShipmentList, warehouseCode); - } - - @ApiOperation(value = "库位监控-快速入库", notes = "快速入库") - @PostMapping("/quickReceipt") - public Result<?> quickReceipt(@RequestBody QuickReceiptBean bean, HttpServletRequest req) { - String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); - bean.setWarehouseCode(warehouseCode); - Result result = huahengMultiHandlerService.quickReceiptService(bean, warehouseCode); - return result; - } } diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/framework/service/impl/HuahengMultiHandlerServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/framework/service/impl/HuahengMultiHandlerServiceImpl.java index 7495ba8..0734da8 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/framework/service/impl/HuahengMultiHandlerServiceImpl.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/framework/service/impl/HuahengMultiHandlerServiceImpl.java @@ -34,7 +34,6 @@ import org.jeecg.modules.wms.receipt.receiving.domain.Receive; import org.jeecg.modules.wms.receipt.receiving.service.IReceiveService; import org.jeecg.modules.wms.shipment.shipmentCombination.entity.CombinationModel; import org.jeecg.modules.wms.shipment.shipmentCombination.entity.FlatShipment; -import org.jeecg.modules.wms.shipment.shipmentCombination.entity.Shipment; import org.jeecg.modules.wms.shipment.shipmentCombination.service.IShipmentCombinationService; import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentContainerHeader; import org.jeecg.modules.wms.shipment.shipmentContainerHeader.service.IShipmentContainerHeaderService; @@ -46,12 +45,11 @@ import org.jeecg.modules.wms.shipment.shipmentHeader.service.IShipmentHeaderServ import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader; import org.jeecg.modules.wms.task.taskHeader.service.ITaskHeaderService; import org.jeecg.utils.constant.QuantityConstant; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import lombok.extern.slf4j.Slf4j; -import org.springframework.transaction.annotation.Transactional; /** * @author 游杰 @@ -100,7 +98,6 @@ public class HuahengMultiHandlerServiceImpl extends HuahengBaseController implem @Resource private ILocationService locationService; - @Override public Result sendTaskToWcs(TaskHeader taskHeader, String zoneCode) { if (taskHeader == null) { @@ -144,17 +141,18 @@ public class HuahengMultiHandlerServiceImpl extends HuahengBaseController implem if (flatShipmentList == null || flatShipmentList.size() == 0) { return Result.error("参数不能为空"); } - for (FlatShipment item :flatShipmentList){ + for (FlatShipment item : flatShipmentList) { if (item.getInventoryDetailId() == null) { return Result.error("库存ID不能为空"); } - if (item.getShipQty() == null || item.getShipQty().compareTo(BigDecimal.ZERO) == 0){ + if (item.getShipQty() == null || item.getShipQty().compareTo(BigDecimal.ZERO) == 0) { return Result.error("出库数量不能为空"); } } // 通过库存ID查询库存详情数据 - List<InventoryDetail> inventoryDetailList = inventoryDetailService.listByIds(flatShipmentList.stream().map(FlatShipment::getInventoryDetailId).collect(Collectors.toList())); - if (inventoryDetailList == null || inventoryDetailList.size() == 0){ + List<InventoryDetail> inventoryDetailList = + inventoryDetailService.listByIds(flatShipmentList.stream().map(FlatShipment::getInventoryDetailId).collect(Collectors.toList())); + if (inventoryDetailList == null || inventoryDetailList.size() == 0) { return Result.error("根据库存ID查询库存信息失败!"); } // 根据库存详情创建出库单 @@ -165,11 +163,11 @@ public class HuahengMultiHandlerServiceImpl extends HuahengBaseController implem shipmentHeader.setZoneCode(QuantityConstant.ZONE_TYPE_FLAT); shipmentHeader.setCompanyCode(inventoryDetailList.get(0).getCompanyCode()); Result result = shipmentHeaderService.saveShipmentHeader(shipmentHeader); - if (!result.isSuccess()){ + if (!result.isSuccess()) { return result; } List<ShipmentDetail> shipmentDetailList = new ArrayList<>(); - for (FlatShipment item : flatShipmentList){ + for (FlatShipment item : flatShipmentList) { InventoryDetail inventoryDetail = inventoryDetailMap.get(item.getInventoryDetailId()); ShipmentDetail shipmentDetail = new ShipmentDetail(); shipmentDetail.setShipmentId(shipmentHeader.getId()); @@ -181,23 +179,24 @@ public class HuahengMultiHandlerServiceImpl extends HuahengBaseController implem shipmentDetail.setInventoryDetailId(item.getInventoryDetailId()); shipmentDetail.setCompanyCode(shipmentHeader.getCompanyCode()); result = shipmentDetailService.saveShipmentDetail(shipmentDetail); - if (!result.isSuccess()){ + if (!result.isSuccess()) { throw new RuntimeException(result.getMessage()); } shipmentDetailList.add(shipmentDetail); } // 将出库单详情转换为map存储 - Map<Integer, ShipmentDetail> shipmentDetailMap = shipmentDetailList.stream().collect(Collectors.toMap(ShipmentDetail::getInventoryDetailId, Function.identity())); - for (FlatShipment item : flatShipmentList){ + Map<Integer, ShipmentDetail> shipmentDetailMap = + shipmentDetailList.stream().collect(Collectors.toMap(ShipmentDetail::getInventoryDetailId, Function.identity())); + for (FlatShipment item : flatShipmentList) { item.setShipmentDetailId(shipmentDetailMap.get(item.getInventoryDetailId()).getId()); item.setContainerCode(inventoryDetailMap.get(item.getInventoryDetailId()).getContainerCode()); } // 将flatShipmentList根据容器进行分类合并为一个map Map<String, List<FlatShipment>> stringListMap = flatShipmentList.stream().collect(Collectors.groupingBy(FlatShipment::getContainerCode)); // 遍历stringListMap并完成出库任务 - for (String containerCode :stringListMap.keySet()){ + for (String containerCode : stringListMap.keySet()) { result = shipmentCombinationService.flatShipmentByContainerCode(containerCode, stringListMap.get(containerCode), warehouseCode); - if (!result.isSuccess()){ + if (!result.isSuccess()) { throw new RuntimeException(result.getMessage()); } } @@ -208,11 +207,25 @@ public class HuahengMultiHandlerServiceImpl extends HuahengBaseController implem @Transactional(rollbackFor = Exception.class) public Result quickReceiptService(QuickReceiptBean bean, String warehouseCode) { String containerCode = bean.getContainerCode(); + String locationCode = bean.getLocationCode(); + if (StringUtils.isEmpty(locationCode)) { + return Result.error("平库入库,库位编码为空"); + } + Location location = locationService.getLocationByCode(locationCode, warehouseCode); + if (location == null) { + return Result.error("平库入库, 库位:" + locationCode + "不存在"); + } + if (StringUtils.isEmpty(containerCode)) { + Container container = containerService.getContainerByLocationCode(locationCode, warehouseCode); + if (container != null) { + containerCode = container.getCode(); + } + } if (StringUtils.isEmpty(containerCode)) { Container container = containerService.createLSContainer(warehouseCode); containerCode = container.getCode(); } - if (StringUtils.isEmpty(containerCode)){ + if (StringUtils.isEmpty(containerCode)) { return Result.error("托盘号containerCode不能为空"); } if (bean.getReceiptDetails() == null || bean.getReceiptDetails().size() == 0) { @@ -227,19 +240,15 @@ public class HuahengMultiHandlerServiceImpl extends HuahengBaseController implem if (!rs1.isSuccess()) { return rs1; } - Location location = locationService.getLocationByCode(bean.getLocationCode(), warehouseCode); - if (location == null) { - return Result.error("库位:"+bean.getLocationCode()+"不存在"); - } - if (!QuantityConstant.ZONE_TYPE_FLAT.equals(location.getZoneCode())){ - return Result.error("库位:"+bean.getLocationCode()+"不是平库库位"); + if (!QuantityConstant.ZONE_TYPE_FLAT.equals(location.getZoneCode())) { + return Result.error("库位:" + bean.getLocationCode() + "不是平库库位"); } // 创建入库单明细 List<ReceiptDetail> receiptDetails = bean.getReceiptDetails(); List<Receive> receiveList = new ArrayList<>(); for (ReceiptDetail receiptDetail : receiptDetails) { - if (receiptDetail.getQty() == null || receiptDetail.getQty().compareTo(BigDecimal.ZERO) == 0){ - throw new JeecgBootException("物料编码:" + receiptDetail.getMaterialCode() + "入库数量不能为0!" ); + if (receiptDetail.getQty() == null || receiptDetail.getQty().compareTo(BigDecimal.ZERO) == 0) { + throw new JeecgBootException("物料编码:" + receiptDetail.getMaterialCode() + "入库数量不能为0!"); } Receive receive = new Receive(); receiptDetail.setReceiptId(receiptHeader.getId()); diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiving/controller/ReceiveController.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiving/controller/ReceiveController.java index 1abaaa8..e9fe086 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiving/controller/ReceiveController.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiving/controller/ReceiveController.java @@ -10,10 +10,12 @@ import javax.servlet.http.HttpServletRequest; import org.jeecg.common.api.vo.Result; import org.jeecg.common.aspect.annotation.AutoLog; import org.jeecg.common.system.query.QueryGenerator; +import org.jeecg.modules.wms.api.mobile.entity.QuickReceiptBean; 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.service.ILocationService; import org.jeecg.modules.wms.framework.controller.HuahengBaseController; +import org.jeecg.modules.wms.framework.service.IHuahengMultiHandlerService; import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryHeader; import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryHeaderService; import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptDetail; @@ -50,6 +52,8 @@ public class ReceiveController extends HuahengBaseController { private ILocationService locationService; @Resource private IInventoryHeaderService inventoryHeaderService; + @Resource + private IHuahengMultiHandlerService huahengMultiHandlerService; /** * 通过详情ID查询 @@ -228,4 +232,13 @@ public class ReceiveController extends HuahengBaseController { }); return result; } + + @ApiOperation(value = "平库快速入库", notes = "平库快速入库") + @PostMapping("/flatQuickReceipt") + public Result<?> flatQuickReceipt(@RequestBody QuickReceiptBean bean, HttpServletRequest req) { + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); + bean.setWarehouseCode(warehouseCode); + Result result = huahengMultiHandlerService.quickReceiptService(bean, warehouseCode); + return result; + } } diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiving/service/impl/ReceiveServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiving/service/impl/ReceiveServiceImpl.java index edb782c..aa930b5 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiving/service/impl/ReceiveServiceImpl.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiving/service/impl/ReceiveServiceImpl.java @@ -161,7 +161,7 @@ public class ReceiveServiceImpl extends ServiceImpl<ReceiveMapper, Receive> impl String zoneCode = location.getZoneCode(); Zone zone = zoneService.getZoneByCode(zoneCode, warehouseCode); if (!zone.getType().equals(QuantityConstant.ZONE_TYPE_STEREOSCOPIC)) { - return Result.error("入库组盘,库区类型不是立库区"); +// return Result.error("入库组盘,库区类型不是立库区"); } } int callBox = QuantityConstant.NOT_CALL_BOX; @@ -676,7 +676,7 @@ public class ReceiveServiceImpl extends ServiceImpl<ReceiveMapper, Receive> impl @Transactional(rollbackFor = Exception.class) public Result flatReceipt(List<Receive> receiveList, String containerCode, String toLocationCode, String warehouseCode) { Result result = receiveService.flatReceive(receiveList, containerCode, warehouseCode); - if (!result.isSuccess()){ + if (!result.isSuccess()) { throw new JeecgBootException(result.getMessage()); } result = receiveService.flatOnShell(containerCode, toLocationCode, warehouseCode); diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/controller/ShipmentCombinationController.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/controller/ShipmentCombinationController.java index 21376cc..b6d5069 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/controller/ShipmentCombinationController.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/controller/ShipmentCombinationController.java @@ -398,4 +398,15 @@ public class ShipmentCombinationController extends HuahengBaseController { }); return result; } + + /** + * 平库出库,通过库存ID + * @return + */ + @ApiOperation(value = "库位监控-快速出库,通过库存ID", notes = "库位监控,通过库存ID") + @PostMapping("/flatQuickShipment") + public Result flatQuickShipment(@RequestBody List<FlatShipment> flatShipmentList, HttpServletRequest req) { + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req); + return huahengMultiHandlerService.autoShipmentByIDService(flatShipmentList, warehouseCode); + } } diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java index 3e2e85b..ed113d0 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java @@ -317,7 +317,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea Location location = locationService.getNear(fromLocation); String locationCode = location.getCode(); if (StringUtils.isNotEmpty(location.getContainerCode())) { - TaskHeader taskHeader = getUnCompleteTaskByFromLocationCode(fromLocationCode, warehouseCode); + TaskHeader taskHeader = getUnCompleteTaskByFromLocationCode(locationCode, warehouseCode); if (taskHeader != null) { preTaskNo = taskHeader.getId(); } else {