自动化立体仓库 - WMS系统
#
yxFwq
2024-11-29 ccfa512653d817f5a53cb1a4b74a2221d3e65c38
src/main/java/com/zy/common/service/CommonService.java
@@ -137,7 +137,7 @@
        if (Cools.isEmpty(matnr)) {  //物料号
            matnr = "";
        }
        if (Cools.isEmpty(batch)) {  //箱号
        if (Cools.isEmpty(batch)) {  //批次
            batch = "";
        }
        if (Cools.isEmpty(grade)) {  //备用
@@ -180,11 +180,13 @@
            if (basCrnpService.checkSiteError(crnNo, true)) {
                rowCount =  locNecessaryParameters[0];
                nearRow = locNecessaryParameters[3];
                List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>().eq("row1", nearRow).eq("loc_sts", "O"));
                int crnCountO = wrkMastService.selectCount(new EntityWrapper<WrkMast>().eq("crn_no", crnNo).le("io_type",100));
                if (locMasts.size()-crnCountO<=2){
                    times++;
                    continue;
                if (crnNo>5 || crnNo<3){
                    List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>().eq("row1", nearRow).eq("loc_sts", "O"));
                    int crnCountO = wrkMastService.selectCount(new EntityWrapper<WrkMast>().eq("crn_no", crnNo).le("io_type",100));
                    if (locMasts.size()-crnCountO<=2){
                        times++;
                        continue;
                    }
                }
                break;
            } else {
@@ -238,7 +240,7 @@
                if (Utils.isShallowLoc(slaveProperties, locNo)) {
                    continue;
                }
                String shallowLocNo = Utils.getShallowLoc5(slaveProperties, locNo,whsType);
                String shallowLocNo = Utils.getShallowLoc(slaveProperties, locNo);
                // 检测目标库位是否为空库位
                LocMast shallowLoc = locMastService.selectById(shallowLocNo);
                if (shallowLoc != null && shallowLoc.getLocSts().equals("O")) {
@@ -271,18 +273,25 @@
        // 靠近摆放规则 --- 空托 //互通版
        if (staDescId == 10  && Utils.BooleanWhsTypeStaIoType(whsType)) {
            System.out.println("123whsType:"+whsType+"locMast:"+locMast);
            List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>().eq("loc_sts", "D").ge("row1", sRow).le("row1", eRow));
            if (locMasts.size() > 0) {
                System.out.println("234whsType:"+whsType+"locMast:"+locMast);
                for (LocMast loc : locMasts) {
                    if (Utils.isShallowLoc(slaveProperties, loc.getLocNo())) {
                    if (!Utils.isDeepLoc(slaveProperties, loc.getLocNo())) {
                        continue;
                    }
                    String shallowLocNo = Utils.getShallowLoc5(slaveProperties, loc.getLocNo(),whsType);
                    String shallowLocNo = Utils.getShallowLoc(slaveProperties, loc.getLocNo());
                    // 检测目标库位是否为空库位
                    LocMast shallowLoc = locMastService.selectById(shallowLocNo);
                    if (shallowLoc != null && shallowLoc.getLocSts().equals("O")) {
                        if (VersionUtils.locMoveCheckLocTypeComplete(shallowLoc, locTypeDto)) {
                            if (basCrnpService.checkSiteError(shallowLoc.getCrnNo(), true)) {
                                System.out.println("345whsType:"+whsType+"locMast:"+locMast);
                                locMast = shallowLoc;
                                crnNo = locMast.getCrnNo();
                                break;
@@ -332,13 +341,14 @@
            List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>()
                    .eq("row1", nearRow)
                    .eq("loc_sts", "O")
                    .orderBy("lev1",true).orderBy("bay1",true));
                    .orderBy("inv_wh",false).orderBy("lev1",true).orderBy("bay1",true));
            for (LocMast locMast1 : locMasts) {
                if (!VersionUtils.locMoveCheckLocTypeComplete(locMast1, locTypeDto)) {
                    continue;
                }
                if (Utils.BooleanWhsTypeStaIoType(whsType)){
                    String shallowLoc = Utils.getDeepLoc5(slaveProperties, locMast1.getLocNo(),whsType);
                    String shallowLoc = Utils.getDeepLoc(slaveProperties, locMast1.getLocNo());
                    LocMast locMast2 = locMastService.selectOne(new EntityWrapper<LocMast>()
                            .eq("loc_no", shallowLoc).eq("loc_sts", "O"));
                    if (!Cools.isEmpty(locMast2)) {
@@ -359,7 +369,7 @@
                        continue;
                    }
                    if (Utils.BooleanWhsTypeStaIoType(whsType)){
                        String shallowLoc = Utils.getDeepLoc5(slaveProperties, locMast1.getLocNo(),whsType);
                        String shallowLoc = Utils.getDeepLoc(slaveProperties, locMast1.getLocNo());
                        LocMast locMast2 = locMastService.selectOne(new EntityWrapper<LocMast>()
                                .eq("loc_no", shallowLoc).eq("loc_sts", "O"));
                        if (!Cools.isEmpty(locMast2)) {
@@ -369,13 +379,13 @@
                            locMast2 = locMastService.selectOne(new EntityWrapper<LocMast>()
                                    .eq("loc_no", shallowLoc).eq("loc_sts", "F"));
                            if (!Cools.isEmpty(locMast2)) {
                                locMast = locMast2;
                                locMast = locMast1;
                                break;
                            } else {
                                locMast2 = locMastService.selectOne(new EntityWrapper<LocMast>()
                                        .eq("loc_no", shallowLoc).eq("loc_sts", "D"));
                                if (!Cools.isEmpty(locMast2)) {
                                    locMast = locMast2;
                                    locMast = locMast1;
                                    break;
                                }
                            }