云
昨天 704265308b1227dbada5a36b2027b588c062ded2
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/framework/qrcode/MesProQrLabelBuilder.java
@@ -44,6 +44,26 @@
    private MesProQrLabelBuilder() {
    }
    /** 内部业务标签独立于公众追溯标签,不拼接 H5 网址。 */
    public static QrLabelInfo buildBagBusinessCodeLabel(MesProBagCodeDO bag) {
        return buildBusinessCodeLabel(bag.getBusinessCode());
    }
    public static QrLabelInfo buildPalletBusinessCodeLabel(MesProPalletDO pallet) {
        return buildBusinessCodeLabel(pallet.getBusinessCode());
    }
    public static QrLabelInfo buildBatchBusinessCodeLabel(MesProBatchDO batch) {
        return buildBusinessCodeLabel(batch.getBusinessCode());
    }
    private static QrLabelInfo buildBusinessCodeLabel(String code) {
        if (code == null || !code.matches("^[0-9]{16}$")) {
            throw new cn.iocoder.yudao.framework.common.exception.ServiceException(400, "缺少有效业务码,请先补生成业务码");
        }
        return QrLabelInfo.builder().fileName(code).code(code).keyValues(new LinkedHashMap<>()).build();
    }
    /**
     * 单元识别代码格式:1~20 位数字或字母数字组合(国标要求,不含连字符等符号)
     */