{"id":597,"date":"2024-01-04T09:01:01","date_gmt":"2024-01-04T01:01:01","guid":{"rendered":""},"modified":"2024-01-04T09:01:01","modified_gmt":"2024-01-04T01:01:01","slug":"JSONarray\u6570\u7ec4\u53bb\u91cd\u65b9\u6cd5","status":"publish","type":"post","link":"https:\/\/mushiming.com\/597.html","title":{"rendered":"JSONarray\u6570\u7ec4\u53bb\u91cd\u65b9\u6cd5"},"content":{"rendered":"

\n <\/path> \n<\/svg> <\/p>\n

\u901a\u8fc7set\u96c6\u5408\u6570\u636e\u4e0d\u91cd\u590d\u7684\u7279\u6027\u53bb\u91cd\uff0c\u6700\u540e\u518d\u8f6c\u5316\u4e3a\u6570\u7ec4\u5f62\u5f0f<\/h2>\n
 public<\/span> JSONArray<\/span> getSummary<\/span>(<\/span>String<\/span> pk)<\/span> { \n   <\/span>\n        DataTable<\/span> dataRows=<\/span>visitPlanDao.<\/span>getSummary<\/span>(<\/span>)<\/span>;<\/span>\n        DataTable<\/span> dataRows1=<\/span>visitPlanDao.<\/span>getOldSummary<\/span>(<\/span>pk)<\/span>;<\/span>\n        JSONArray<\/span> dataList =<\/span> JSONUtil<\/span>.<\/span>dataRows2json<\/span>(<\/span>dataRows.<\/span>getRows<\/span>(<\/span>)<\/span>,<\/span>true<\/span>)<\/span>;<\/span>\n        JSONArray<\/span> dataList1=<\/span>JSONUtil<\/span>.<\/span>dataRows2json<\/span>(<\/span>dataRows1.<\/span>getRows<\/span>(<\/span>)<\/span>,<\/span>true<\/span>)<\/span>;<\/span>\n        if<\/span>(<\/span>dataList1.<\/span>size<\/span>(<\/span>)<\/span>><\/span>0<\/span>)<\/span>{ \n   <\/span>\n            dataList.<\/span>addAll<\/span>(<\/span>dataList1)<\/span>;<\/span>\n        }<\/span>\n        Set<\/span> set=<\/span>new<\/span> HashSet<\/span>(<\/span>)<\/span>;<\/span>\/\/\u521b\u5efaset\u96c6\u5408<\/span>\n        for<\/span> (<\/span>int<\/span> i=<\/span>0<\/span>;<\/span>i<<\/span>dataList.<\/span>size<\/span>(<\/span>)<\/span>;<\/span>i++<\/span>)<\/span>{ \n   <\/span>\n            set.<\/span>add<\/span>(<\/span>dataList.<\/span>get<\/span>(<\/span>i)<\/span>)<\/span>;<\/span>\/\/\u6570\u7ec4\u4e2d\u7684\u6570\u636e\u5faa\u73af\u52a0\u5165\u96c6\u5408\u4e2d<\/span>\n        }<\/span>\n        dataList=<\/span>JSONArray<\/span>.<\/span>parseArray<\/span>(<\/span>set.<\/span>toString<\/span>(<\/span>)<\/span>)<\/span>;<\/span>\/\/\u8f6c\u5316\u4e3a\u6570\u7ec4<\/span>\n        return<\/span> dataList;<\/span>\n    }<\/span>\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"JSONarray\u6570\u7ec4\u53bb\u91cd\u65b9\u6cd5jsonarray\u53bb\u9664\u91cd\u590d_jsonarray\u53bb\u91cd","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[82],"tags":[],"_links":{"self":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/597"}],"collection":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/comments?post=597"}],"version-history":[{"count":0,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/597\/revisions"}],"wp:attachment":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/media?parent=597"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/categories?post=597"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/tags?post=597"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}