自动化立体仓库 - WMS系统
#
lsh
2024-07-14 1ef5306b1fa675e7650c049e16ba59743e3e8cc5
#
3个文件已修改
107 ■■■■ 已修改文件
src/main/java/com/zy/asrs/task/BareBoardScheduler.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/task/handler/BareBoardHandler.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/utils/CodeDetectionUtil.java 83 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/task/BareBoardScheduler.java
@@ -118,11 +118,11 @@
    @Scheduled(cron = "0/3 * * * * ? ")
    private void execute2(){//自动调空板出库 煜星一楼
        if (slaveWmsParameterProperties.isAutomaticFillingBoardStaNosBoolean()){
            Integer devNo = 448;
            Integer devNo = 445;
            Config config = configService.selectOne(new EntityWrapper<Config>().eq("code","bareBoard448"));
            if (!Cools.isEmpty(config) && !Cools.isEmpty(config.getValue()) && config.getValue().equals("Y")){
                int loadIngCount = basDevpService.selectCount(new EntityWrapper<BasDevp>().ge("dev_no", 421).le("dev_no", devNo).eq("loading", "Y"));
                int count = 25;
                int loadIngCount = basDevpService.selectCount(new EntityWrapper<BasDevp>().ge("dev_no", 422).le("dev_no", devNo).eq("loading", "Y"));
                int count = 20;
                if (loadIngCount<count){
                    bareBoardHandler.startYx(devNo,count);
                }
src/main/java/com/zy/asrs/task/handler/BareBoardHandler.java
@@ -12,6 +12,7 @@
import com.zy.asrs.service.*;
import com.zy.asrs.task.AbstractHandler;
import com.zy.asrs.task.core.ReturnT;
import com.zy.asrs.utils.CodeDetectionUtil;
import com.zy.asrs.utils.Utils;
import com.zy.common.model.enums.WorkNoType;
import com.zy.common.service.CommonService;
@@ -160,6 +161,8 @@
                return null;
            }
            ArrayList<Integer> crns =new ArrayList<>();
            ArrayList<Integer> crnList =new ArrayList<>();
            int[] crnCount = new int[7];
            crns.add(1);
            crns.add(2);
            crns.add(3);
@@ -169,6 +172,21 @@
            crns.add(7);
            boolean sign = true;
            for (Integer crnNo : crns){
                int crnCountD = locMastService.selectCount(new EntityWrapper<LocMast>().eq("loc_sts", "D").eq("crn_no", crnNo));
                crnCount[crnNo-1] = crnCountD;
            }
            crnList.add(CodeDetectionUtil.crnCodeDetectionMax(new int[]{crnCount[0],crnCount[1]})[0]+1);
            crnList.add(CodeDetectionUtil.crnCodeDetectionMax(new int[]{crnCount[2],crnCount[3],crnCount[4]})[0]+3);
            crnList.add(CodeDetectionUtil.crnCodeDetectionMaxT(new int[]{crnCount[2],crnCount[3],crnCount[4]},crnList.get(1))[0]+3);
            crnList.add(CodeDetectionUtil.crnCodeDetectionMax(new int[]{crnCount[5],crnCount[6]})[0]+6);
            crnList.add(1);
            crnList.add(2);
            crnList.add(3);
            crnList.add(4);
            crnList.add(5);
            crnList.add(6);
            crnList.add(7);
            for (Integer crnNo : crnList){
                // 检测路径
                Wrapper<StaDesc> wrapper = new EntityWrapper<StaDesc>()
                        .eq("type_no", 110)
src/main/java/com/zy/asrs/utils/CodeDetectionUtil.java
@@ -7,32 +7,81 @@
    /**
     * 检测货架码
     */
    public static boolean barcodeDetection(String barcode,int code){
        Pattern pattern = Pattern.compile("\\d{"+code+"}");//位数字
    public static boolean barcodeDetection(String barcode, int code) {
        Pattern pattern = Pattern.compile("\\d{" + code + "}");//位数字
        return pattern.matcher(barcode).matches();
    }
    /**
     * 检测小车地码
     */
    public static boolean carCodeDetection(String carCode){
    public static boolean carCodeDetection(String carCode) {
        return carCode.contains("_");
    }
    public static void main(String[] args) {
        System.out.println("barcodeDetection:"+"22222222===>"+barcodeDetection("22222222",7));
        System.out.println("barcodeDetection:"+"222222===>"+barcodeDetection("222222",7));
        System.out.println("barcodeDetection:"+"111===>"+barcodeDetection("111",7));
        System.out.println("barcodeDetection:"+"DB_123ss===>"+barcodeDetection("DB_123ss",7));
        System.out.println("barcodeDetection:"+"12_1231===>"+barcodeDetection("12_1231",7));
        System.out.println("barcodeDetection:"+"DB_123456===>"+barcodeDetection("DB_123456",7));
        System.out.println("carCodeDetection:"+"22222222===>"+carCodeDetection("22222222"));
        System.out.println("carCodeDetection:"+"222222===>"+carCodeDetection("222222"));
        System.out.println("carCodeDetection:"+"111===>"+carCodeDetection("111"));
        System.out.println("carCodeDetection:"+"DB_123ss===>"+carCodeDetection("DB_123ss"));
        System.out.println("carCodeDetection:"+"12_1231===>"+carCodeDetection("12_1231"));
        System.out.println("carCodeDetection:"+"DB_123456===>"+carCodeDetection("DB_123456"));
    /**
     * 检测数组最大值及其索引
     */
    public static int[] crnCodeDetectionMax(int[] arr) {
        int max = arr[0];
        int index = 0;
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] > max) {
                max = arr[i];
                index = i;
            }
        }
        return new int[]{index, max};
    }
    /**
     * 检测数组最大值及其索引
     */
    public static int[] crnCodeDetectionMaxT(int[] arr,Integer crnNo) {
        int max = arr[0];
        int index = 0;
        for (int i = 0; i < arr.length; i++) {
            if (crnNo == i+1){
                continue;
            }
            if (arr[i] > max) {
                max = arr[i];
                index = i;
            }
        }
        return new int[]{index, max};
    }
    /**
     * 检测数组最小值及其索引
     */
    public static int[] crnCodeDetectionMin(int[] arr) {
        int min = arr[0];
        int index = 0;
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] < min) {
                min = arr[i];
                index = i;
            }
        }
        return new int[]{index, min};
    }
