public static void main(String[] args) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("kprq","20220502");
//转成 - - 形式
JSONObject targetObject = new JSONObject();
targetObject.put("billDate", jsonObject.get("kprq"));
System.out.println(jsonObject.get("kprq"));
System.out.println(JSON.toJSONString(targetObject));
System.out.println(JSON.toJSONString(targetObject.toJavaObject(TTTT.class)));
}
@Getter @Setter @NoArgsConstructor public class TTTT {
@JSONField(format = "yyyy-MM-dd") private Date billDate;
}