git-svn-id: http://192.168.1.226/svn/proxy@489 454eff88-639b-444f-9e54-f578c98de674
| | |
| | | |
| | | import org.xutils.x; |
| | | |
| | | /** |
| | | * Created by zhangbo on 2017/2/15. |
| | | */ |
| | | |
| | | public class BaseApplication extends Application{ |
| | | |
| | | private static BaseApplication application; |
| | |
| | | Fresco.initialize(this); |
| | | initOkHttpUtils(); |
| | | application = this; |
| | | DeviceMng.getInstance().findPlace(); |
| | | DeviceMng.getInstance().findDevice(); |
| | | DictionaryMng.getInstance().loadAllDictionaryData(); |
| | | } |
| | | |
| | |
| | | /**
|
| | | * 公司主键
|
| | | */
|
| | | public static final String companyId = "companyId";
|
| | | public static final String deviceCompanyId = "deviceCompanyId";
|
| | | /**
|
| | | * 设备地点
|
| | | */
|
| | |
| | | // 设备主键
|
| | | private String deviceId;
|
| | | // 公司主键
|
| | | private String companyId;
|
| | | private String deviceCompanyId;
|
| | | // 设备地点
|
| | | private String deviceName;
|
| | | // 设备授权码
|
| | |
| | | /**
|
| | | * Get 公司主键
|
| | | */
|
| | | public String getCompanyId() {
|
| | | return companyId;
|
| | | public String getDeviceCompanyId() {
|
| | | return deviceCompanyId;
|
| | | }
|
| | |
|
| | | /**
|
| | | * Set 公司主键
|
| | | */
|
| | | public void setCompanyId(String companyId) {
|
| | | this.companyId = companyId;
|
| | | public void setDeviceCompanyId(String deviceCompanyId) {
|
| | | this.deviceCompanyId = deviceCompanyId;
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | |
|
| | | public String toString() {
|
| | | return
|
| | | ",设备主键 =" + deviceId + ",公司主键 =" + companyId + ",设备地点 =" + deviceName + |
| | | ",设备主键 =" + deviceId + ",公司主键 =" + deviceCompanyId + ",设备地点 =" + deviceName +
|
| | | ",设备授权码 ="+ authorizationId;
|
| | | }
|
| | | }
|
| | |
| | | public void findCheckInLeftList(final boolean isVisitorList, final boolean isSortByDept, String searchText, final int pageNum, final boolean append) {
|
| | | RequestParams params = new RequestParams(AppApi.BASE_URL +AppApi.Query.CHECK_IN_QUERY);
|
| | | if (isVisitorList) {
|
| | | params.addBodyParameter(CheckInQueryCondition.FieldNames.visitorCompanyId, BaseApplication.getInstance().getDevice().getCompanyId());
|
| | | params.addBodyParameter(CheckInQueryCondition.FieldNames.visitorCompanyId, BaseApplication.getInstance().getDevice().getDeviceCompanyId());
|
| | | } else {
|
| | | params.addBodyParameter(CheckInQueryCondition.FieldNames.employeeCompanyId, BaseApplication.getInstance().getDevice().getCompanyId());
|
| | | params.addBodyParameter(CheckInQueryCondition.FieldNames.employeeCompanyId, BaseApplication.getInstance().getDevice().getDeviceCompanyId());
|
| | | }
|
| | | params.addBodyParameter(CheckInQueryCondition.FieldNames.username, searchText);
|
| | | params.addBodyParameter(CommonVariables.Page.PAGE_NUM, pageNum+"");
|
| | |
| | | return instance;
|
| | | }
|
| | |
|
| | | public void findPlace() {
|
| | | public void findDevice() {
|
| | | try {
|
| | | RequestParams params = new RequestParams(AppApi.BASE_URL + AppApi.Query.DEVICE_QUERY);
|
| | | params.addBodyParameter(Device.FieldNames.authorizationId, authorationId);
|
| | |
| | | public void addBitmap(final List<Bitmap> bitmapList, byte[] byteArray, int len) {
|
| | | RequestParams params = new RequestParams(AppApi.BASE_URL +AppApi.SURVEILLANCE_UPLOAD);
|
| | | params.addBodyParameter("base64Photo", Base64.encodeToString(byteArray, 0, len, Base64.DEFAULT));
|
| | | params.addBodyParameter("deviceCompanyId", BaseApplication.getInstance().getDevice().getCompanyId());
|
| | | params.addBodyParameter("deviceCompanyId", BaseApplication.getInstance().getDevice().getDeviceCompanyId());
|
| | | params.addBodyParameter("deviceId", BaseApplication.getInstance().getDevice().getDeviceId());
|
| | | params.addBodyParameter("enterOrExit", CommonVariables.EnterOrExit.ENTER+"");
|
| | | x.http().post(params, new BaseCommonCallBack() {
|