| | |
| | | import org.xutils.http.RequestParams;
|
| | | import org.xutils.x;
|
| | |
|
| | | import java.text.SimpleDateFormat;
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | |
|
| | |
| | | x.http().post(params, new BaseCommonCallBack() {
|
| | | public void success() {
|
| | | List<VisitQueryItem> list = getList(VisitQueryItem.class);
|
| | | String date = "";
|
| | | List itemList = new ArrayList();
|
| | | int i = 0;
|
| | | String previewDate = "";
|
| | | SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
|
| | | SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy年MM月dd日");
|
| | | for (VisitQueryItem item : list) {
|
| | | if (i % 3 == 0) {
|
| | | itemList.add("2016-10-10");
|
| | | }
|
| | | try {
|
| | | String yearMonthDay = sdf2.format(sdf1.parse(item.getEnterTime()));
|
| | | if (!previewDate.equals(yearMonthDay)) {
|
| | | itemList.add(yearMonthDay);
|
| | | previewDate = yearMonthDay;
|
| | | }
|
| | | } catch (Exception e) { }
|
| | | itemList.add(item);
|
| | | i++;
|
| | | }
|