Commit 76af564a by Kazuyuki Hida

dashboardのActivityを開くところまではできた。JavaScriptとのインターフェースは手つかず

parent e272fadf
......@@ -19,6 +19,7 @@ import jp.agentec.abook.abv.bl.acms.client.json.AuthLevelJSON;
import jp.agentec.abook.abv.bl.acms.client.json.CategoriesJSON;
import jp.agentec.abook.abv.bl.acms.client.json.ContentCheckDeliverableJSON;
import jp.agentec.abook.abv.bl.acms.client.json.ContentVersionsJSON;
import jp.agentec.abook.abv.bl.acms.client.json.DashboardStatusJSON;
import jp.agentec.abook.abv.bl.acms.client.json.GroupsJSON;
import jp.agentec.abook.abv.bl.acms.client.json.LockReportJSON;
import jp.agentec.abook.abv.bl.acms.client.json.LogSendFlagJSON;
......@@ -735,6 +736,12 @@ public class AcmsClient implements AcmsClientResponseListener {
return new UnlockReportJSON(json);
}
public DashboardStatusJSON getDashboardStatus(AcmsParameters sid) throws NetworkDisconnectedException, AcmsException {
HttpResponse response = send(AcmsApis.ApiGetDashboardStatus, sid);
String json = response.httpResponseBody;
return new DashboardStatusJSON(json);
}
/**********************************************************************************************/
/** 以下、共用メソッド---------------------------------------------------------------------- **/
/**********************************************************************************************/
......@@ -940,7 +947,8 @@ public class AcmsClient implements AcmsClientResponseListener {
AcmsApis.ApiGetPushMessages,
AcmsApis.ApiSendPushMessage,
AcmsApis.ApiLockReport,
AcmsApis.ApiUnlockReport
AcmsApis.ApiUnlockReport,
AcmsApis.ApiGetDashboardStatus
};
public HttpTaskWorker(String methodName, String apiUrl, T param) {
......
package jp.agentec.abook.abv.bl.acms.client.json;
import org.json.adf.JSONArray;
import org.json.adf.JSONObject;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import jp.agentec.abook.abv.bl.common.exception.AcmsException;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.dto.ReportStatusDto;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
public class DashboardStatusJSON extends AcmsCommonJSON {
private static final String TAG = "DashboardStatusJSON";
private List<ReportStatusDto> reportStatuses = new ArrayList<ReportStatusDto>();
public DashboardStatusJSON(String jsonString) throws AcmsException {
super(jsonString);
}
@Override
protected void parse(JSONObject json) {
// 使わないので無視 //presentTimeUTC = dateOrNull(json.getString("presentTimeUTC"));
JSONArray oprations = json.getJSONArray("operationList");
for (int i = 0; i < oprations.length(); i++) {
JSONObject opJson = oprations.getJSONObject(i);
try {
Long operationId = longOrNull(opJson.getString("operationId"));
String operationName = opJson.getString("operationName");
JSONArray reports = opJson.getJSONArray("reportList");
for (int j = 0; j < reports.length(); j++) {
JSONObject repJson = reports.getJSONObject(j);
String taskKey = repJson.getString("taskKey");
Long taskReportId = longOrNull(repJson.getString("taskReportId"));
Date reportStartDate = dateOrNull(repJson.getString("reportStartDate"));
int reportStatus = repJson.getInt("reportStatus");
ReportStatusDto rep = new ReportStatusDto(
taskKey, taskReportId, reportStartDate,
operationId, operationName, reportStatus
);
reportStatuses.add(rep);
}
} catch (Throwable e) {
Logger.e(TAG, e);
}
}
}
public List<ReportStatusDto> getReportStatuses() {
return reportStatuses;
}
private Long longOrNull(String s) {
try {
return Long.valueOf(s);
} catch (Exception e) {
return null;
}
}
private Date dateOrNull(String s) {
try {
return DateTimeUtil.toDate(s, "UTC", DateTimeFormat.yyyyMMdd_hyphen);
} catch (Exception e) {
return null;
}
}
}
......@@ -164,6 +164,8 @@ public class AcmsApis {
public static final String ApiLockReport = "lockReport";
// 報告・点検のロック解除
public static final String ApiUnlockReport = "unlockReport";
// ダッシュボード
public static final String ApiGetDashboardStatus = "getDashboardStatus";
// download
/**
......
package jp.agentec.abook.abv.bl.common.constant;
/**
* Created by leemk on 2021/03/03.
*/
public interface ABookCommConstants {
String TAG = "ABookComm";
//AbookComm専用の共通インターフェース
interface KEY {
String CHAT_ROOM_ID = "chatRoomId";
String CHAT_ROOM_NAME = "chatRoomName";
String TYPE = "type";
String FAVORITE_REGISTER_DATE = "favoriteRegisterDate";
String UNREAD_COUNT = "unreadCount";
String MESSAGE = "message";
String MESSAGE_TYPE = "messageType";
String INSERT_DATE = "insertDate";
String USER_COUNT = "userCount";
String LOGIN_ID = "loginId";
String PROFILE_IMAGE_PATH = "profileImagePath";
String SELF_FLG = "selfFlg";
String SHOP_MEMBER_NAME = "shopMemberName";
String SHOP_MEMBER_ID = "shopMemberId";
String PROFILE_URL = "profileUrl";
String GROUP_NAME = "groupName";
String GROUP_ID = "groupId";
String GROUP_PATH = "groupPath";
String GROUP_IDS = "groupIds";
String GROUP_PATH_LIST = "groupPathList";
String IS_FAVORITE = "isFavorite";
String CHILD_GROUP_LIST = "childGroupList";
String GROUP_USER_LIST = "groupUserList";
String BODY = "body";
String CHECKED = "checked";
String CHAT_ROOM_INFO = "chatRoomInfo";
String ROOM_ID = "roomId";
String ROOM_NAME = "roomName";
String ATTEND_USERS = "attendUsers";
String MEMBER_NAME = "memberName";
String DEL_FLG = "delFlg";
String ROOM_TYPE = "roomType";
String GROUP_ID_LIST = "groupIdList";
String MESSAGE_INFO_LIST = "messageInfoList";
String MESSAGE_ID = "messageId";
String SHOP_ID = "shopId";
String TIME = "time";
String GROUP_INFO_LIST = "groupInfoList";
String PARENT_GROUP_ID = "parentGroupId";
String GROUP_MEMBER_LIST = "groupMemberList";
String CHAT_ROOM_INFO_LIST = "chatRoomInfoList";
String LAST_MESSAGE_INFO = "lastMessageInfo";
String FAVORITE_USER_IDS = "favoriteUserIds";
String FAVORITE_GROUP_IDS = "favoriteGroupIds";
String LAST_REQUEST_DATE = "lastRequestDate";
String ARCHIVE_INFO_LIST = "archiveInfoList";
String ARCHIVE_INFO = "archiveInfo";
String ARCHIVE_ID = "archiveId";
String ARCHIVE_NAME = "archiveName";
String ARCHIVE_DATE = "archiveDate";
String ARCHIVE_TYPE = "archiveType";
String SAVE_USER_ID = "saveUserId";
String FILE_PATH = "filePath";
String ATTEND_USER_IDS = "attendUserIds";
String ARCHIVE_INFO_LAST_UPDATE_DATE = "archiveInfoLastUpdateDate";
String CONTENT_ID = "contentId";
String CONTENT_NAEM = "contentName";
String THUMBNAIL_NORMAL_PATH = "thumbnailNormalPath";
String THUMBNAIL_BIG_PATH = "thumbnailBigPath";
String RESOURCE_PATH = "resourcePath";
String COLLABORATION_DEATAIL_ID = "collaborationDetailId";
String MY_SHOPE_MEMBER_ID = "myShopMemberId";
String ROOT_GROUP_ID = "rootGroupId";
String GROUP_MEMBER_UPDATED_DATE = "groupMemberUpdatedDate";
String MESSAGE_UPDATED_DATE = "MessageUpdatedDate";
String ARCHIVE_UPDATED_DATE = "ArchiveUpdatedDate";
String HTTP_STATUS = "httpStatus";
interface API_KIND {
String USER = "user";
String ROOM = "room";
String GROUP = "group";
String CHAT = "chat";
String FILE = "file";
String COLLABORATION = "collaboration";
}
String SHOP_NAME = "shopName";
String LANGUAGE_CODE = "languageCode";
String SID = "sid";
String ROOM_ID_UPPERCASE_D = "roomID";
String CHAT_URL = "chatURL";
String CMS_URL = "cmsURL";
String IS_ONLINE = "isOnline";
String IS_MOBILE = "isMobile";
String PLATFORM = "platform";
String COLLABORATION_TYPE = "collaborationType";
}
interface FLAG {
interface SCREEN_FLG {
Integer NAME_CARD = 0;
Integer MAKE_ROOM = 1;
}
interface SELF_FLAG {
Integer OFF = 0;
Integer ON = 1;
}
interface DEL_FLAG {
Integer EXIST = 0;
Integer DELETE = 1;
}
interface ROOM_TYPE {
Integer GROUP = 0;
Integer DM = 1;
Integer ALL = 2;
}
interface MESSAGE_TYPE {
Integer TEXT = 0;
Integer PHOTO = 1;
Integer VIDEO = 2;
Integer SYSTEM = 3;
Integer COLLABORATION_START = 4;
Integer COLLABORATION_END = 5;
}
interface COLLABORATION_TYPE {
Integer AUDIO = 0;
Integer CAMERA = 2;
Integer VIDEO = 3;
Integer DOCUMENT = 4;
Integer BOARD = 5;
}
interface COLLABORATION_JOIN_FLG {
Integer CREATE = 0;
Integer JOIN = 1;
Integer INVITE = 2;
}
interface ROOM_VIEW_FLAG {
Integer VISIBLE = 0;
Integer INVISIBLE = 1;
}
Integer GROUP_REQUEST_ALL = 0;
}
interface SIZE {
Integer MAX_FAVORITE_COUNT = 100;
Integer MESSAGE_PAGING_SIZE = 100;
}
interface COLLABORATION {
interface INVITE_COLLABORATION {
String EN = "inviteCollaboration";
String JP = "\u5354\u696d";
String KR = "\ud611\uc5c5";
}
interface COLLABORATION_AUDIO {
String EN = "audio collaboration";
String JP = "通話協業";
String KR = "통화협업";
}
interface COLLABORATION_CAMERA {
String EN = "image collaboration";
String JP = "写真協業";
String KR = "사진협업";
}
interface COLLABORATION_VIDEO {
String EN = "video collaboration";
String JP = "動画協業";
String KR = "영상협업";
}
interface COLLABORATION_DOCUMENT {
String EN = "document collaboration";
String JP = "文書協業";
String KR = "문서협업";
}
interface COLLABORATION_BOARD {
String EN = "board collaboration";
String JP = "ボード協業";
String KR = "보드협업";
}
}
String FILE_SAVE_PATH = "/data/user/0/jp.co.agentec.abookplus.check/files/";
String NETWORK_ERROR_PLACE_HOLDER = "file:///android_asset/chat/public_new/chat.html";
String CHAT_PAGE_URL = "file:///android_asset/chat/public_new/chat.html";
String CHAT_ROOM_PAGE_URL = "file:///android_asset/chat/public_new/chat_room.html";
String ARCHIVE_URL = "file:///android_asset/chat/public_new/archive.html";
String ARCHIVE_DETAIL_URL = "file:///android_asset/chat/public_new/archive_detail.html";
String CONTACT_URL = "file:///android_asset/chat/public_new/contact.html";
String COLLABORATION_PAGE_URL = "file:///android_asset/chat/public_new/collaboration.html";
String DEFAULT_CHECKSUM = "0000000000";
String PLATFORM_NAME = "android";
String CHAT_MESSAGE_SEPERATOR = "<::split>";
String DASHBOARD_URL = "file:///android_asset/dashboard/app/index.html";
int PUSH_MESSAGE_DLG_REQUEST_CODE = 200;
interface PUSH_MESSAGE_DLG_RESULT {
int OK = 0;
int CANCEL = 1;
}
// ABookCheckで、onActivityResultのリクエストコードとして使用されている
int ABOOK_CHECK_TASK_IMAGE = 103;
int ABOOK_CHECK_TASK_VIDEO = 104;
int ABOOK_CHECK_SELECT_SCENE = 105;
}
package jp.agentec.abook.abv.bl.data.dao;
public class ReportStatusDao {
}
package jp.agentec.abook.abv.bl.dto;
import java.util.Date;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
public class ReportStatusDto extends AbstractDto {
private static final int FLG_UNTOUCHED = 0x01; // 未実施(0x01)
private static final int FLG_WORKING = 0x02; // 作業中(0x02)
private static final int FLG_COMPLETE_OK = 0x04; // 作業完了 異常なし(0x04)
private static final int FLG_COMPLETE_NG = 0x08; // 作業完了 異常あり(0x08)
private static final int FLD_INCOMPLETED = 0x10; // 期限切れ(0x10)
private static final int FLG_ALERT = 0x20; // アラート(0x20)
private static final int FLG_SEND_BACK = 0x40; // 差し戻し(0x40)
public static int UNTOUCHED = 0; // 0:未実施
public static int WORKING = 1; // 1:作業中
public static int COMPLETE_OK = 2; // 2:作業完了(異常なし)
public static int COMPLETE_NG = 3; // 3:作業完了(異常あり)
public static int INCOMPLETED = 4; // 4:期限切れ
public static int ALERT = 5; // 5:アラート
public static int SEND_BACKED = 6; // 6:差し戻し
public static int IN_PROGRESS = 7; // 7:一時保存
// taskReportを一意にさすためのキー
private String taskKey;
private Long taskReportId;
private Date reportStartDate;
// 一覧表示で必要な付加情報
private long operationId;
private String operatonName;
// taskの状態を示すビットフィールド
private int reportStatus;
// reportStatusの各ビットに対応するフラグ
private boolean untouchedFlg;
private boolean workingFlg;
private boolean completeOkFlg;
private boolean completeNgFlg;
private boolean incompleteFlg;
private boolean alertFlg;
private boolean sendBackedFlg;
public ReportStatusDto(
String taskKey,
Long taskReportId,
Date reportStartDate,
Long operationId,
String operatonName,
int reportStatus
) {
this.taskKey = taskKey;
this.taskReportId = taskReportId;
this.reportStartDate = reportStartDate;
this.operationId = operationId;
this.operatonName = operatonName;
this.reportStatus = reportStatus;
untouchedFlg = (reportStatus & FLG_UNTOUCHED) != 0;
workingFlg = (reportStatus & FLG_WORKING) != 0;
completeOkFlg = (reportStatus & FLG_COMPLETE_OK) != 0;
completeNgFlg = (reportStatus & FLG_COMPLETE_NG) != 0;
incompleteFlg = (reportStatus & FLD_INCOMPLETED) != 0;
alertFlg = (reportStatus & FLG_ALERT) != 0;
sendBackedFlg = (reportStatus & FLG_SEND_BACK) != 0;
}
@Override
public String[] getKeyValues() {
return new String[] {
String.valueOf(taskKey),
String.valueOf(taskReportId),
DateTimeUtil.toString(reportStartDate, DateTimeFormat.yyyyMMdd_hyphen)
};
}
@Override
public Object[] getInsertValues() {
return new Object[] {
taskKey,
taskReportId,
reportStartDate,
operationId,
operatonName,
reportStatus,
untouchedFlg, // 未実施(0x01)
workingFlg, // 作業中(0x02)
completeOkFlg, // 作業完了 異常なし(0x04)
completeNgFlg, // 作業完了 異常あり(0x08)
incompleteFlg, // 期限切れ(0x10)
alertFlg, // アラート(0x20)
sendBackedFlg // 差し戻し(0x40)
};
}
}
package jp.agentec.abook.abv.bl.logic;
public class ReportStatusLogic extends AbstractLogic {
}
Subproject commit 7d25fb63ff923961a2c99c9cac3c41ce81eec6f7
Subproject commit 1814792895150146df8e38612247fc6f5c2ce69d
......@@ -19,10 +19,11 @@ import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.viewer.view.CheckFormWebview;
import static jp.agentec.abook.abv.bl.common.constant.ABookCommConstants.DASHBOARD_URL;
public class DashboardActivity extends OperationActivity {
private static final String TAG = "DashboardActivity";
private WebView webView;
private String url = "https://abook188-1.abook.bz/acms/asp/login/";
private ProgressBar progress;
@Override
......@@ -36,7 +37,7 @@ public class DashboardActivity extends OperationActivity {
@Override
public void onClick(View v) {
Logger.d(TAG, "ReloadUrl");
webView.loadUrl(url + "&reload=true");
webView.loadUrl(DASHBOARD_URL + "&reload=true");
}
});
......@@ -47,7 +48,7 @@ public class DashboardActivity extends OperationActivity {
frameLayout.addView(webView, new LinearLayout.LayoutParams(FP, FP));
// 読み込み
webView.loadUrl(url);
webView.loadUrl(DASHBOARD_URL);
}
@Override
......@@ -90,7 +91,7 @@ public class DashboardActivity extends OperationActivity {
webView.setWebViewClient(new WebViewClient());
// webView.addJavascriptInterface(jsInf, "android");
Logger.d(TAG, "loadUrl: " + url);
Logger.d(TAG, "loadUrl: " + DASHBOARD_URL);
}
@SuppressLint("SetJavaScriptEnabled")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment