自动化立体仓库 - WMS系统
skyouc
2 天以前 6cb4e6647b0e2e8c0cafa38a07666e07709bcf54
src/main/java/com/zy/asrs/utils/MatExcelListener.java
@@ -61,7 +61,7 @@
        Long tagId;
        // 分类
        // 一级分类
        if (!Cools.isEmpty(excel.getPriClass()) && !Cools.isEmpty(excel.getSecClass())) {
        if (!Cools.isEmpty(excel.getPriClass())) {
            Tag priTag = tagService.selectByName(excel.getPriClass(), 2);
            if (priTag == null) {
                Tag top = tagService.getTop();
@@ -92,38 +92,40 @@
                    throw new CoolException("保存一级分类失败");
                }
            }
            // 二级分类
            Tag secTag = tagService.selectByName(excel.getSecClass(), 3);
            if (secTag == null) {
                NodeUtils nodeUtils = new NodeUtils();
                nodeUtils.executePath(priTag.getId());
                secTag = new Tag(
                        null,    // 编号
                        excel.getSecClass(),    // 名称
                        priTag.getId(),    // 父级
                        priTag.getName(),    // 父级名称
                        nodeUtils.path.toString(),    // 关联路径
                        nodeUtils.pathName.toString(),    // 关联路径名
                        0,    // 类型
                        null,    // 负责人
                        null,    // 图片
                        null,    // 简要描述
                        null,    // 数量
                        3,    // 等级
                        null,    // 排序
                        1,    // 状态
                        now,    // 添加时间
                        null,    // 添加人员
                        now,    // 修改时间
                        null,    // 修改人员
                        null    // 备注
                );
                if (tagMapper.insert(secTag) == 0) {
                    throw new CoolException("保存二级分类失败");
                }
            }
            tagId = secTag.getId();
        } else {
//            // 二级分类
//            Tag secTag = tagService.selectByName(excel.getSecClass(), 3);
//            if (secTag == null) {
//                NodeUtils nodeUtils = new NodeUtils();
//                nodeUtils.executePath(priTag.getId());
//                secTag = new Tag(
//                        null,    // 编号
//                        excel.getSecClass(),    // 名称
//                        priTag.getId(),    // 父级
//                        priTag.getName(),    // 父级名称
//                        nodeUtils.path.toString(),    // 关联路径
//                        nodeUtils.pathName.toString(),    // 关联路径名
//                        0,    // 类型
//                        null,    // 负责人
//                        null,    // 图片
//                        null,    // 简要描述
//                        null,    // 数量
//                        3,    // 等级
//                        null,    // 排序
//                        1,    // 状态
//                        now,    // 添加时间
//                        null,    // 添加人员
//                        now,    // 修改时间
//                        null,    // 修改人员
//                        null    // 备注
//                );
//                if (tagMapper.insert(secTag) == 0) {
//                    throw new CoolException("保存二级分类失败");
//                }
//            }
            tagId = priTag.getId();
        }
        else {
            tagId = tagService.getTop().getId();
        }
        // 商品
@@ -131,6 +133,7 @@
        if (mat == null) {
            mat = excel;
            mat.setTagId(tagId);
            mat.setLocType(tagId);
            if (!matService.insert(mat)) {
                throw new CoolException("保存商品信息失败,商品编码:" + excel.getMatnr());
            }