skyouc
7 天以前 e046dba174365eb8934ee1e4206f09821145e876
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/manage/OutManage.java
@@ -3,6 +3,7 @@
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.mysql.cj.util.StringUtils;
import com.zy.asrs.wms.asrs.entity.param.StockOutParam;
import com.zy.asrs.framework.exception.CoolException;
@@ -534,6 +535,7 @@
    /**
     * 波次出库预览
     *
     * @param param
     * @return
     */
@@ -587,7 +589,7 @@
                    locDto.setLocNo(detl.getLocNo());
                    locDto.setTypeId(LocAreaTypeSts.LOC_AREA_TYPE_FLAT.id);
                    locDto.setLocDetlId(detl.getId());
                    locDto.setAnfme(detl.getAnfme());
                    locDto.setAnfme(detl.getAnfme() - detl.getWorkQty());
                    locDto.setWorkQty(detl.getWorkQty());
                    locDtos.add(locDto);
                    //库位实际可用数量
@@ -1109,6 +1111,11 @@
                throw new CoolException("保存工作档失败");
            }
            wave.setSite(operationPort.getFlag());
            if (!waveService.updateById(wave)) {
                throw new CoolException("波次站口状态更新失败!!");
            }
            for (OrderOutMergeDto merge : list) {
                LocDetl locDetl = locDetlService.getById(merge.getLocDetlId());
                if (locDetl == null) {
@@ -1148,7 +1155,7 @@
                        .eq(WaveDetl::getStockIndex, matUniqueKey)
                        .eq(WaveDetl::getWaveId, wave.getId()));
                if (waveDetl == null) {
                    throw new CoolException("waveId:" + wave.getId()  + "物料:" + taskDetl.getMatnr() + "波次数据不存在");
                    throw new CoolException("waveId:" + wave.getId() + "物料:" + taskDetl.getMatnr() + "波次数据不存在");
                }
                waveDetl.setWorkQty(waveDetl.getWorkQty() + taskDetl.getAnfme());
                waveDetl.setUpdateTime(new Date());
@@ -1161,6 +1168,7 @@
            if (orders.isEmpty()) {
                throw new CoolException("当前波次订单不存在!!");
            }
//            List<CacheSite> cacheSites = cacheSiteService.list(new LambdaQueryWrapper<CacheSite>()
//                    .eq(CacheSite::getSiteStatus, CacheSiteStatusType.O.id).eq(CacheSite::getChannel, task.getTargetSite()));
@@ -1271,6 +1279,12 @@
                if (!locDetlService.updateById(locDetl)) {
                    throw new CoolException("库存加锁失败!!");
                }
                orderDetlService.update(new LambdaUpdateWrapper<OrderDetl>()
                                .set(OrderDetl::getWareType, 2)
                        .eq(OrderDetl::getMatId, mat.getId())
                        .eq(StringUtils.isNullOrEmpty(outOder.getBatch()), OrderDetl::getBatch, outOder.getBatch())
                        .in(OrderDetl::getOrderId, outOder.getOrderIds()));
            });
            curLoc.setLocStsId(LocStsType.R.val());
@@ -1638,7 +1652,10 @@
        for (LocDetl locDetl : param.getLocDetls()) {
            List<OrderOutMergeParam> orders = new ArrayList<>();
            LocDetl detl = locDetlService.getOne(new LambdaQueryWrapper<LocDetl>().eq(LocDetl::getLocNo, locDetl.getLocNo()));
            LocDetl detl = locDetlService.getOne(new LambdaQueryWrapper<LocDetl>()
                    .eq(LocDetl::getMatId, locDetl.getMatId())
                    .eq(LocDetl::getBatch, locDetl.getBatch())
                    .eq(LocDetl::getLocNo, locDetl.getLocNo()));
            if (Objects.isNull(detl)) {
                continue;
            }