git-svn-id: http://192.168.1.226/svn/proxy@834 454eff88-639b-444f-9e54-f578c98de674
| | |
| | | private AttenderRegisterSelectPhotoListView dialog_surveillance_photo_select_list_view;
|
| | |
|
| | | public static long selectedId = -1;
|
| | | private boolean isShow = false;
|
| | |
|
| | | private static AttenderRegisterSelectPhotoDialog instance = new AttenderRegisterSelectPhotoDialog();
|
| | | public static AttenderRegisterSelectPhotoDialog getInstance() {
|
| | |
| | | View view = LayoutInflater.from(MainActivity.getInstance()).inflate(R.layout.dialog_attender_register_select_photo_select,null);
|
| | | ViewUtils.inject(this, view);
|
| | |
|
| | | if (BaseApplication.getInstance().networkAvailable()) {
|
| | | if (CommonVariables.Register.VISITOR_REGISTER_SELECTED) {
|
| | | dialog_surveillance_photo_select_list_view.show(SurveillanceQueryItemUtil.getInstance().getAllUnregisterVisitorTwoRowsForSelect(selectedId));
|
| | | } else {
|
| | | dialog_surveillance_photo_select_list_view.show(SurveillanceQueryItemUtil.getInstance().getAllUnregisterAttenderTwoRowsForSelect(selectedId));
|
| | | }
|
| | | } else {
|
| | | if (CommonVariables.Register.VISITOR_REGISTER_SELECTED) {
|
| | | dialog_surveillance_photo_select_list_view.show(UnknownSurveillanceQueryItemUtil.getInstance().getAllUnregisterVisitorTwoRowsForSelect(selectedId));
|
| | | } else {
|
| | | dialog_surveillance_photo_select_list_view.show(UnknownSurveillanceQueryItemUtil.getInstance().getAllUnregisterAttenderTwoRowsForSelect(selectedId));
|
| | | }
|
| | | }
|
| | | setTitleAndList(Constant.DialogSelectType.ID_TYPE);
|
| | | WheelView.WheelViewStyle style = new WheelView.WheelViewStyle();
|
| | | style.selectedTextColor = Color.parseColor("#11c3e3");
|
| | |
| | |
|
| | | }
|
| | | });
|
| | | this.showAtLocation(parentView, Gravity.BOTTOM,0,330);
|
| | | }
|
| | |
|
| | |
|
| | |
| | | }
|
| | |
|
| | | public void show() {
|
| | | if (BaseApplication.getInstance().networkAvailable()) {
|
| | | dialog_surveillance_photo_select_list_view.show(SurveillanceQueryItemUtil.getInstance().getAllUnregisterAttenderTwoRowsForSelect(selectedId));
|
| | | } else {
|
| | | dialog_surveillance_photo_select_list_view.show(UnknownSurveillanceQueryItemUtil.getInstance().getAllUnregisterAttenderTwoRowsForSelect(selectedId));
|
| | | }
|
| | | if (this.isShowing()) {
|
| | |
|
| | | } else {
|
| | | //this.showAsDropDown();
|
| | | this.showAtLocation(parentView, Gravity.BOTTOM,0,330);
|
| | | }
|
| | | isShow = true;
|
| | | }
|
| | |
|
| | | public void hide() {
|
| | | if (!isShow) {
|
| | | return;
|
| | | }
|
| | | if (this.isShowing()) {
|
| | | dismiss();
|
| | | } else {
|
| | |
| | |
|
| | | public static long selectedId = -1;
|
| | |
|
| | | private boolean isShow = false;
|
| | |
|
| | | public static AttenderRegisterUploadPhotoDialog instance = new AttenderRegisterUploadPhotoDialog();
|
| | | public static AttenderRegisterUploadPhotoDialog getInstance() {
|
| | | return instance;
|
| | |
| | | View view = LayoutInflater.from(MainActivity.getInstance()).inflate(R.layout.dialog_attender_register_upload_photo_select,null);
|
| | | ViewUtils.inject(this, view);
|
| | |
|
| | | if (BaseApplication.getInstance().networkAvailable()) {
|
| | | if (CommonVariables.Register.VISITOR_REGISTER_SELECTED) {
|
| | | dialog_surveillance_photo_select_list_view.show(SurveillanceQueryItemUtil.getInstance().getAllUnregisterVisitorTwoRowsForSelect(selectedId));
|
| | | } else {
|
| | | dialog_surveillance_photo_select_list_view.show(SurveillanceQueryItemUtil.getInstance().getAllUnregisterAttenderTwoRowsForSelect(selectedId));
|
| | | }
|
| | | } else {
|
| | | if (CommonVariables.Register.VISITOR_REGISTER_SELECTED) {
|
| | | dialog_surveillance_photo_select_list_view.show(UnknownSurveillanceQueryItemUtil.getInstance().getAllUnregisterVisitorTwoRowsForSelect(selectedId));
|
| | | } else {
|
| | | dialog_surveillance_photo_select_list_view.show(UnknownSurveillanceQueryItemUtil.getInstance().getAllUnregisterAttenderTwoRowsForSelect(selectedId));
|
| | | }
|
| | | }
|
| | | setTitleAndList(Constant.DialogSelectType.ID_TYPE);
|
| | | WheelView.WheelViewStyle style = new WheelView.WheelViewStyle();
|
| | | style.selectedTextColor = Color.parseColor("#11c3e3");
|
| | |
| | |
|
| | | }
|
| | | });
|
| | | this.showAtLocation(parentView, Gravity.BOTTOM,0,330);
|
| | | }
|
| | |
|
| | |
|
| | |
| | | }
|
| | |
|
| | | public void hide() {
|
| | | if (!isShow) {
|
| | | return;
|
| | | }
|
| | | if (this.isShowing()) {
|
| | | dismiss();
|
| | | } else {
|
| | |
| | | }
|
| | |
|
| | | public void show() {
|
| | | if (BaseApplication.getInstance().networkAvailable()) {
|
| | | dialog_surveillance_photo_select_list_view.show(SurveillanceQueryItemUtil.getInstance().getAllUnregisterAttenderTwoRowsForSelect(selectedId));
|
| | | } else {
|
| | | dialog_surveillance_photo_select_list_view.show(UnknownSurveillanceQueryItemUtil.getInstance().getAllUnregisterAttenderTwoRowsForSelect(selectedId));
|
| | | }
|
| | | if (this.isShowing()) {
|
| | |
|
| | | } else {
|
| | | //this.showAsDropDown();
|
| | | this.showAtLocation(parentView, Gravity.BOTTOM,0,330);
|
| | | }
|
| | | isShow = true;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | public static long selectedId = -1;
|
| | |
|
| | | private boolean isShow = false;
|
| | |
|
| | | public static VisitorRegisterSelectPhotoDialog instance = new VisitorRegisterSelectPhotoDialog();
|
| | | public static VisitorRegisterSelectPhotoDialog getInstance() {
|
| | | return instance;
|
| | |
| | | View view = LayoutInflater.from(MainActivity.getInstance()).inflate(R.layout.dialog_visitor_register_select_photo_select,null);
|
| | | ViewUtils.inject(this, view);
|
| | |
|
| | | if (BaseApplication.getInstance().networkAvailable()) {
|
| | | if (CommonVariables.Register.VISITOR_REGISTER_SELECTED) {
|
| | | dialog_surveillance_photo_select_list_view.show(SurveillanceQueryItemUtil.getInstance().getAllUnregisterVisitorTwoRowsForSelect(selectedId));
|
| | | } else {
|
| | | dialog_surveillance_photo_select_list_view.show(SurveillanceQueryItemUtil.getInstance().getAllUnregisterAttenderTwoRowsForSelect(selectedId));
|
| | | }
|
| | | } else {
|
| | | if (CommonVariables.Register.VISITOR_REGISTER_SELECTED) {
|
| | | dialog_surveillance_photo_select_list_view.show(UnknownSurveillanceQueryItemUtil.getInstance().getAllUnregisterVisitorTwoRowsForSelect(selectedId));
|
| | | } else {
|
| | | dialog_surveillance_photo_select_list_view.show(UnknownSurveillanceQueryItemUtil.getInstance().getAllUnregisterAttenderTwoRowsForSelect(selectedId));
|
| | | }
|
| | | }
|
| | | setTitleAndList(Constant.DialogSelectType.ID_TYPE);
|
| | | WheelView.WheelViewStyle style = new WheelView.WheelViewStyle();
|
| | | style.selectedTextColor = Color.parseColor("#11c3e3");
|
| | |
| | |
|
| | | }
|
| | | });
|
| | | this.showAtLocation(parentView, Gravity.BOTTOM,0,330);
|
| | | }
|
| | |
|
| | |
|
| | |
| | | }
|
| | |
|
| | | public void show() {
|
| | | if (BaseApplication.getInstance().networkAvailable()) {
|
| | | dialog_surveillance_photo_select_list_view.show(SurveillanceQueryItemUtil.getInstance().getAllUnregisterVisitorTwoRowsForSelect(selectedId));
|
| | | } else {
|
| | | dialog_surveillance_photo_select_list_view.show(UnknownSurveillanceQueryItemUtil.getInstance().getAllUnregisterVisitorTwoRowsForSelect(selectedId));
|
| | | }
|
| | | if (this.isShowing()) {
|
| | |
|
| | | } else {
|
| | | //this.showAsDropDown();
|
| | | this.showAtLocation(parentView, Gravity.BOTTOM,0,330);
|
| | | }
|
| | | isShow = true;
|
| | | }
|
| | |
|
| | | public void hide() {
|
| | | if (!isShow) {
|
| | | return;
|
| | | }
|
| | | if (this.isShowing()) {
|
| | | dismiss();
|
| | | } else {
|
| | |
| | |
|
| | | public static long selectedId = -1;
|
| | |
|
| | | private boolean isShow = false;
|
| | |
|
| | | private static VisitorRegisterUploadPhotoDialog instance = new VisitorRegisterUploadPhotoDialog();
|
| | | public static VisitorRegisterUploadPhotoDialog getInstance() {
|
| | | return instance;
|
| | |
| | | View view = LayoutInflater.from(MainActivity.getInstance()).inflate(R.layout.dialog_visitor_register_upload_photo_select,null);
|
| | | ViewUtils.inject(this, view);
|
| | |
|
| | | if (BaseApplication.getInstance().networkAvailable()) {
|
| | | if (CommonVariables.Register.VISITOR_REGISTER_SELECTED) {
|
| | | dialog_surveillance_photo_select_list_view.show(SurveillanceQueryItemUtil.getInstance().getAllUnregisterVisitorTwoRowsForSelect(selectedId));
|
| | | } else {
|
| | | dialog_surveillance_photo_select_list_view.show(SurveillanceQueryItemUtil.getInstance().getAllUnregisterAttenderTwoRowsForSelect(selectedId));
|
| | | }
|
| | | } else {
|
| | | if (CommonVariables.Register.VISITOR_REGISTER_SELECTED) {
|
| | | dialog_surveillance_photo_select_list_view.show(UnknownSurveillanceQueryItemUtil.getInstance().getAllUnregisterVisitorTwoRowsForSelect(selectedId));
|
| | | } else {
|
| | | dialog_surveillance_photo_select_list_view.show(UnknownSurveillanceQueryItemUtil.getInstance().getAllUnregisterAttenderTwoRowsForSelect(selectedId));
|
| | | }
|
| | | }
|
| | | setTitleAndList(Constant.DialogSelectType.ID_TYPE);
|
| | | WheelView.WheelViewStyle style = new WheelView.WheelViewStyle();
|
| | | style.selectedTextColor = Color.parseColor("#11c3e3");
|
| | |
| | |
|
| | | }
|
| | | });
|
| | | this.showAtLocation(parentView, Gravity.BOTTOM,0,330);
|
| | | }
|
| | |
|
| | |
|
| | |
| | | }
|
| | |
|
| | | public void hide() {
|
| | | if (!isShow) {
|
| | | return;
|
| | | }
|
| | | if (this.isShowing()) {
|
| | | dismiss();
|
| | | } else {
|
| | |
| | | }
|
| | |
|
| | | public void show() {
|
| | | if (BaseApplication.getInstance().networkAvailable()) {
|
| | | dialog_surveillance_photo_select_list_view.show(SurveillanceQueryItemUtil.getInstance().getAllUnregisterVisitorTwoRowsForSelect(selectedId));
|
| | | } else {
|
| | | dialog_surveillance_photo_select_list_view.show(UnknownSurveillanceQueryItemUtil.getInstance().getAllUnregisterVisitorTwoRowsForSelect(selectedId));
|
| | | }
|
| | | if (this.isShowing()) {
|
| | |
|
| | | } else {
|
| | | //this.showAsDropDown();
|
| | | this.showAtLocation(parentView, Gravity.BOTTOM,0,330);
|
| | | }
|
| | | isShow = true;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | if (!BaseApplication.deviceAvailable) {
|
| | | return;
|
| | | }
|
| | | try {
|
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
| | | RequestParams params = new RequestParams(AppApi.BASE_URL +AppApi.Query.ATTENDANCE_DETAIL_QUERY);
|
| | | //params.addBodyParameter(AttendanceDetailQueryCondition.FieldNames.time, sdf.format(sdf.parse(item.getTime())));
|
| | | params.addBodyParameter(AttendanceDetailQueryCondition.FieldNames.registerId, item.getRegisterId());
|
| | | params.addBodyParameter(AttendanceDetailQueryCondition.FieldNames.deviceCompanyId, BaseApplication.getInstance().getAndroidDevice().getCompanyId());
|
| | | params.addBodyParameter(CommonVariables.Page.PAGE_SIZE, "20");
|
| | | x.http().post(params, new BaseCommonCallBack() {
|
| | | public void success() {
|
| | | AttendanceFragment.getInstance().get_fragment_attendance_right_list_view().show(getList(AttendanceDetailQueryItem.class));
|
| | | }
|
| | | });
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | if (1==1) {//没网了
|
| | | AttendanceDao.getInstance().reloadAttendanceDetail(item);
|
| | | if (BaseApplication.getInstance().networkAvailable()) {
|
| | | try {
|
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
| | | RequestParams params = new RequestParams(AppApi.BASE_URL +AppApi.Query.ATTENDANCE_DETAIL_QUERY);
|
| | | //params.addBodyParameter(AttendanceDetailQueryCondition.FieldNames.time, sdf.format(sdf.parse(item.getTime())));
|
| | | params.addBodyParameter(AttendanceDetailQueryCondition.FieldNames.registerId, item.getRegisterId());
|
| | | params.addBodyParameter(AttendanceDetailQueryCondition.FieldNames.deviceCompanyId, BaseApplication.getInstance().getAndroidDevice().getCompanyId());
|
| | | params.addBodyParameter(CommonVariables.Page.PAGE_SIZE, "20");
|
| | | x.http().post(params, new BaseCommonCallBack() {
|
| | | public void success() {
|
| | | AttendanceFragment.getInstance().get_fragment_attendance_right_list_view().show(getList(AttendanceDetailQueryItem.class));
|
| | | }
|
| | | });
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | } else {
|
| | | AttendanceFragment.getInstance().get_fragment_attendance_right_list_view().show(AttendanceDao.getInstance().reloadAttendanceDetail(item));
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | if(deviceCompanyId != null && !deviceCompanyId.trim().isEmpty()) {
|
| | | sb.append(" AND a.device_company_id = ").append(deviceCompanyId);
|
| | | }
|
| | | sb.append("ORDER BY a.time DESC");
|
| | | sb.append(" ORDER BY a.time DESC");
|
| | | StringBuilder count = new StringBuilder(sb.length());
|
| | | count.append("select count(*) as count from (").append(sb).append(" ) _table");
|
| | | sb.append(" LIMIT ").append("0").append(",").append(100);
|
| | |
| | | }
|
| | |
|
| | | public List getAllUnregisterVisitorTwoRowsForSelect(long selectedId) {
|
| | | select(allItems, selectedId);
|
| | | return allItems;
|
| | | }
|
| | |
|
| | | public void select(List<SurveillanceQueryItem> items, long selectedId) {
|
| | | for (SurveillanceQueryItem item : items) {
|
| | | item.setSurveillancePhotoSelected(false);
|
| | | if (item.getIdForSelect() == selectedId) {
|
| | | item.setSurveillancePhotoSelected(true);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public List getAllUnregisterAttenderTwoRowsForSelect(long selectedId) {
|
| | | select(allItems, selectedId);
|
| | | return allItems;
|
| | | }
|
| | |
|