自动化立体仓库 - WMS系统
skyouc
4 天以前 88fc713144a877a4257b4173fbfadafd926c94de
src/main/java/com/zy/asrs/controller/OutController.java
@@ -15,6 +15,7 @@
import com.zy.common.model.TaskDto;
import com.zy.common.web.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
@@ -140,30 +141,7 @@
                        LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", locDetl.getLocNo()));
                        locDto.setFrozen(locDetl.getFrozen());
                        locDto.setFrozenLoc(locMast.getFrozen());
                        List<Integer> staNos;
                        if (!Objects.isNull(orderDetl.getStandby1())) {
                            BasDevice basDevice = basDeviceService.selectOne(new EntityWrapper<BasDevice>().eq("dev_no", orderDetl.getStandby1()));
                            if (Objects.isNull(basDevice)) {
                                throw new CoolException("机台信息不存在!!");
                            }
                            List<LocAroundBind> binds = locAroundBindService.selectList(new EntityWrapper<LocAroundBind>().eq("dev_no", basDevice.getDevNo()));
                            if (Objects.isNull(binds) || binds.isEmpty()) {
                                throw new CoolException("台机未绑定工作站台!!");
                            }
                            Set<String> locs = binds.stream().map(LocAroundBind::getBLocNo).collect(Collectors.toSet());
                            LocMast locMasts = locMastService.selectOne(new EntityWrapper<LocMast>()
                                    .in("loc_no", locs)
                                    .eq("loc_sts", LocStsType.LOC_STS_TYPE_O.type)
                                    .eq("dev_no", basDevice.getDevNo())
                                    .orderAsc(Arrays.asList("loc_no"))
                                    .last("OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY"));
                            staNos =  staDescService.queryOutStaNosByLocNo(locMasts.getLocNo(), issued >= locDetl.getAnfme() ? 101 : 103);
                        } else {
                            staNos = staDescService.queryOutStaNosByLocNo(locDetl.getLocNo(), issued >= locDetl.getAnfme() ? 101 : 103);
                        }
                        List<Integer> staNos = staDescService.queryOutStaNosByLocNo(locDetl.getLocNo(), issued >= locDetl.getAnfme() ? 101 : 103);
                        locDto.setStaNos(staNos);
                        locDto.setBrand(orderDetl.getBrand());
                        locDto.setStandby1(orderDetl.getStandby1());
@@ -199,6 +177,7 @@
    @PostMapping("/out/pakout/auth")
    @ManagerAuth(memo = "订单出库")
    @Transactional
    public synchronized R pakout(@RequestBody List<LocDto> locDtos) throws InterruptedException {
        if (Cools.isEmpty(locDtos)) {
            return R.parse(BaseRes.PARAM);
@@ -243,7 +222,12 @@
        for (TaskDto taskDto : taskDtos) {
            BasDevp staNo = basDevpService.checkSiteStatus(taskDto.getStaNo());
            if (!Objects.isNull(taskDto.getDeviceNo())) {
                //生成出库任务
                workService.stockOut(staNo, taskDto, taskDto.getDeviceNo(), getUserId());
                //生成匹配的入库(出库)任务
                workService.genInStock(staNo, taskDto, taskDto.getDeviceNo(), getUserId());
            } else  {
                workService.stockOut(staNo, taskDto, null, getUserId());
            }
        }
        return R.ok();