Date now = new Date();
String time=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(now)
String time;
Date date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(time);
Instant startTime;
String allotStamp = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(Date.from(startTime));
String t;
Instant time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(t).toInstant();
List<Long> ApparatusIds =
ids.stream().map(s -> Long.parseLong(s.trim())).collect(Collectors.toList());
import org.apache.htrace.shaded.fasterxml.jackson.databind.ObjectMapper;
Map<String, Object> contentJson = form.getContent();
if (MapUtils.isNotEmpty(contentJson)) {
try {String content = new ObjectMapper().writeValueAsString(contentJson);
SOW.setContent(content);
} catch (Exception e) {throw new RuntimeException(e.getMessage());
}
}
import com.google.gson.Gson;
Map<String, Object> dto = null;
try {Gson gson = new Gson();
if (StringUtils.isNotBlank(source.getContent())) {dto = gson.fromJson(source.getContent(), new TypeToken<Map<String, Object>>() {}.getType());
}
} catch (JsonSyntaxException e) {throw new RuntimeException("string 转 map 谬误");
}