| | |
| | | import cn.com.basic.face.service.sqlite.PhoneCallDao;
|
| | | import cn.com.basic.face.util.AppApi;
|
| | | import cn.com.basic.face.util.CharacterParser;
|
| | | import cn.com.basic.face.util.RtspFaceNative;
|
| | | import cn.com.basic.face.util.SqliteSqlUtil;
|
| | | import cn.com.basic.face.util.ToastUtil;
|
| | |
|
| | | public class PhoneCallMng extends BaseMng {
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private void findPhoneCallLeftListAfterReturn(ResultBean resultBean, boolean isSortByDept, boolean append) {
|
| | | private void findPhoneCallLeftListAfterReturn(ResultBean resultBean, final boolean isSortByDept, final boolean append) {
|
| | | List<PhoneCallQueryItem> list = resultBean.getList(PhoneCallQueryItem.class);
|
| | |
|
| | | if (append) {
|
| | |
| | | }
|
| | | }
|
| | | sort(list, isSortByDept);
|
| | | List itemList = new ArrayList();
|
| | | final List itemList = new ArrayList();
|
| | | String name = "";
|
| | | String prev = "";
|
| | | for (int i = 0; i < list.size(); i++) {
|
| | |
| | | prev = name;
|
| | | }
|
| | | addPageFooter(resultBean.hasMorePages(), resultBean.getPageNum(), itemList);
|
| | | PhoneCallFragment.getInstance().get_fragment_phone_call_left_list_view().show(isSortByDept, itemList, append);
|
| | | if (BaseApplication.getInstance().networkAvailable()) {
|
| | | PhoneCallFragment.getInstance().get_fragment_phone_call_left_list_view().show(isSortByDept, itemList, append);
|
| | | } else {
|
| | | MainActivity.getInstance().runOnUiThread(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | | PhoneCallFragment.getInstance().get_fragment_phone_call_left_list_view().show(isSortByDept, itemList, append);
|
| | | }
|
| | | });
|
| | | }
|
| | | }
|
| | |
|
| | | private void sort(List<PhoneCallQueryItem> list, final boolean sortedByDept) {
|
| | |
| | | });
|
| | | }
|
| | |
|
| | | public void addPhoneCall(CheckInQueryItem visitor, CheckInQueryItem interviewee) {
|
| | | public void addPhoneCall(CheckInQueryItem visitor, CheckInQueryItem interviewee, boolean isMobilePhone) {
|
| | | if (visitor == null) {
|
| | | Toast.makeText(MainActivity.getInstance(), "请先选择被访人", Toast.LENGTH_SHORT).show();
|
| | | ToastUtil.show("请先选择来访人");
|
| | | return;
|
| | | }
|
| | | if (interviewee == null) {
|
| | | Toast.makeText(MainActivity.getInstance(), "请先选择被访人", Toast.LENGTH_SHORT).show();
|
| | | ToastUtil.show("请先选择被访人");
|
| | | return;
|
| | | }
|
| | | if (isMobilePhone) {
|
| | | String mobilePhone = interviewee.getMobilePhone();
|
| | | if (mobilePhone == null || mobilePhone.trim().length() != 11) {
|
| | | ToastUtil.show("手机号码不正确");
|
| | | return;
|
| | | }
|
| | | RtspFaceNative.teleCall(mobilePhone);
|
| | | } else {
|
| | | String tel = interviewee.getTel();
|
| | | if (tel == null || tel.trim().length() == 0) {
|
| | | ToastUtil.show("座机不正确");
|
| | | return;
|
| | | }
|
| | | RtspFaceNative.teleCall(tel);
|
| | | }
|
| | |
|
| | | if (BaseApplication.getInstance().networkAvailable()) {
|
| | | Toast.makeText(MainActivity.getInstance(), "已添加到呼叫记录", Toast.LENGTH_SHORT).show();
|
| | | Toast.makeText(MainActivity.getInstance(), "", Toast.LENGTH_SHORT).show();
|
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
| | | RequestParams params = new RequestParams(AppApi.BASE_URL +AppApi.PHONE_CALL_ADD);
|
| | | params.addBodyParameter(PhoneCall.FieldNames.date, sdf.format(new Date()));
|
| | |
| | | } else {
|
| | | PhoneCallDao.getInstance().addPhoneCall(visitor, interviewee);
|
| | | }
|
| | | ToastUtil.show("已添加到呼叫记录");
|
| | | }
|
| | |
|
| | | }
|