pjb
2025-07-07 d07b83f5e818f838ce6b956e37aaf758fda58419
Merge branch 'ycds-wms-dev' of http://47.97.1.152:5880/r/zy-asrs-master into ycds-wms-dev
4个文件已修改
57 ■■■■ 已修改文件
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/MobileController.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/ZpalletBarcodeController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/MobileServiceImpl.java 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/WaitPakinServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/MobileController.java
@@ -27,6 +27,7 @@
import com.zy.asrs.wms.system.service.UserService;
import io.jsonwebtoken.lang.Collections;
import io.netty.util.internal.StringUtil;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
@@ -65,6 +66,7 @@
     * @param barcode
     * @return
     */
    @ApiOperation("入库单据--扫码获取订单明细列表")
    @PostMapping("/mat/auth")
    public R getProductForBarcode(@RequestBody Map<String, String> barcode) {
        if (Objects.isNull(barcode)) {
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/ZpalletBarcodeController.java
@@ -55,6 +55,10 @@
    @OperationLog("添加容器管理")
    @PostMapping("/zpalletBarcode/save")
    public R save(@RequestBody ZpalletBarcode zpalletBarcode) {
        ZpalletBarcode one = zpalletBarcodeService.getOne(new LambdaQueryWrapper<ZpalletBarcode>().eq(ZpalletBarcode::getBarcode, zpalletBarcode.getBarcode()));
        if (!Objects.isNull(one)) {
            return R.error("容器已存在,不可重复添加!!");
        }
        if (!zpalletBarcodeService.save(zpalletBarcode)) {
            return R.error("添加失败");
        }
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/MobileServiceImpl.java
@@ -175,7 +175,6 @@
        if (!locService.updateById(loc)) {
            throw new CoolException("库位更新失败!!");
        }
        List<WaitPakin> waitPakins = waitPakinService.list(new LambdaQueryWrapper<WaitPakin>().eq(WaitPakin::getBarcode, shelvesParams.getBarcode()));
        if (waitPakins.isEmpty()) {
            throw new CoolException("当前拖盘没有组拖档!!");
@@ -203,6 +202,16 @@
            }
            //修改状态为入库中
            pakin.setIoStatus(1);
            OrderDetl detl = orderDetlService.getById(pakin.getDetlId());
            if (Objects.isNull(detl)) {
                throw new CoolException("数据错误:单据明细不存在!!");
            }
            Double qty = Math.round((detl.getQty() + pakin.getAnfme()) * 1000) / 1000.0;
            detl.setQty(qty);
            if (!orderDetlService.updateById(detl)) {
                throw new CoolException("单据明细修改失败!!");
            }
        });
        //删除组拖档,加入历史组拖档
@@ -216,30 +225,41 @@
            }
        });
        //通过组拖订单ID获取订单,并删除原单据,加入单据历史档
        Set<Long> list = waitPakins.stream().map(WaitPakin::getOrderId).collect(Collectors.toSet());
        List<Order> orders = orderService.list(new LambdaQueryWrapper<Order>().in(Order::getId, list));
        //订单入历史档
        orders.forEach(order -> {
//            if (order.getOrderType() != OrderType.PK_IN_ORDER.id) {
//                throw new CoolException("当前订单类型:" + order.getOrderType() + ",不可做平库上架操作!!");
//            }
            //修改订单状态为已完成
            order.setOrderSettle(OrderSettleType.COMPLETE.val());
            OrderLog orderLog = new OrderLog();
            BeanUtils.copyProperties(order, orderLog);
            orderLog.setId(null);
            if (!orderLogService.save(orderLog)) {
                throw new CoolException("历史单据更新失败!!");
            List<OrderDetl> detls = orderDetlService.list(new LambdaQueryWrapper<OrderDetl>().eq(OrderDetl::getOrderId, order.getId()));
            Double sum = detls.stream().mapToDouble(OrderDetl::getQty).sum();
            Double summed = detls.stream().mapToDouble(OrderDetl::getWorkQty).sum();
            Double v = Math.round((sum + summed) * 1000) / 1000.0;
            Double anfme = detls.stream().mapToDouble(OrderDetl::getAnfme).sum();
            if (v.compareTo(anfme) == 0.0) {
                order.setOrderSettle(OrderSettleType.COMPLETE.val());
                if (! orderService.updateById(order)) {
                    throw new CoolException("单据状态修改失败!!");
                }
            }
        });
//        //订单入历史档
//        orders.forEach(order -> {
////            if (order.getOrderType() != OrderType.PK_IN_ORDER.id) {
////                throw new CoolException("当前订单类型:" + order.getOrderType() + ",不可做平库上架操作!!");
////            }
//            //修改订单状态为已完成
//            order.setOrderSettle(OrderSettleType.COMPLETE.val());
//            OrderLog orderLog = new OrderLog();
//            BeanUtils.copyProperties(order, orderLog);
//            orderLog.setId(null);
//            if (!orderLogService.save(orderLog)) {
//                throw new CoolException("历史单据更新失败!!");
//            }
//        });
//        //删除订单数据
//        if (!orderService.removeBatchByIds(orders)) {
//            throw new CoolException("订单删除失败!!");
//        }
//        List<OrderDetl> detls = orderDetlMapper.selectList(new LambdaQueryWrapper<OrderDetl>().in(OrderDetl::getOrderId, list));
//        List<OrderDetlLog> detlLogs = new ArrayList<>();
//        detls.forEach(delt ->{
@@ -250,7 +270,6 @@
//            detlLog.setId(null);
//            detlLogs.add(detlLog);
//        });
//        //订单明细转历史档
//        if (!orderDetlLogService.saveBatch(detlLogs)) {
//            throw new CoolException("订单明细转历史失败!!");
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/WaitPakinServiceImpl.java
@@ -60,7 +60,7 @@
        }
        //可用数量
        Double count = orderDetl.getAnfme() - orderDetl.getWaitQty();
        Double count = Math.round((orderDetl.getAnfme() - orderDetl.getWorkQty() - orderDetl.getQty()) * 1000) / 1000.0;
        if (waitPakin.getAnfme() > count) {
            throw new CoolException("组托数量超过剩余可用数量");
        }