@@ -1,6 +1,7 @@ | |||||
package com.hz.pm.api.common.statemachine.action; | package com.hz.pm.api.common.statemachine.action; | ||||
import cn.hutool.core.lang.Assert; | import cn.hutool.core.lang.Assert; | ||||
import com.hz.pm.api.common.statemachine.builder.impl.AdaptStateMachineBuilderImpl; | |||||
import com.hz.pm.api.common.statemachine.builder.impl.TestValidStateMachineBuilderImpl; | import com.hz.pm.api.common.statemachine.builder.impl.TestValidStateMachineBuilderImpl; | ||||
import com.hz.pm.api.common.statemachine.event.AdaptStateChangeEvent; | import com.hz.pm.api.common.statemachine.event.AdaptStateChangeEvent; | ||||
import com.hz.pm.api.common.statemachine.util.TenderStateMachineUtil; | import com.hz.pm.api.common.statemachine.util.TenderStateMachineUtil; | ||||
@@ -20,7 +21,7 @@ import org.springframework.statemachine.annotation.WithStateMachine; | |||||
* @since 17:08 2024/2/24 | * @since 17:08 2024/2/24 | ||||
*/ | */ | ||||
@Slf4j | @Slf4j | ||||
@WithStateMachine(id = TestValidStateMachineBuilderImpl.MACHINE_ID) | |||||
@WithStateMachine(id = AdaptStateMachineBuilderImpl.MACHINE_ID) | |||||
public class AdaptAction { | public class AdaptAction { | ||||
private Purchase getPurchaseInfo(Message<AdaptStateChangeEvent> message) { | private Purchase getPurchaseInfo(Message<AdaptStateChangeEvent> message) { | ||||
@@ -1,6 +1,7 @@ | |||||
package com.hz.pm.api.common.statemachine.action; | package com.hz.pm.api.common.statemachine.action; | ||||
import cn.hutool.core.lang.Assert; | import cn.hutool.core.lang.Assert; | ||||
import com.hz.pm.api.common.statemachine.builder.impl.SelfTestStateMachineBuilderImpl; | |||||
import com.hz.pm.api.common.statemachine.builder.impl.TestValidStateMachineBuilderImpl; | import com.hz.pm.api.common.statemachine.builder.impl.TestValidStateMachineBuilderImpl; | ||||
import com.hz.pm.api.common.statemachine.event.SelfTestStateChangeEvent; | import com.hz.pm.api.common.statemachine.event.SelfTestStateChangeEvent; | ||||
import com.hz.pm.api.common.statemachine.util.TenderStateMachineUtil; | import com.hz.pm.api.common.statemachine.util.TenderStateMachineUtil; | ||||
@@ -20,7 +21,7 @@ import org.springframework.statemachine.annotation.WithStateMachine; | |||||
* @since 17:08 2024/2/24 | * @since 17:08 2024/2/24 | ||||
*/ | */ | ||||
@Slf4j | @Slf4j | ||||
@WithStateMachine(id = TestValidStateMachineBuilderImpl.MACHINE_ID) | |||||
@WithStateMachine(id = SelfTestStateMachineBuilderImpl.MACHINE_ID) | |||||
public class SelfTestAction { | public class SelfTestAction { | ||||
private Purchase getPurchaseInfo(Message<SelfTestStateChangeEvent> message) { | private Purchase getPurchaseInfo(Message<SelfTestStateChangeEvent> message) { | ||||
@@ -66,7 +66,7 @@ public class SelfTestStateMachineUtil { | |||||
} | } | ||||
public void execute(Purchase purchase, SelfTestStateChangeEvent event) throws Exception { | public void execute(Purchase purchase, SelfTestStateChangeEvent event) throws Exception { | ||||
log.info("调用状态机前的标段状态为:{}", purchase.getStatus()); | |||||
log.info("调用状态机前的标段状态为:{}", purchase.getSelfTestStatus()); | |||||
// 获取TO状态机 | // 获取TO状态机 | ||||
StateMachine<TenderSelfTestStatusEnum, SelfTestStateChangeEvent> stateMachine = selfTestStateMachineBuilder.build(); | StateMachine<TenderSelfTestStatusEnum, SelfTestStateChangeEvent> stateMachine = selfTestStateMachineBuilder.build(); | ||||
Message<SelfTestStateChangeEvent> message = MessageBuilder.withPayload(event) | Message<SelfTestStateChangeEvent> message = MessageBuilder.withPayload(event) | ||||
@@ -159,7 +159,7 @@ public class DeclaredRecordManage { | |||||
queryState = false; | queryState = false; | ||||
break; | break; | ||||
} | } | ||||
if (queryState) { | |||||
if (queryState && !viewUnitIds.isEmpty()) { | |||||
query.in(MhProject::getUnitId, viewUnitIds); | query.in(MhProject::getUnitId, viewUnitIds); | ||||
} | } | ||||
} | } | ||||