fix--JSON null

qianming 1 year ago
parent d2d050fc57
commit 1ebed96cc8

@ -131,7 +131,7 @@ public class DataSetServiceImpl implements DataSetService {
if (StringUtils.isNotBlank(dto.getCaseResult())) { if (StringUtils.isNotBlank(dto.getCaseResult())) {
try { try {
JSONArray jsonArray = JSONArray.parseArray(JSON.toJSONString(dto.getCaseResult(), SerializerFeature.WriteMapNullValue)); JSONArray jsonArray = JSONArray.parseArray(dto.getCaseResult());
JSONObject jsonObject = jsonArray.getJSONObject(0); JSONObject jsonObject = jsonArray.getJSONObject(0);
dto.setSetParamList(jsonObject.keySet()); dto.setSetParamList(jsonObject.keySet());
} catch (Exception e) { } catch (Exception e) {
@ -163,7 +163,7 @@ public class DataSetServiceImpl implements DataSetService {
Object o = objects.get(0); Object o = objects.get(0);
objects = new JSONArray(); objects = new JSONArray();
objects.add(o); objects.add(o);
dataSet.setCaseResult(objects.toJSONString()); dataSet.setCaseResult(JSON.toJSONString(objects, SerializerFeature.WriteMapNullValue));
} }
} catch (Exception e) { } catch (Exception e) {
log.info("结果集只保留一行数据失败...{}", e.getMessage()); log.info("结果集只保留一行数据失败...{}", e.getMessage());
@ -184,7 +184,7 @@ public class DataSetServiceImpl implements DataSetService {
* @param dto * @param dto
*/ */
@Override @Override
@Transactional @Transactional(rollbackFor = Exception.class)
public void updateSet(DataSetDto dto) { public void updateSet(DataSetDto dto) {
List<DataSetParamDto> dataSetParamDtoList = dto.getDataSetParamDtoList(); List<DataSetParamDto> dataSetParamDtoList = dto.getDataSetParamDtoList();
List<DataSetTransformDto> dataSetTransformDtoList = dto.getDataSetTransformDtoList(); List<DataSetTransformDto> dataSetTransformDtoList = dto.getDataSetTransformDtoList();

Loading…
Cancel
Save