自动化立体仓库 - WMS系统
lty
昨天 d44606236559adf331ee38846ef6acb1b25e5eef
src/main/java/com/zy/third/erp/task/ERPItemService.java
@@ -86,6 +86,10 @@
                mat.setTagId(priTag.getId());
            }
            mat.setStatus(1);
            if(itemTB.getTemp2() != null){
                mat.setLength(Double.parseDouble(itemTB.getTemp2()));
            }
//            mat.setLength(Double.parseDouble(itemTB.getTemp2()));
            mat.setCreateTime(now);
            mat.setUpdateTime(now);
            if (!matService.insert(mat)) {
@@ -94,7 +98,47 @@
                log.info("同步新物料[商品编号:{}]", mat.getMatnr());
            }
        } else {
            Tag priTag = null;
            if (!Cools.isEmpty(itemTB.getItemKind())) {
                priTag = tagService.selectByName(itemTB.getItemKind(), 2);
                if (priTag == null) {
                    Tag top = tagService.getTop();
                    NodeUtils nodeUtils = new NodeUtils();
                    nodeUtils.executePath(top.getId());
                    priTag = new Tag(
                            null,    // 编号
                            itemTB.getItemKind(),    // 名称
                            top.getId(),    // 父级
                            top.getName(),    // 父级名称
                            nodeUtils.path.toString(),    // 关联路径
                            nodeUtils.pathName.toString(),    // 关联路径名
                            0,    // 类型
                            null,    // 负责人
                            null,    // 图片
                            null,    // 简要描述
                            null,    // 数量
                            2,    // 等级
                            null,    // 排序
                            1,    // 状态
                            now,    // 添加时间
                            null,    // 添加人员
                            now,    // 修改时间
                            null,    // 修改人员
                            null    // 备注
                    );
                    if (tagMapper.insert(priTag) == 0) {
                        throw new CoolException("服务器内部错误,请联系管理员");
                    }
                }
            }
            if (!Cools.isEmpty(itemTB.getItemKind())) {
                priTag = tagService.selectByName(itemTB.getItemKind(), 2);
            }
            mat = sync(mat, itemTB);
            if (priTag!=null){
                mat.setTagId(priTag.getId());
            }
            if (!matService.update(mat, new EntityWrapper<Mat>().eq("matnr", itemTB.getItemId()))) {
                throw new CoolException("更新已存在商品信息失败,请联系管理员");
            }
@@ -102,6 +146,7 @@
    }
    private Mat sync(Mat mat, ItemTB itemTB) {
        mat.setModel(itemTB.getItemCode());
        mat.setThreeCode(itemTB.getItemCode());
        mat.setMatnr(itemTB.getItemId());
        mat.setMaktx(itemTB.getItemName());