Commit 4680f423 by zhiwj

代码结构调整

parent abc230b6
...@@ -127,7 +127,7 @@ public class ScreeningController { ...@@ -127,7 +127,7 @@ public class ScreeningController {
@ResponseBody @ResponseBody
public RestResponse getScreeningChainDetail(String parentChainId, String widgetFieldKey) { public RestResponse getScreeningChainDetail(String parentChainId, String widgetFieldKey) {
EsScreeningChainDetailDTO dto = this.esScreeningInitService.findChainDetail(parentChainId, widgetFieldKey); EsScreeningChainDetailDTO dto = this.esScreeningInitService.findChainDetail(parentChainId, widgetFieldKey);
if (dto != null && StringUtils.isNotBlank(dto.getWidget().getWidgetValues())) { if (dto != null && dto.getWidget() != null && StringUtils.isNotBlank(dto.getWidget().getWidgetValues())) {
List<WidgetValuesOldVO> oldVOS = JSONObject.parseArray(dto.getWidget().getWidgetValues(), WidgetValuesOldVO.class); List<WidgetValuesOldVO> oldVOS = JSONObject.parseArray(dto.getWidget().getWidgetValues(), WidgetValuesOldVO.class);
List<WidgetValuesNewVO> newVOList = oldVOS.stream().map(data -> new WidgetValuesNewVO(data.getKey(), data.getValue(), data.getName())).collect(Collectors.toList()); List<WidgetValuesNewVO> newVOList = oldVOS.stream().map(data -> new WidgetValuesNewVO(data.getKey(), data.getValue(), data.getName())).collect(Collectors.toList());
dto.getWidget().setWidgetValues(JSON.toJSONString(newVOList)); dto.getWidget().setWidgetValues(JSON.toJSONString(newVOList));
...@@ -140,7 +140,7 @@ public class ScreeningController { ...@@ -140,7 +140,7 @@ public class ScreeningController {
@ResponseBody @ResponseBody
public Object getScreeningWidgetDetail(String widgetChainId) { public Object getScreeningWidgetDetail(String widgetChainId) {
EsScreeningChainDetailDTO dto = this.esScreeningInitService.findChainDetail(widgetChainId); EsScreeningChainDetailDTO dto = this.esScreeningInitService.findChainDetail(widgetChainId);
if (dto != null && StringUtils.isNotBlank(dto.getWidget().getWidgetValues())) { if (dto != null && dto.getWidget() != null && StringUtils.isNotBlank(dto.getWidget().getWidgetValues())) {
List<WidgetValuesOldVO> oldVOS = JSONObject.parseArray(dto.getWidget().getWidgetValues(), WidgetValuesOldVO.class); List<WidgetValuesOldVO> oldVOS = JSONObject.parseArray(dto.getWidget().getWidgetValues(), WidgetValuesOldVO.class);
List<WidgetValuesNewVO> newVOList = oldVOS.stream().map(data -> new WidgetValuesNewVO(data.getKey(), data.getValue(), data.getName())).collect(Collectors.toList()); List<WidgetValuesNewVO> newVOList = oldVOS.stream().map(data -> new WidgetValuesNewVO(data.getKey(), data.getValue(), data.getName())).collect(Collectors.toList());
dto.getWidget().setWidgetValues(JSON.toJSONString(newVOList)); dto.getWidget().setWidgetValues(JSON.toJSONString(newVOList));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment