REQ-3201: 更新动作
This commit is contained in:
parent
203bb7199a
commit
cc26856c76
@ -147,7 +147,7 @@ public class CardManager {
|
||||
UpdateCollector collector = new UpdateCollector(requestContext, "updateState", templateModel, cards);
|
||||
collector.updateState((card) -> {
|
||||
Card update = collector.createUpdate(card);
|
||||
if (request.isCardCompleted())
|
||||
if (request.determineIsCardCompleted())
|
||||
update.setCardState(CardState.COMPLETED);
|
||||
update.setBizState(request.getBizState());
|
||||
});
|
||||
|
||||
@ -21,13 +21,17 @@ public class CardUpdateStateRequest extends CardUpdateRequest {
|
||||
/**
|
||||
* 是否将卡片设置为完成状态, 结合模版配置控制按钮可见性. bizState 和 cardCompleted 两选一
|
||||
*/
|
||||
private boolean cardCompleted = false;
|
||||
private Boolean cardCompleted;
|
||||
|
||||
public void validate() {
|
||||
if (!cardCompleted && bizState == null)
|
||||
if (!determineIsCardCompleted() && bizState == null)
|
||||
throw new ServiceException("cardCompleted 和 bizState 不能同时为空");
|
||||
}
|
||||
|
||||
public boolean determineIsCardCompleted() {
|
||||
return cardCompleted != null && cardCompleted;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user