Browse Source

适配改造、系统自测状态机修改

tags/24080901
WendyYang 5 months ago
parent
commit
74ae7c5b3b
4 changed files with 6 additions and 4 deletions
  1. +2
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/AdaptAction.java
  2. +2
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/SelfTestAction.java
  3. +1
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/util/SelfTestStateMachineUtil.java
  4. +1
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/DeclaredRecordManage.java

+ 2
- 1
hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/AdaptAction.java View File

@@ -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) {


+ 2
- 1
hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/SelfTestAction.java View File

@@ -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) {


+ 1
- 1
hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/util/SelfTestStateMachineUtil.java View File

@@ -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)


+ 1
- 1
hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/DeclaredRecordManage.java View File

@@ -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);
} }
} }


Loading…
Cancel
Save