自动化立体仓库 - WMS系统
LSH
2023-07-13 67e69c6ef36fba3805516a022e5bf431981cd641
src/main/java/com/zy/asrs/controller/OutController.java
@@ -16,6 +16,7 @@
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
@@ -61,6 +62,11 @@
        }
        List<OrderDetl> orderDetls = orderDetlService.selectBatchIds(ids);
        List<LocDto> locDtos = new ArrayList<>();
        for (OrderDetl o: orderDetls) {
            if (o.getAnfme().equals(o.getWorkQty())){
                return R.error("出库的明细中有已出库物料");
            }
        }
        Set<String> exist = new HashSet<>();
@@ -81,8 +87,10 @@
                    locDto.setManu(locDetl.getManu());
                    locDtos.add(locDto);
                    exist.add(locDetl.getLocNo());
                    BigDecimal iss=new BigDecimal(Double.toString(issued));
                    BigDecimal an=new BigDecimal(Double.toString(locDetl.getAnfme()));
                    // 剩余待出数量递减
                    issued = issued - locDetl.getAnfme();
                    issued=iss.subtract(an).doubleValue();
                } else {
                    break;
                }
@@ -217,7 +225,7 @@
            ManLocDetl manLocDetl = manLocDetlService.selectItem(locDto.getLocNo(), locDto.getMatnr(), locDto.getBatch());
            if (!Cools.isEmpty(manLocDetl) && !(locDto.getAnfme()>manLocDetl.getAnfme())) {
                manLocDetl.setStatus(0);
                if (manLocDetlService.update(manLocDetl, new EntityWrapper<ManLocDetl>().eq("uuid", manLocDetl.getUuid()))) {
                if (manLocDetlService.update(manLocDetl, new EntityWrapper<ManLocDetl>().eq("loc_no", manLocDetl.getLocNo()).eq("matnr",manLocDetl.getMatnr()))) {
                    if (addPakOUT(locDto,uuid).equals(R.ok())) {
                        Order order = orderService.selectByNo(locDto.getOrderNo());
                        if (Cools.isEmpty(order)){
@@ -261,7 +269,7 @@
        manPakOut.setMatnr(locDto.getMatnr());
        manPakOut.setMaktx(locDto.getMaktx());
        manPakOut.setDocNum(locDto.getOrderNo());
        manPakOut.setCount(0);
        manPakOut.setCount(0.0);
        manPakOut.setStatus(0);
        manPakOut.setCreateTime(new Date());
        manPakOut.setBatch(locDto.getBatch());