|
|
@@ -63,11 +63,10 @@ public class PanelInstanceServiceImpl extends BaseService<PanelInstance> impleme
|
|
|
private KanbanParser kanbanParser;
|
|
|
|
|
|
@Override
|
|
|
- public PanelInstance save(@NotEmpty("json") String json) {
|
|
|
+ public int update(@NotEmpty("json") String json) throws IllegalArgumentException, OperationException {
|
|
|
PanelInstance panelInstance = panelInstanceDao.parse(json);
|
|
|
checkParameters(panelInstance);
|
|
|
- initSwitchFrequence(panelInstance);
|
|
|
- return panelInstanceDao.save(panelInstance);
|
|
|
+ return panelInstanceDao.update(panelInstance);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -162,40 +161,6 @@ public class PanelInstanceServiceImpl extends BaseService<PanelInstance> impleme
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 初始化切换频率
|
|
|
- *
|
|
|
- * @param panelInstance 面板实例
|
|
|
- */
|
|
|
- private void initSwitchFrequence(@NotEmpty("panelInstance") PanelInstance panelInstance)
|
|
|
- throws IllegalArgumentException {
|
|
|
- Panel panel = panelDao.checkExist(panelInstance.getPanelCode());
|
|
|
- switch (panel.getDisplay()) {
|
|
|
- case AutoSwitch:
|
|
|
- if (panelInstance.getSwitchFrequency() == null) {
|
|
|
- panelInstance.setSwitchFrequency(PanelInstance.DEFAULT_SWITCH_FREQUENCY);
|
|
|
- }
|
|
|
- break;
|
|
|
- case SplitScreen:
|
|
|
- if (panelInstance.getSwitchFrequency() != null) {
|
|
|
- panelInstance.setSwitchFrequency(null);
|
|
|
- }
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public PanelInstance savePart(@NotEmpty("json") String json) {
|
|
|
- return save(json);
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public int update(@NotEmpty("json") String json) throws IllegalArgumentException, OperationException {
|
|
|
- PanelInstance panelInstance = panelInstanceDao.parse(json);
|
|
|
- checkParameters(panelInstance);
|
|
|
- return panelInstanceDao.update(panelInstance);
|
|
|
- }
|
|
|
-
|
|
|
@Override
|
|
|
public int updatePart(@NotEmpty("json") String json) throws IllegalArgumentException, OperationException {
|
|
|
return update(json);
|
|
|
@@ -322,6 +287,28 @@ public class PanelInstanceServiceImpl extends BaseService<PanelInstance> impleme
|
|
|
return panelInstances;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 初始化切换频率
|
|
|
+ *
|
|
|
+ * @param panelInstance 面板实例
|
|
|
+ */
|
|
|
+ private void initSwitchFrequence(@NotEmpty("panelInstance") PanelInstance panelInstance)
|
|
|
+ throws IllegalArgumentException {
|
|
|
+ Panel panel = panelDao.checkExist(panelInstance.getPanelCode());
|
|
|
+ switch (panel.getDisplay()) {
|
|
|
+ case AutoSwitch:
|
|
|
+ if (panelInstance.getSwitchFrequency() == null) {
|
|
|
+ panelInstance.setSwitchFrequency(PanelInstance.DEFAULT_SWITCH_FREQUENCY);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case SplitScreen:
|
|
|
+ if (panelInstance.getSwitchFrequency() != null) {
|
|
|
+ panelInstance.setSwitchFrequency(null);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public PanelInstance saveToDesktop(@NotEmpty("json") String json) {
|
|
|
// TODO save to desktop
|