Commit 0b758ac4 by Kazuyuki Hida

ロック、アンロックに起因する不具合を修正。

parent f90a556d
......@@ -20,7 +20,8 @@ import org.json.adf.JSONObject;
public class AcmsCommonJSON extends AcmsJSONParser {
public static final String HttpStatus = "httpStatus";
public static final String PresentTime = "presentTime";
public static final String PresentTimeUTC = "presentTimeUTC";
public int httpStatus; // ACMSが返したHTTP statusコード
public Date presentTime;// サーバーの現在時刻を取得します。サーバーの時間取得において、何らかの問題があった場合、nullを返します。
......
......@@ -14,6 +14,7 @@ import org.json.adf.JSONException;
import org.json.adf.JSONObject;
import java.util.Date;
import java.util.Locale;
public abstract class AcmsJSONParser extends CloneableObject {
/**
......@@ -165,6 +166,14 @@ public abstract class AcmsJSONParser extends CloneableObject {
}
}
protected Integer getIntOrNull(JSONObject json, String key) {
if (json.has(key)) {
return json.getInt(key);
} else {
return null;
}
}
protected String getStringOrNull(JSONObject json, String key) {
if (json.has(key)) {
return json.getString(key);
......@@ -175,7 +184,7 @@ public abstract class AcmsJSONParser extends CloneableObject {
protected Date getDateOrNull(JSONObject json, String key) {
if (json.has(key)) {
return DateTimeUtil.toDate(json.getString(key), "UTC", DateTimeFormat.yyyyMMdd_hyphen);
return DateTimeUtil.toDate(json.getString(key), Locale.getDefault().getLanguage(), DateTimeFormat.yyyyMMddHHmmss_hyphen);
} else {
return null;
}
......
......@@ -7,9 +7,10 @@ import java.util.Date;
import jp.agentec.abook.abv.bl.common.exception.AcmsException;
import jp.agentec.abook.abv.bl.common.exception.JSONValidationException;
import static jp.agentec.abook.abv.bl.acms.client.json.OperationDataJSON.ReportStatus;
public class UnlockReportJSON extends AcmsCommonJSON {
public static final int BAD_STATE = 999;
private Date presentTimeUTC;
private int reportStatus;
......@@ -20,8 +21,8 @@ public class UnlockReportJSON extends AcmsCommonJSON {
@Override
protected void parse(JSONObject json) throws JSONValidationException {
super.parse(json);
presentTimeUTC = getDateOrNull(json, "presentTimeUTC");
reportStatus = getIntOrDef(json, "", BAD_STATE);
presentTimeUTC = getDateOrNull(json, PresentTimeUTC);
reportStatus = getIntOrZero(json, ReportStatus);
}
@SuppressWarnings("unused")
......@@ -40,5 +41,5 @@ public class UnlockReportJSON extends AcmsCommonJSON {
}
@SuppressWarnings("unused")
public int getReportStatus() {return reportStatus; }
public Integer getReportStatus() {return reportStatus; }
}
......@@ -194,7 +194,7 @@ public class ReportStatusDao extends AbstractDao {
return null;
} else {
String date = cursor.getString(column);
return DateTimeUtil.toDate(date, "UTC", DateTimeFormat.yyyyMMdd_hyphen);
return DateTimeUtil.toDate(date, "UTC", DateTimeFormat.yyyyMMddHHmmss_hyphen);
}
}
......
......@@ -202,13 +202,13 @@ public class LockReportLogic extends AbstractLogic {
extParam.put(ReportStatus, String.valueOf(reportStatus));
extParam.put(ReportLockUserId, reportLockUserId);
extParam.put(ReportLockUserName, reportLockUserName);
extParam.put(ReportLockTime, DateTimeUtil.toString(reportLockTime, DateTimeFormat.yyyyMMddHHmmssSSS_hyphen));
extParam.put(ReportLockTime, DateTimeUtil.toStringInTimeZone(reportLockTime, DateTimeFormat.yyyyMMddHHmmssSSS_hyphen, "UTC"));
if (taskReportId != null && taskReportId != 0) {
extParam.put(TaskReportId, taskReportId);
}
if (reportStartDate != null) {
extParam.put(ReportStartDate, DateTimeUtil.toString(reportStartDate, DateTimeFormat.yyyyMMddHHmmssSSS_hyphen));
extParam.put(ReportStartDate, DateTimeUtil.toStringInTimeZone(reportStartDate, DateTimeFormat.yyyyMMddHHmmssSSS_hyphen, "UTC"));
}
return extParam.toString();
}
......
......@@ -150,7 +150,7 @@ public class UnlockReportLogic extends AbstractLogic {
extParam.put(TaskReportId, taskReportId);
}
if (reportStartDate != null) {
extParam.put(ReportStartDate, DateTimeUtil.toString(reportStartDate, DateTimeFormat.yyyyMMddHHmmssSSS_hyphen));
extParam.put(ReportStartDate, DateTimeUtil.toStringInTimeZone(reportStartDate, DateTimeFormat.yyyyMMddHHmmssSSS_hyphen, "UTC"));
}
return extParam.toString();
}
......
......@@ -34,6 +34,7 @@ import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
......@@ -1092,7 +1093,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
getDeviceInfo(abookCheckParam);
} else if (mCmd.equals(ABookKeys.CMD_LOCK_REPORT)) {
String taskKey = abookCheckParam.get(TaskKey);
Date startDate = DateTimeUtil.toDate(reportStartDate, "UTC", DateTimeFormat.yyyyMMdd_hyphen);
Date startDate = dateOrNull(abookCheckParam.get("reportStartDate"));
// ロック
LockReportLogic.Result r = LockReportLogic.newInstance().lock(taskKey, taskReportId, startDate);
// JSコールバック
......@@ -1359,7 +1360,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
private Date dateOrNull(String s) {
try {
return DateTimeUtil.toDate(s, "UTC", DateTimeFormat.yyyyMMdd_hyphen);
return DateTimeUtil.toDate(s, "UTC", DateTimeFormat.yyyyMMddHHmmss_hyphen);
} catch (Exception e) {
return null;
}
......
......@@ -505,7 +505,7 @@ public class DashboardActivity extends OperationActivity {
private Date getDateOrNull(String s) {
try {
return DateTimeUtil.toDate(s, "UTC", DateTimeFormat.yyyyMMdd_hyphen);
return DateTimeUtil.toDate(s, "UTC", DateTimeFormat.yyyyMMddHHmmss_hyphen);
} catch (Exception e) {
Logger.e(TAG, e.getLocalizedMessage());
return null;
......
......@@ -41,6 +41,8 @@ acms_address=https://check.abookcloud.com/acms
download_server_address=https://check.abookcloud.com/acms
#acms_address=https://abook188-1.abook.bz/acms
#download_server_address=https://abook188-1.abook.bz/acms
#acms_address=http://10.0.2.2:8080/acms
#download_server_address=http://10.0.2.2:8080/acms
#syncview server
websocket_server_http_url=https://abook188-1.abook.bz/v1
......@@ -95,6 +97,8 @@ contact_email=grp-atform_support@sato-global.com
#Log Settings
log_level=2
#log_level=1
default_log_name=abvje
#エラーレポート/Exportログ送信方法 1:acms 2:平文メール(開発・テスト時のみ) 3:暗号化添付メール
error_report_flg=1
......@@ -128,4 +132,4 @@ BLJAR_NAME=ABVJE_BL.jar
#store用の場合、armv7,x86両方ビルド
#storeではない場合、armv7のみビルド
isStoreProduct=false
\ No newline at end of file
isStoreProduct=true
\ No newline at end of file
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