自动化立体仓库 - WMS系统
#
zjj
2025-03-24 86c69620f1bb3976f01b726d3d1804527474898f
src/main/java/com/zy/common/service/CommonService.java
@@ -19,6 +19,7 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
/**
@@ -139,10 +140,19 @@
        LocMast locMast = null;
        List<StaDesc> staDescs = staDescService.selectList(new EntityWrapper<StaDesc>().eq("type_no", 1).eq("stn_no", sourceStaNo));
        int num = 0;
        int crn_no = 1;
        for (StaDesc staDesc : staDescs) {
            //单品
            List<LocMast> locMasts = locMastService.selectAreaEmpty(locTypeDto.getLocType1(), staDesc.getCrnNo());//搜索货物
            int temp = locMast == null ? 0 : locMasts.size();
            if (num <= temp) {
                num = temp;
                crn_no = staDesc.getCrnNo();
            }
        }
        //for (StaDesc staDesc : staDescs) {
        //单品
        List<LocMast> locMasts = locMastService.selectAreaEmpty(locTypeDto.getLocType1(), crn_no);//搜索货物
            for (LocMast mast : locMasts) {
                LocMast tmp = null;
@@ -167,10 +177,17 @@
                        }
                    }
            } else {
                tmp = mast;
                //预留空库位
                if (tmp != null && locMastService.checkEmptyCount(mast, 10)) {
                    locMast = tmp;
                    return locMast;
                }
                }
            }
            // }
        }
        return locMast;
    }