From d44606236559adf331ee38846ef6acb1b25e5eef Mon Sep 17 00:00:00 2001
From: lty <876263681@qq.com>
Date: 星期一, 29 十二月 2025 12:18:50 +0800
Subject: [PATCH] #新增erp中间表
---
src/main/java/com/zy/third/erp/task/ERPItemService.java | 40 ++++++++++++++++++++++++++++++++++++++++
1 files changed, 40 insertions(+), 0 deletions(-)
diff --git a/src/main/java/com/zy/third/erp/task/ERPItemService.java b/src/main/java/com/zy/third/erp/task/ERPItemService.java
index a6c865f..cfdb92b 100644
--- a/src/main/java/com/zy/third/erp/task/ERPItemService.java
+++ b/src/main/java/com/zy/third/erp/task/ERPItemService.java
@@ -98,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("鏇存柊宸插瓨鍦ㄥ晢鍝佷俊鎭け璐ワ紝璇疯仈绯荤鐞嗗憳");
}
--
Gitblit v1.9.1