Commit 54b0cbe63344fd6bf26e3b8fcef8eabe529a8312
1 parent
f729fd90
feat: 自动出库:指定车间出库
Showing
3 changed files
with
6 additions
and
1 deletions
src/main/java/com/huaheng/common/constant/QuantityConstant.java
... | ... | @@ -494,6 +494,8 @@ public class QuantityConstant { |
494 | 494 | public static final String AUTO_SHIPMENT_DEFAULT_QTY = "autoShipmentDefaultQty"; |
495 | 495 | // 自动出库单据间隔(秒) |
496 | 496 | public static final String AUTO_SHIPMENT_INTERVAL = "autoShipmentInterval"; |
497 | + // 自动出库,生成车间 | |
498 | + public static final String AUTO_SHIPMENT_WORKSHOPS = "autoShipmentWorkshops"; | |
497 | 499 | |
498 | 500 | // 呆滞时间 |
499 | 501 | public static final String DEAD_TIME = "dead_time"; |
... | ... |
src/main/java/com/huaheng/pc/shipment/shipmentContainerHeader/service/ShipmentContainerHeaderServiceImpl.java
... | ... | @@ -257,7 +257,7 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont |
257 | 257 | //shipmentContainerHeader.setPort(shipmentDetail.getPort()); |
258 | 258 | |
259 | 259 | //自动出库自动分配站台 |
260 | - if (isAutoShipment) { | |
260 | + if (isAutoShipment && container.getFlat() != 1) { | |
261 | 261 | List<Station> stations = stationService.list(new LambdaQueryWrapper<Station>() |
262 | 262 | .eq(Station::getIsSorting, 1) |
263 | 263 | .eq(Station::getRoadway, location.getRoadway())); |
... | ... |
src/main/java/com/huaheng/pc/shipment/shipmentHeader/controller/ShipmentHeaderController.java
... | ... | @@ -626,13 +626,16 @@ public class ShipmentHeaderController extends BaseController { |
626 | 626 | if (prepareShipmentHeaderList.isEmpty()) { |
627 | 627 | //从参数配置中获取要自动出库的出库单数量,根据创建时间排序,设备库的出库单优先出库(原仓库编号028和029) |
628 | 628 | int autoShipmentDefaultQty = Integer.parseInt(configService.getKey(AUTO_SHIPMENT_DEFAULT_QTY)); |
629 | + String workshops = configService.getKey(AUTO_SHIPMENT_WORKSHOPS); | |
629 | 630 | List<ShipmentHeader> shipmentHeaderList = shipmentHeaderService.list(new LambdaQueryWrapper<ShipmentHeader>() |
630 | 631 | .eq(ShipmentHeader::getCreatedBy, "MOM") |
631 | 632 | .eq(ShipmentHeader::getAutoShipmentStatus, 0) |
632 | 633 | .eq(ShipmentHeader::getFirstStatus, RECEIPT_HEADER_BUILD) |
633 | 634 | .eq(ShipmentHeader::getLastStatus, RECEIPT_HEADER_BUILD) |
635 | + .eq(StringUtils.isNotBlank(workshops), ShipmentHeader::getWorkshop, workshops) | |
634 | 636 | //将'028'和'029'的优先出库 |
635 | 637 | .last("ORDER BY CASE WHEN warehouse IN ('028', '029') THEN 1 ELSE 2 END, created DESC LIMIT " + autoShipmentDefaultQty)); |
638 | + | |
636 | 639 | if (shipmentHeaderList.isEmpty()) { |
637 | 640 | return AjaxResult.error("没有能自动出库的新建状态出库单了"); |
638 | 641 | } else { |
... | ... |