VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/discern/query/item/AttendanceQueryItem.java
@@ -17,6 +17,8 @@ private String postName; // 部门名称 private String deptName; // private String time; /** * Get 人员主键 @@ -116,10 +118,24 @@ this.deptName = deptName; } /** * Get */ public String getTime() { return time; } /** * Set */ public void setTime(String time) { this.time = time; } public String toString() { return ",人员主键 =" + registerId + ",人员名字 =" + username + ",图片地址 =" + imagePath + ",证件编号 =" + identifyNum + ",名称 =" + gender + ",职位名称 =" + postName + ",部门名称 =" + deptName ; ",部门名称 =" + deptName + ", =" + time ; } } VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/AttendanceMng.java
@@ -3,6 +3,7 @@ import org.xutils.http.RequestParams; import org.xutils.x; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.List; @@ -27,13 +28,19 @@ x.http().post(params, new BaseCommonCallBack() { public void success() { List<AttendanceQueryItem> list = getList(AttendanceQueryItem.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 (AttendanceQueryItem item : list) { if (i % 3 == 0) { itemList.add("2016-10-10"); } try { String yearMonthDay = sdf2.format(sdf1.parse(item.getTime())); if (!previewDate.equals(yearMonthDay)) { itemList.add(yearMonthDay); previewDate = yearMonthDay; } } catch (Exception e) { } itemList.add(item); i++; }