fix:时间更新

This commit is contained in:
violet 2024-09-11 21:57:13 +08:00
parent a1992cf25a
commit 317ac7fd93

View File

@ -51,32 +51,40 @@ public class MatchingPLMChangeUpdateTaskEdit extends AbstractTask {
String plm_parent = plm.getString("yem_textfield");//总成编码 String plm_parent = plm.getString("yem_textfield");//总成编码
String bom_enablesta = bom.getString("yem_enablesta");//启用停用状态 String bom_enablesta = bom.getString("yem_enablesta");//启用停用状态
Date bom_completetime = bom.getDate("yem_completetime"); Date bom_completetime = bom.getDate("yem_completetime");
String exestate = bom.getString("yem_exestate");
Date invoktime = plm.getDate("yem_invoktime");//执行时间
Boolean plmMatchBom = isPlmMatchBom(plmObj, bom, plm); Boolean plmMatchBom = isPlmMatchBom(plmObj, bom, plm);
exestate = "30".equals(exestate) ? "B" : "A";
if (plmMatchBom != null && !plmMatchBom) { if (plmMatchBom != null && !plmMatchBom) {
Date stoptime = plm.getDate("yem_stoptime"); // Date stoptime = plm.getDate("yem_stoptime");
if (YEM.isEmpty(stoptime)) {
Date downdate = bom.getDate("yem_downdate"); Date downdate = bom.getDate("yem_downdate");
if (YEM.isNotEmpty(downdate)) {
plm.set("yem_enablestatus_before", bom_enablesta); plm.set("yem_enablestatus_before", bom_enablesta);
plm.set("yem_stoptime", downdate); plm.set("yem_stoptime", downdate);
plm.set("yem_invoktime", bom_completetime); // plm.set("yem_invoktime", bom_completetime);
plm.set("yem_invokstatus", "B"); // plm.set("yem_invokstatus", exestate);
} else { } else {
logger.info("停用_已有时间,不更新,{}{}", plm_billno, plm_parent); logger.info("停用_时间,不更新,{}{}", plm_billno, plm_parent);
} }
} }
if (plmMatchBom != null && plmMatchBom) { if (plmMatchBom != null && plmMatchBom) {
Date starttime = plm.getDate("yem_starttime"); // Date starttime = plm.getDate("yem_starttime");
if (YEM.isEmpty(starttime)) {
Date enableddate = bom.getDate("yem_enableddate"); Date enableddate = bom.getDate("yem_enableddate");
if (YEM.isNotEmpty(enableddate)) {
plm.set("yem_enablesta", bom_enablesta); plm.set("yem_enablesta", bom_enablesta);
plm.set("yem_starttime", enableddate); plm.set("yem_starttime", enableddate);
plm.set("yem_invoktime", bom_completetime); // plm.set("yem_invoktime", bom_completetime);
plm.set("yem_invokstatus", "B"); // plm.set("yem_invokstatus", exestate);
} else { } else {
logger.info("启用_已有时间,不更新,{}{}", plm_billno, plm_parent); logger.info("启用_时间,不更新,{}{}", plm_billno, plm_parent);
} }
} }
if (YEM.isEmpty(invoktime)) {
plm.set("yem_invoktime", bom_completetime);
plm.set("yem_invokstatus", exestate);
}
} }
} }
} }