From 1e074f37aed5ea58430444b953d5340143434949 Mon Sep 17 00:00:00 2001 From: "zzs01@yunemao.com" Date: Mon, 2 Sep 2024 09:33:19 +0800 Subject: [PATCH] =?UTF-8?q?wip:PLM=E5=8C=B9=E9=85=8D=EF=BC=8C=E7=94=9F?= =?UTF-8?q?=E6=88=90=E6=9B=BF=E6=8D=A2=E5=85=B3=E7=B3=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../em/task/GenerateReplaceRelationshipTaskEdit.java | 3 +++ .../yem/em/task/MatchingPLMChangeUpdateTaskEdit.java | 11 +++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/yem/em/task/GenerateReplaceRelationshipTaskEdit.java b/src/main/java/com/yem/em/task/GenerateReplaceRelationshipTaskEdit.java index d44e4f19..ea51e5c9 100644 --- a/src/main/java/com/yem/em/task/GenerateReplaceRelationshipTaskEdit.java +++ b/src/main/java/com/yem/em/task/GenerateReplaceRelationshipTaskEdit.java @@ -8,6 +8,7 @@ import kd.bos.exception.KDException; import kd.bos.schedule.executor.AbstractTask; import kd.bos.servicehelper.BusinessDataServiceHelper; +import java.util.Date; import java.util.Map; import static com.yem.em.task.MatchingPLMChangeUpdateTaskEdit.queryPLMChange; @@ -32,7 +33,9 @@ public class GenerateReplaceRelationshipTaskEdit extends AbstractTask { DynamicObjectCollection collection = plmObj.getDynamicObjectCollection("yem_change_detail"); DynamicObjectCollection enabled = new DynamicObjectCollection(); for (DynamicObject plm : collection) { + Date starttime = plm.getDate("yem_starttime"); // if (替换件启用停用状态 = "启用") {} + enabled.add(plm); } DynamicObject bomChange = createBOMChange(plmObj, enabled); diff --git a/src/main/java/com/yem/em/task/MatchingPLMChangeUpdateTaskEdit.java b/src/main/java/com/yem/em/task/MatchingPLMChangeUpdateTaskEdit.java index 39e4b8a6..9f2f588f 100644 --- a/src/main/java/com/yem/em/task/MatchingPLMChangeUpdateTaskEdit.java +++ b/src/main/java/com/yem/em/task/MatchingPLMChangeUpdateTaskEdit.java @@ -12,6 +12,7 @@ import kd.bos.servicehelper.BusinessDataServiceHelper; import kd.bos.servicehelper.operation.SaveServiceHelper; import java.math.BigDecimal; +import java.util.Date; import java.util.Map; /** @@ -54,10 +55,16 @@ public class MatchingPLMChangeUpdateTaskEdit extends AbstractTask { if (eq(plm_billno, bom_billno) && eq(plm_parent, bom_parent) && eq(plm_child, bom_child) && eq(plm_qty, bom_qty)) { String enablesta = bom.getString("yem_enablesta");//启用停用状态 if ("A".equals(enablesta)) {//启用 - + Date starttime = plm.getDate("yem_starttime"); + if (starttime == null) { + plm.set("yem_starttime", new Date()); + } } if ("B".equals(enablesta)) {//停用 - + Date stoptime = plm.getDate("yem_stoptime"); + if (stoptime == null) { + plm.set("yem_stoptime", new Date()); + } } }