|
|
@@ -16,7 +16,6 @@ import org.mongodb.morphia.query.Query;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
-import com.alibaba.fastjson.JSONObject;
|
|
|
import com.uas.kanban.annotation.NotEmpty;
|
|
|
import com.uas.kanban.base.BaseService;
|
|
|
import com.uas.kanban.dao.GlobalParameterDao;
|
|
|
@@ -152,7 +151,9 @@ public class KanbanInstanceServiceImpl extends BaseService<KanbanInstance> imple
|
|
|
if (!CollectionUtils.isEmpty(globalParameters)) {
|
|
|
kanbanInstance.setGlobalParameters(globalParameters);
|
|
|
}
|
|
|
- kanbanInstance.setParameters(parameters);
|
|
|
+ if (!CollectionUtils.isEmpty(parameters)) {
|
|
|
+ kanbanInstance.setParameters(parameters);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -282,13 +283,13 @@ public class KanbanInstanceServiceImpl extends BaseService<KanbanInstance> imple
|
|
|
@Override
|
|
|
public KanbanInstance openKanbanInstance(@NotEmpty("kanbanCode") String kanbanCode) throws IllegalStateException {
|
|
|
KanbanInstance kanbanInstance = getByKanbanCode(kanbanCode);
|
|
|
- // 如果有创建的实例,返回该实例,如果没有,创建后返回
|
|
|
+ // 如果有创建的实例,返回该实例,如果没有,提取参数等之后返回
|
|
|
if (kanbanInstance == null) {
|
|
|
- KanbanInstance instance = new KanbanInstance();
|
|
|
- instance.setKanbanCode(kanbanCode);
|
|
|
- // 默认刷新频率
|
|
|
- instance.setRefreshFrequency(KanbanInstance.DEFAULT_REFRESH_FREQUENCY);
|
|
|
- kanbanInstance = save(JSONObject.toJSONString(instance));
|
|
|
+ kanbanInstance = new KanbanInstance();
|
|
|
+ kanbanInstance.setKanbanCode(kanbanCode);
|
|
|
+ kanbanInstance.setRefreshFrequency(KanbanInstance.DEFAULT_REFRESH_FREQUENCY);
|
|
|
+ // 生成相应的看板实例参数
|
|
|
+ generateParameters(kanbanInstance);
|
|
|
}
|
|
|
return kanbanInstance;
|
|
|
}
|