Commit 0b758ac4 by Kazuyuki Hida

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

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