{"id":54832,"date":"2025-08-13T11:50:04","date_gmt":"2025-08-13T03:50:04","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/54832.html"},"modified":"2025-08-13T11:50:04","modified_gmt":"2025-08-13T03:50:04","slug":"%e8%ae%be%e8%ae%a1%e6%a8%a1%e5%bc%8f%e4%b9%8b%e7%8a%b6%e6%80%81%e6%9c%ba","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/54832.html","title":{"rendered":"\u8bbe\u8ba1\u6a21\u5f0f\u4e4b\u72b6\u6001\u673a"},"content":{"rendered":"<\/p>\n<h2>Builder<\/h2>\n<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"682\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813035000-689c0b68d4394.png\" width=\"926\" \/><\/p>\n<h3>\u5982\u4f55\u4f7f\u7528<\/h3>\n<p>import com.google.common.base.Preconditions;<br \/>\nimport org.apache.commons.lang.StringUtils;<\/p>\n<p>public class User {<br \/>\n    private String name; \/\/ \u5fc5\u586b\u5b57\u6bb5<br \/>\n    private String telephone; \/\/ \u5fc5\u586b\u5b57\u6bb5<br \/>\n    private String sex; \/\/ \u5fc5\u586b\u5b57\u6bb5<br \/>\n    private int age; \/\/ \u53ef\u9009\u5b57\u6bb5<br \/>\n    private String address; \/\/ \u53ef\u9009\u5b57\u6bb5<\/p>\n<p>    private User(UserBuilder builder) {<br \/>\n        this.name &#061; builder.name;<br \/>\n        this.telephone &#061; builder.telephone;<br \/>\n        this.sex &#061; builder.sex;<br \/>\n        this.age &#061; builder.age;<br \/>\n        this.address &#061; builder.address;<br \/>\n    }<\/p>\n<p>    &#064;Override<br \/>\n    public String toString() {<br \/>\n      return &#034;{\\\\&#034;name\\\\&#034;:&#034; &#043; name &#043; &#034;,\\\\&#034;telephone\\\\&#034;:\\\\&#034;&#034; &#043; telephone<br \/>\n                &#043; &#034;\\\\&#034;,\\\\&#034;sex\\\\&#034;:\\\\&#034;&#034; &#043; sex &#043; &#034;\\\\&#034;,\\\\&#034;age\\\\&#034;:\\\\&#034;&#034;<br \/>\n                &#043; age &#043; &#034;\\\\&#034;,\\\\&#034;address\\\\&#034;:&#034; &#043; address &#043; &#034;}&#034;;<br \/>\n    }<\/p>\n<p>    public static class UserBuilder {<br \/>\n        private String name;<br \/>\n        private String telephone;<br \/>\n        private String sex;<br \/>\n        private int age;<br \/>\n        private String address;<\/p>\n<p>        public UserBuilder setName(String name) {<br \/>\n            this.name &#061; name;<br \/>\n            return this;<br \/>\n        }<\/p>\n<p>        public UserBuilder setTelephone(String telephone) {<br \/>\n            this.telephone &#061; telephone;<br \/>\n            return this;<br \/>\n        }<\/p>\n<p>        public UserBuilder setSex(String sex) {<br \/>\n            this.sex &#061; sex;<br \/>\n            return this;<br \/>\n        }<\/p>\n<p>        public UserBuilder setAge(int age) {<br \/>\n            this.age &#061; age;<br \/>\n            return this;<br \/>\n        }<\/p>\n<p>        public UserBuilder setAddress(String address) {<br \/>\n            this.address &#061; address;<br \/>\n            return this;<br \/>\n        }<\/p>\n<p>        public User build() {<br \/>\n            \/\/ \u5fc5\u586b\u5b57\u6bb5\u6821\u9a8c<br \/>\n            Preconditions.checkArgument(StringUtils.isNotBlank(name), &#034;name can not be empty&#034;);<br \/>\n            Preconditions.checkArgument(StringUtils.isNotBlank(telephone), &#034;name can not be empty&#034;);<br \/>\n            Preconditions.checkArgument(StringUtils.isNotBlank(telephone), &#034;name can not be empty&#034;);<br \/>\n            \/\/ \u4f20\u5165builder\u5bf9\u8c61\u4ee5\u6784\u5efauser\u5bf9\u8c61<br \/>\n            User user &#061; new User(this);<br \/>\n            System.out.println(&#034;\u901a\u8fc7Builder\u6a21\u5f0f\u6210\u529f\u6784\u5efaUser\u5bf9\u8c61&#034;);<br \/>\n            return user;<br \/>\n        }<br \/>\n    }<br \/>\n}<\/p>\n<p>public static void main(String[] args) {<br \/>\n    User user &#061; new User.UserBuilder()<br \/>\n            .setName(&#034;\u5f20\u4e09&#034;)<br \/>\n            .setTelephone(&#034;18812546788&#034;)<br \/>\n            .setSex(&#034;\u7537&#034;)<br \/>\n            .setAge(31)<br \/>\n            .build();<br \/>\n    System.out.println(&#034;\u901a\u8fc7Builder\u6a21\u5f0f\u6784\u5efa\u7684User\u5bf9\u8c61: &#034; &#043; user);<br \/>\n}<\/p>\n<h2>\u72b6\u6001\u673a<\/h2>\n<p>\u4ec0\u4e48\u662f\u72b6\u6001\u673a&#xff1f;<\/p>\n<p>\u72b6\u6001\u673a&#xff08;State Machine&#xff09;\u662f\u4e00\u79cd\u6570\u5b66\u6a21\u578b&#xff0c;\u7528\u4e8e\u63cf\u8ff0\u7cfb\u7edf\u5728\u4e0d\u540c\u72b6\u6001\u95f4\u7684\u8f6c\u6362\u3002\u5b83\u7531\u4ee5\u4e0b\u90e8\u5206\u7ec4\u6210&#xff1a;<\/p>\n<\/p>\n<p>\u72b6\u6001&#xff08;State&#xff09;&#xff1a;\u7cfb\u7edf\u53ef\u80fd\u5904\u4e8e\u7684\u5404\u4e2a\u72b6\u6001\u3002<\/p>\n<p>\u4e8b\u4ef6&#xff08;Event&#xff09;&#xff1a;\u89e6\u53d1\u72b6\u6001\u8f6c\u6362\u7684\u52a8\u4f5c\u6216\u6761\u4ef6\u3002<\/p>\n<p>\u8f6c\u6362&#xff08;Transition&#xff09;&#xff1a;\u4e8b\u4ef6\u89e6\u53d1\u540e&#xff0c;\u7cfb\u7edf\u4ece\u4e00\u4e2a\u72b6\u6001\u8f6c\u79fb\u5230\u53e6\u4e00\u4e2a\u72b6\u6001\u7684\u8fc7\u7a0b\u3002<\/p>\n<p>\u52a8\u4f5c&#xff08;Action&#xff09;&#xff1a;\u72b6\u6001\u8f6c\u6362\u65f6\u6267\u884c\u7684\u64cd\u4f5c\u3002<\/p>\n<p>\u72b6\u6001\u673a\u5206\u4e3a\u6709\u9650\u72b6\u6001\u673a&#xff08;FSM&#xff09;\u548c\u65e0\u9650\u72b6\u6001\u673a&#xff0c;Spring Boot \u4e2d\u5e38\u7528\u7684\u662f\u6709\u9650\u72b6\u6001\u673a\u3002<\/p>\n<\/p>\n<p>\u72b6\u6001\u673a\u5728\u8ba2\u5355\u7ba1\u7406\u4e2d\u7684\u5e94\u7528<\/p>\n<p>\u5728\u5546\u57ce\u7cfb\u7edf\u4e2d&#xff0c;\u8ba2\u5355\u72b6\u6001\u901a\u5e38\u5305\u62ec&#xff1a;\u5f85\u652f\u4ed8\u3001\u5df2\u652f\u4ed8\u3001\u5df2\u53d1\u8d27\u3001\u5df2\u6536\u8d27\u3001\u5df2\u5b8c\u6210\u3001\u5df2\u53d6\u6d88\u7b49\u3002\u72b6\u6001\u673a\u53ef\u4ee5\u6e05\u6670\u5730\u7ba1\u7406\u8fd9\u4e9b\u72b6\u6001\u53ca\u5176\u8f6c\u6362\u3002<\/p>\n<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"330\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813035002-689c0b6a3a410.png\" width=\"727\" \/><\/p>\n<h3>\u72b6\u6001\u673a\u57fa\u672c\u7ed3\u6784\u4e0e\u4f7f\u7528<\/h3>\n<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"395\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813035002-689c0b6a9a4ab.png\" width=\"667\" \/><\/p>\n<p>StateMachine\u548cState\u5173\u7cfb\u662f\u53cc\u5411\u7684&#xff0c;\u8fd9\u662f\u56e0\u4e3a\u72b6\u6001\u673a\u9700\u8981\u6301\u6709\u72b6\u6001\u5bf9\u8c61\u6765\u8868\u793a\u5f53\u524d\u72b6\u6001&#xff0c;\u4ee5\u53ca\u901a\u8fc7\u5f53\u524d\u7684\u72b6\u6001\u5bf9\u8c61\u4e2d\u7684\u65b9\u6cd5\u8fdb\u884c\u72b6\u6001\u7684\u6d41\u8f6c&#xff0c;\u800c\u6d41\u8f6c\u7684\u7ed3\u679c\u9700\u8981\u91cd\u65b0set\u5230\u72b6\u6001\u673a\u4e2d&#xff0c;\u53c8\u8981\u6c42State\u5fc5\u987b\u6301\u6709\u72b6\u6001\u673a\u5bf9\u8c61\u3002<\/p>\n<p>\u5f53\u7136&#xff0c;\u8fd9\u91ccState\u5bf9StateMachine\u7684\u5173\u7cfb\u4e5f\u53ef\u4ee5\u901a\u8fc7\u4f9d\u8d56\u6765\u8868\u793a\u3002<\/p>\n<h4>\u5b9a\u4e49\u72b6\u6001\u673a\u72b6\u6001\u679a\u4e3e<\/h4>\n<p>import lombok.Getter;<\/p>\n<p>&#064;Getter<br \/>\npublic enum OrderStateEnum {<br \/>\n    WAIT_PAYMENT(1, &#034;\u5f85\u652f\u4ed8&#034;),<br \/>\n    WAIT_DELIVER(2, &#034;\u5f85\u53d1\u8d27&#034;),<br \/>\n    WAIT_RECEIVE(3, &#034;\u5f85\u6536\u8d27&#034;),<br \/>\n    RECEIVED(4, &#034;\u5df2\u6536\u8d27&#034;),<br \/>\n    CANCEL(5, &#034;\u5df2\u53d6\u6d88&#034;);<\/p>\n<p>    private final int state;<br \/>\n    private final String desc;<\/p>\n<p>    OrderStateEnum(int state, String desc) {<br \/>\n        this.state &#061; state;<br \/>\n        this.desc &#061; desc;<br \/>\n    }<\/p>\n<p>    public int getState() {<br \/>\n        return state;<br \/>\n    }<\/p>\n<p>    public String getDesc() {<br \/>\n        return desc;<br \/>\n    }<br \/>\n}<\/p>\n<h4>\u4e8b\u4ef6\u63a5\u53e3\u5b9a\u4e49<\/h4>\n<p>public interface OrderState {<\/p>\n<p>    OrderStateEnum orderStateType();<\/p>\n<p>    default void pay(OrderStateMachine stateMachine) {<br \/>\n        System.out.println(&#034;|&#8211;\u5f53\u524d\u8ba2\u5355\u72b6\u6001\u4e0d\u652f\u6301\u652f\u4ed8&#xff0c;\u5df2\u5ffd\u7565&#034;);<br \/>\n    }<br \/>\n    default void cancel(OrderStateMachine stateMachine) {<br \/>\n        System.out.println(&#034;|&#8211;\u5f53\u524d\u8ba2\u5355\u72b6\u6001\u4e0d\u652f\u6301\u53d6\u6d88&#xff0c;\u5df2\u5ffd\u7565&#034;);<br \/>\n    }<br \/>\n    default void deliver(OrderStateMachine stateMachine) {<br \/>\n        System.out.println(&#034;|&#8211;\u5f53\u524d\u8ba2\u5355\u72b6\u6001\u4e0d\u652f\u6301\u53d1\u8d27&#xff0c;\u5df2\u5ffd\u7565&#034;);<br \/>\n    }<br \/>\n    default void receive(OrderStateMachine stateMachine) {<br \/>\n        System.out.println(&#034;|&#8211;\u5f53\u524d\u8ba2\u5355\u72b6\u6001\u4e0d\u652f\u6301\u6536\u8d27&#xff0c;\u5df2\u5ffd\u7565&#034;);<br \/>\n    }<br \/>\n}<\/p>\n<p>default\u7684\u4f5c\u7528\u662f\u4e0d\u9700\u8981\u7c7b\u518d\u91cd\u5199\u8fd9\u4e2a\u65b9\u6cd5&#xff0c;\u63a5\u53e3\u53ef\u4ee5\u5b9e\u73b0\u4e0d\u80fd\u8df3\u8f6c\u72b6\u6001\u7684\u903b\u8f91<\/p>\n<p>\u5982\u679c\u5f53\u524d\u72b6\u6001\u80fd\u89e6\u53d1\u5bf9\u5e94\u4e8b\u4ef6\u5219\u91cd\u5199\u5bf9\u5e94\u65b9\u6cd5\u5e76\u6dfb\u52a0\u76f8\u5173\u6267\u884c\u903b\u8f91<\/p>\n<p>\u4f8b\u5982&#xff1a;\u5f85\u652f\u4ed8\u72b6\u6001\u53ef\u4ee5\u6709\u4e24\u4e2a\u4e8b\u4ef6&#xff1a;\u652f\u4ed8\u6216\u8005\u53d6\u6d88<\/p>\n<p>public class WaitPaymentState implements OrderState {<\/p>\n<p>    &#064;Override<br \/>\n    public OrderStateEnum orderStateType() {<br \/>\n        return OrderStateEnum.WAIT_PAYMENT;<br \/>\n    }<\/p>\n<p>    &#064;Override<br \/>\n    public void pay(OrderStateMachine stateMachine) {<br \/>\n        stateMachine.setCurrentState(new WaitDeliverState());<br \/>\n    }<\/p>\n<p>    &#064;Override<br \/>\n    public void cancel(OrderStateMachine stateMachine) {<br \/>\n        stateMachine.setCurrentState(new CancelState());<br \/>\n    }<br \/>\n}<\/p>\n<h4>\u72b6\u6001\u673a\u5b9a\u4e49<\/h4>\n<p>\u7f13\u5b58\u6240\u6709\u7684\u72b6\u6001\u6620\u5c04&#xff0c;\u7531\u5f53\u524d\u72b6\u6001\u5bf9\u8c61\u6765\u89e6\u53d1\u76f8\u5173\u4e8b\u4ef6<\/p>\n<p>public class OrderStateMachine {<\/p>\n<p>    public static final Map&lt;OrderStateEnum, OrderState&gt; ORDER_STATE_MAP &#061; new HashMap&lt;&gt;();<\/p>\n<p>    static {<br \/>\n        ORDER_STATE_MAP.put(OrderStateEnum.WAIT_PAYMENT, new WaitPaymentState());<br \/>\n        ORDER_STATE_MAP.put(OrderStateEnum.WAIT_DELIVER, new WaitDeliverState());<br \/>\n        ORDER_STATE_MAP.put(OrderStateEnum.WAIT_RECEIVE, new WaitReceiveState());<br \/>\n        ORDER_STATE_MAP.put(OrderStateEnum.RECEIVED, new ReceivedState());<br \/>\n        ORDER_STATE_MAP.put(OrderStateEnum.CANCEL, new CancelState());<br \/>\n    }<\/p>\n<p>    private OrderState currentState;<\/p>\n<p>    public OrderStateMachine(OrderStateEnum orderStateEnum) {<br \/>\n        this.currentState &#061; ORDER_STATE_MAP.get(orderStateEnum);<br \/>\n    }<\/p>\n<p>    public OrderState getCurrentState() {<br \/>\n        return currentState;<br \/>\n    }<\/p>\n<p>    public void setCurrentState(OrderState currentState) {<br \/>\n        this.currentState &#061; currentState;<br \/>\n    }<\/p>\n<p>    void pay() {<br \/>\n        currentState.pay(this);<br \/>\n    }<\/p>\n<p>    void deliver() {<br \/>\n        currentState.deliver(this);<br \/>\n    }<\/p>\n<p>    void receive() {<br \/>\n        currentState.receive(this);<br \/>\n    }<\/p>\n<p>    void cancel() {<br \/>\n        currentState.cancel(this);<br \/>\n    }<\/p>\n<p>}<\/p>\n<h4>\u6d4b\u8bd5<\/h4>\n<p>public class OrderService {<\/p>\n<p>    public static void main(String[] args) {<br \/>\n        OrderStateMachine stateMachine &#061; new OrderStateMachine(OrderStateEnum.WAIT_DELIVER);<\/p>\n<p>        invoke(stateMachine::pay, &#034;\u7528\u6237\u652f\u4ed8&#034;, stateMachine);<br \/>\n        invoke(stateMachine::deliver, &#034;\u5546\u5bb6\u53d1\u8d27&#034;, stateMachine);<br \/>\n        invoke(stateMachine::receive, &#034;\u7528\u6237\u6536\u8d27&#034;, stateMachine);<br \/>\n        invoke(stateMachine::cancel, &#034;\u53d6\u6d88\u652f\u4ed8&#034;, stateMachine);<br \/>\n    }<\/p>\n<p>    public static void invoke(Runnable runnable, String desc, OrderStateMachine stateMachine) {<br \/>\n        System.out.println(desc &#043; &#034;\u524d\u8ba2\u5355\u72b6\u6001: &#034; &#043; stateMachine.getCurrentState().orderStateType().getDesc());<br \/>\n        runnable.run();<br \/>\n        System.out.println(desc &#043; &#034;\u540e\u8ba2\u5355\u72b6\u6001: &#034; &#043; stateMachine.getCurrentState().orderStateType().getDesc());<br \/>\n        System.out.println(&#034;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#034;);<br \/>\n    }<br \/>\n}<\/p>\n<h3>springboot\u4f7f\u7528\u72b6\u6001\u673a<\/h3>\n<h4>\u5b9a\u4e49\u72b6\u6001\u548c\u4e8b\u4ef6<\/h4>\n<p>public enum OrderStates {<br \/>\n    PENDING_PAYMENT, PAID, SHIPPED, RECEIVED, COMPLETED, CANCELLED<br \/>\n}<\/p>\n<p>public enum OrderEvents {<br \/>\n    PAY, SHIP, RECEIVE, COMPLETE, CANCEL<br \/>\n}<\/p>\n<h4>\u914d\u7f6e\u72b6\u6001\u673a-\u72b6\u6001\u4ee5\u53ca\u89e6\u53d1\u4e8b\u4ef6\u4e4b\u95f4\u7684\u5173\u7cfb<\/h4>\n<p>&#064;Configuration<br \/>\n&#064;EnableStateMachine<br \/>\npublic class StateMachineConfig extends EnumStateMachineConfigurerAdapter&lt;OrderStates, OrderEvents&gt; {<\/p>\n<p>    &#064;Override<br \/>\n    public void configure(StateMachineStateConfigurer&lt;OrderStates, OrderEvents&gt; states) throws Exception {<br \/>\n        states<br \/>\n            .withStates()<br \/>\n            .initial(OrderStates.PENDING_PAYMENT)<br \/>\n            .states(EnumSet.allOf(OrderStates.class));<br \/>\n    }<\/p>\n<p>    &#064;Override<br \/>\n    public void configure(StateMachineTransitionConfigurer&lt;OrderStates, OrderEvents&gt; transitions) throws Exception {<br \/>\n        transitions<br \/>\n            .withExternal()<br \/>\n                .source(OrderStates.PENDING_PAYMENT).target(OrderStates.PAID).event(OrderEvents.PAY)<br \/>\n            .and()<br \/>\n            .withExternal()<br \/>\n                .source(OrderStates.PAID).target(OrderStates.SHIPPED).event(OrderEvents.SHIP)<br \/>\n            .and()<br \/>\n            .withExternal()<br \/>\n                .source(OrderStates.SHIPPED).target(OrderStates.RECEIVED).event(OrderEvents.RECEIVE)<br \/>\n            .and()<br \/>\n            .withExternal()<br \/>\n                .source(OrderStates.RECEIVED).target(OrderStates.COMPLETED).event(OrderEvents.COMPLETE)<br \/>\n            .and()<br \/>\n            .withExternal()<br \/>\n                .source(OrderStates.PENDING_PAYMENT).target(OrderStates.CANCELLED).event(OrderEvents.CANCEL)<br \/>\n            .and()<br \/>\n            .withExternal()<br \/>\n                .source(OrderStates.PAID).target(OrderStates.CANCELLED).event(OrderEvents.CANCEL);<br \/>\n    }<br \/>\n}<\/p>\n<h4>\u4f7f\u7528\u72b6\u6001\u673a<\/h4>\n<p>&#064;Service<br \/>\npublic class OrderService {<\/p>\n<p>    &#064;Autowired<br \/>\n    private StateMachine&lt;OrderStates, OrderEvents&gt; stateMachine;<\/p>\n<p>    public void payOrder() {<br \/>\n        stateMachine.sendEvent(OrderEvents.PAY);<br \/>\n    }<\/p>\n<p>    public void shipOrder() {<br \/>\n        stateMachine.sendEvent(OrderEvents.SHIP);<br \/>\n    }<\/p>\n<p>    public void receiveOrder() {<br \/>\n        stateMachine.sendEvent(OrderEvents.RECEIVE);<br \/>\n    }<\/p>\n<p>    public void completeOrder() {<br \/>\n        stateMachine.sendEvent(OrderEvents.COMPLETE);<br \/>\n    }<\/p>\n<p>    public void cancelOrder() {<br \/>\n        stateMachine.sendEvent(OrderEvents.CANCEL);<br \/>\n    }<br \/>\n}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb376\u6b21\uff0c\u70b9\u8d5e3\u6b21\uff0c\u6536\u85cf8\u6b21\u3002GetterWAIT_PAYMENT(1, &quot;\u5f85\u652f\u4ed8&quot;),WAIT_DELIVER(2, &quot;\u5f85\u53d1\u8d27&quot;),WAIT_RECEIVE(3, &quot;\u5f85\u6536\u8d27&quot;),RECEIVED(4, &quot;\u5df2\u6536\u8d27&quot;),CANCEL(5, &quot;\u5df2\u53d6\u6d88&quot;);System.out.println(&quot;|&#8211;\u5f53\u524d\u8ba2\u5355\u72b6\u6001\u4e0d\u652f\u6301\u652f\u4ed8\uff0c\u5df2\u5ffd\u7565&quot;);System.out.println(&quot;|&#8211;\u5f53\u524d\u8ba2\u5355\u72b6\u6001\u4e0d\u652f\u6301\u53d6\u6d88\uff0c\u5df2\u5ffd\u7565&quot;);System.out.println(&quot;|&#8211;\u5f53\u524d\u8ba2\u5355\u72b6\u6001\u4e0d\u652f\u6301\u53d1\u8d27\uff0c\u5df2\u5ffd\u7565&quot;);<\/p>\n","protected":false},"author":2,"featured_media":54829,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[99,427,2874],"topic":[],"class_list":["post-54832","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-java","tag-427","tag-2874"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u8bbe\u8ba1\u6a21\u5f0f\u4e4b\u72b6\u6001\u673a - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/54832.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u8bbe\u8ba1\u6a21\u5f0f\u4e4b\u72b6\u6001\u673a - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb376\u6b21\uff0c\u70b9\u8d5e3\u6b21\uff0c\u6536\u85cf8\u6b21\u3002GetterWAIT_PAYMENT(1, &quot;\u5f85\u652f\u4ed8&quot;),WAIT_DELIVER(2, &quot;\u5f85\u53d1\u8d27&quot;),WAIT_RECEIVE(3, &quot;\u5f85\u6536\u8d27&quot;),RECEIVED(4, &quot;\u5df2\u6536\u8d27&quot;),CANCEL(5, &quot;\u5df2\u53d6\u6d88&quot;);System.out.println(&quot;|--\u5f53\u524d\u8ba2\u5355\u72b6\u6001\u4e0d\u652f\u6301\u652f\u4ed8\uff0c\u5df2\u5ffd\u7565&quot;);System.out.println(&quot;|--\u5f53\u524d\u8ba2\u5355\u72b6\u6001\u4e0d\u652f\u6301\u53d6\u6d88\uff0c\u5df2\u5ffd\u7565&quot;);System.out.println(&quot;|--\u5f53\u524d\u8ba2\u5355\u72b6\u6001\u4e0d\u652f\u6301\u53d1\u8d27\uff0c\u5df2\u5ffd\u7565&quot;);\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/54832.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-08-13T03:50:04+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813035000-689c0b68d4394.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/54832.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/54832.html\",\"name\":\"\u8bbe\u8ba1\u6a21\u5f0f\u4e4b\u72b6\u6001\u673a - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-08-13T03:50:04+00:00\",\"dateModified\":\"2025-08-13T03:50:04+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/54832.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/54832.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/54832.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u8bbe\u8ba1\u6a21\u5f0f\u4e4b\u72b6\u6001\u673a\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u8bbe\u8ba1\u6a21\u5f0f\u4e4b\u72b6\u6001\u673a - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/54832.html","og_locale":"zh_CN","og_type":"article","og_title":"\u8bbe\u8ba1\u6a21\u5f0f\u4e4b\u72b6\u6001\u673a - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb376\u6b21\uff0c\u70b9\u8d5e3\u6b21\uff0c\u6536\u85cf8\u6b21\u3002GetterWAIT_PAYMENT(1, &quot;\u5f85\u652f\u4ed8&quot;),WAIT_DELIVER(2, &quot;\u5f85\u53d1\u8d27&quot;),WAIT_RECEIVE(3, &quot;\u5f85\u6536\u8d27&quot;),RECEIVED(4, &quot;\u5df2\u6536\u8d27&quot;),CANCEL(5, &quot;\u5df2\u53d6\u6d88&quot;);System.out.println(&quot;|--\u5f53\u524d\u8ba2\u5355\u72b6\u6001\u4e0d\u652f\u6301\u652f\u4ed8\uff0c\u5df2\u5ffd\u7565&quot;);System.out.println(&quot;|--\u5f53\u524d\u8ba2\u5355\u72b6\u6001\u4e0d\u652f\u6301\u53d6\u6d88\uff0c\u5df2\u5ffd\u7565&quot;);System.out.println(&quot;|--\u5f53\u524d\u8ba2\u5355\u72b6\u6001\u4e0d\u652f\u6301\u53d1\u8d27\uff0c\u5df2\u5ffd\u7565&quot;);","og_url":"https:\/\/www.wsisp.com\/helps\/54832.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-08-13T03:50:04+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813035000-689c0b68d4394.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/54832.html","url":"https:\/\/www.wsisp.com\/helps\/54832.html","name":"\u8bbe\u8ba1\u6a21\u5f0f\u4e4b\u72b6\u6001\u673a - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-08-13T03:50:04+00:00","dateModified":"2025-08-13T03:50:04+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/54832.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/54832.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/54832.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u8bbe\u8ba1\u6a21\u5f0f\u4e4b\u72b6\u6001\u673a"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/54832","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=54832"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/54832\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/54829"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=54832"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=54832"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=54832"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=54832"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}