skyouc
2025-07-14 40b86a2eda4743a8a740836a1b40ada122836ba6
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/MobileServiceImpl.java
@@ -10,6 +10,7 @@
import com.zy.asrs.wms.apis.wcs.entity.response.CommonReponse;
import com.zy.asrs.wms.apis.wcs.utils.HttpEssUtils;
import com.zy.asrs.wms.asrs.entity.*;
import com.zy.asrs.wms.asrs.entity.dto.MatnrDetlDto;
import com.zy.asrs.wms.asrs.entity.dto.PickSheetDetlDto;
import com.zy.asrs.wms.asrs.entity.dto.ShippingOrderDetlDto;
import com.zy.asrs.wms.asrs.entity.enums.*;
@@ -466,7 +467,7 @@
    public void sowLightMange(String siteNo, Order order, String light) {
        // 到达拣选位,控制播种墙亮灯
        CacheSite cacheSite = cacheSiteService.getOne(new LambdaQueryWrapper<CacheSite>()
                            .eq(CacheSite::getSiteNo, siteNo));
                .eq(CacheSite::getSiteNo, siteNo));
        if (Objects.isNull(cacheSite)) {
            log.error("条码:{},未找到播种墙亮灯", siteNo);
            throw new CoolException("未找到播种墙");
@@ -475,7 +476,7 @@
        if (Objects.isNull(detls)) {
            throw new CoolException("数据错误,订单明细不存在!!");
        }
        int anfme = (int)detls.stream().mapToDouble(OrderDetl::getAnfme).sum();
        int anfme = (int) detls.stream().mapToDouble(OrderDetl::getAnfme).sum();
        SlapLightControlParam slapLightControlParam = new SlapLightControlParam();
        slapLightControlParam
                .setControllerCode(cacheSite.getMemo())
@@ -489,7 +490,7 @@
        log.info("播种墙亮灯下发", JSONObject.toJSONString(slapLightControlParam));
        CommonReponse response = HttpEssUtils.post("到达拣选位,播种墙亮灯", HttpEssUtils.PLT_SEND_COMMAND, slapLightControlParam);
        if (response.getCode().equals(0)) {
            log.info("播种墙{}亮灯成功",  cacheSite.getSiteNo());
            log.info("播种墙{}亮灯成功", cacheSite.getSiteNo());
        } else {
            log.info("播种墙{}亮灯失败", cacheSite.getSiteNo());
        }
@@ -680,7 +681,13 @@
        List<LocDetl> detls = locDetlService.list(new LambdaQueryWrapper<LocDetl>()
                .eq(LocDetl::getLocNo, barcode));
        for (int i = 0; i < detls.size(); i++) {
//            detls.get(i).setMats(matService.getOne(new LambdaQueryWrapper<Mat>().eq(Mat::getMatnr, detls.get(i).getMatnr())));
            Mat mat = matService.getOne(new LambdaQueryWrapper<Mat>().eq(Mat::getId, detls.get(i).getMatId()));
            MatnrDetlDto detlDto = new MatnrDetlDto();
            detlDto.setTspec(mat.getSpecs())
                    .setType(mat.getModel())
                    .setMatnrName(mat.getMaktx())
                    .setMatnrNo(mat.getMatnr());
            detls.get(i).setMats(detlDto);
        }
        return detls;
    }
@@ -697,7 +704,7 @@
                .eq(Loc::getLocStsId, LocStsType.F.val())
                .eq(Loc::getLocNo, param.get("barcode")));
        if (Objects.isNull(barcode)) {
            throw new CoolException("源库位明细不存在!!");
            throw new CoolException(param.get("barcode") +  "库位状态不可执行此操作!!");
        }
        Loc tarCode = locService.getOne(new LambdaQueryWrapper<Loc>()
                .eq(Loc::getLocStsId, LocStsType.O.val())
@@ -711,7 +718,7 @@
        List<LocArea> locAreas = locAreaService.list(new LambdaQueryWrapper<LocArea>()
                .in(LocArea::getLocId, ids)
                .eq(LocArea::getTypeId, LocAreaTypeSts.LOC_AREA_TYPE_FLAT.id));
        if (!locAreas.isEmpty() && locAreas.size() == ids.size()) {
        if (!locAreas.isEmpty() && locAreas.size() != ids.size()) {
            throw new CoolException("非平库不可执行此操作!!");
        }
@@ -720,6 +727,19 @@
            return R.error("库位明细不存在!!");
        }
        if (!locService.update(new LambdaUpdateWrapper<Loc>()
                .eq(Loc::getLocNo, barcode.getLocNo())
                .set(Loc::getBarcode, null)
                .set(Loc::getLocStsId, LocStsType.O.val()))) {
            throw new CoolException("源库位状态修改失败!!");
        }
        if (!locService.update(new LambdaUpdateWrapper<Loc>().eq(Loc::getLocNo, tarCode.getLocNo())
                .set(Loc::getBarcode, barcode.getBarcode())
                .set(Loc::getLocStsId, LocStsType.F.val()))) {
            throw new CoolException("目标库位修改失败!!");
        }
        if (!locDetlService.update(new LambdaUpdateWrapper<LocDetl>()
                .eq(LocDetl::getLocId, barcode.getId())
                .set(LocDetl::getLocId, tarCode.getId())