自动化立体仓库 - WMS系统
zhou zhou
1 天以前 fee18a4910fe117f5f75780550fe3bd7c9d50fa1
src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java
@@ -31,6 +31,7 @@
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
@@ -148,7 +149,7 @@
        // 生成工作档明细
        List<DetlDto> detlDtos = new ArrayList<>();
        param.getList().forEach(elem -> {
            DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getBrand(), elem.getStandby1(), elem.getStandby2(), elem.getStandby3(), elem.getBoxType1(), elem.getBoxType2(), elem.getBoxType3(), elem.getAnfme());
            DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getBrand(), elem.getStandby1(), elem.getStandby2(), elem.getStandby3(), elem.getBoxType1(), elem.getBoxType2(), elem.getBoxType3(), elem.getAnfme(), elem.getThreeCode());
            if (DetlDto.has(detlDtos, detlDto)) {
                DetlDto detlDto1 = DetlDto.find(detlDtos, detlDto.getMatnr(), detlDto.getBatch(), detlDto.getBrand(), detlDto.getStandby1(), detlDto.getStandby2(), detlDto.getStandby3(), detlDto.getBoxType1(), detlDto.getBoxType2(), detlDto.getBoxType3());
                assert detlDto1 != null;
@@ -274,7 +275,7 @@
                        }
                        detlDtos.add(new DetlDto(locDetl.getMatnr(), locDetl.getBatch(), locDetl.getBrand(),
                                locDetl.getStandby1(), locDetl.getStandby2(), locDetl.getStandby3(),
                                locDetl.getBoxType1(), locDetl.getBoxType2(), locDetl.getBoxType3(), locDetl.getAnfme()));
                                locDetl.getBoxType1(), locDetl.getBoxType2(), locDetl.getBoxType3(), locDetl.getAnfme(), locDetl.getThreeCode()));
                        locDetl.setOwner(param.getOwnerId());
                        try {
                            locDetlService.update(locDetl, new EntityWrapper<LocDetl>().eq("loc_no", locNo).eq("matnr", locDetl.getMatnr()));
@@ -409,8 +410,21 @@
        // 判断是否是盘点单
        String orderNo = taskDto.getLocDtos().get(0).getOrderNo();
//        OrderPakout orderPakout = orderPakOutService.selectByNo(orderNo);
        CheckOrder checkOrder = checkOrderService.selectOne(new EntityWrapper<CheckOrder>().eq("order_no", orderNo));
        int ioType = checkOrder.getDocType() == 8 ? 107 : (taskDto.isAll() ? 101 : 103);
        int ioType =  (taskDto.isAll() ? 101 : 103);
        if(ioType == 101){
            boolean DiffQty = taskDto.getLocDtos().stream().allMatch(locDto ->
                    locDetlService.selectOne(new EntityWrapper<LocDetl>()
                            .eq("loc_no", locDto.getLocNo())
                            .eq("matnr", locDto.getMatnr())
                            .eq("batch", locDto.getBatch())
                            .eq("standby1",locDto.getStandby2())
                    ).getDiffQty().compareTo(BigDecimal.ZERO) == 0
            );
            if (!DiffQty){
                ioType = 103;
            }
        }
        StaDesc staDesc = staDescService.queryCrnStnAuto(ioType, locMast.getCrnNo(), staNo.getDevNo());
        // 生成工作号
        int workNo = commonService.getWorkNo(WorkNoType.getWorkNoType(ioType));