//    public static void main(String[] args) {
//        System.out.println("barcodeDetection:" + "22222222===>" + barcodeDetection("22222222", 7));
//        System.out.println("barcodeDetection:" + "222222===>" + barcodeDetection("222222", 7));
//        System.out.println("barcodeDetection:" + "111===>" + barcodeDetection("111", 7));
//        System.out.println("barcodeDetection:" + "DB_123ss===>" + barcodeDetection("DB_123ss", 7));
//        System.out.println("barcodeDetection:" + "12_1231===>" + barcodeDetection("12_1231", 7));
//        System.out.println("barcodeDetection:" + "DB_123456===>" + barcodeDetection("DB_123456", 7));
//
//        System.out.println("carCodeDetection:" + "22222222===>" + carCodeDetection("22222222"));
//        System.out.println("carCodeDetection:" + "222222===>" + carCodeDetection("222222"));
//        System.out.println("carCodeDetection:" + "111===>" + carCodeDetection("111"));
//        System.out.println("carCodeDetection:" + "DB_123ss===>" + carCodeDetection("DB_123ss"));
//        System.out.println("carCodeDetection:" + "12_1231===>" + carCodeDetection("12_1231"));
//        System.out.println("carCodeDetection:" + "DB_123456===>" + carCodeDetection("DB_123456"));
//    }
}