Commit 9a530a5b by Lee Munkyeong

無駄なアップデート防止IF追加。

parent 4729e02e
...@@ -123,7 +123,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -123,7 +123,7 @@ public class OperationLogic extends AbstractLogic {
List<OperationDto> serverOperations = json.operationList; List<OperationDto> serverOperations = json.operationList;
//サーバーからチャットプシュデータを取得 //サーバーからチャットプシュデータを取得
if (ABVDataCache.getInstance().serviceOption.isChat()) { /*if (ABVDataCache.getInstance().serviceOption.isChat()) {
ChatPushDataJSON chatPushJson = AcmsClient.getInstance(cache.getUrlPath(), networkAdapter).getChatPushList(param); ChatPushDataJSON chatPushJson = AcmsClient.getInstance(cache.getUrlPath(), networkAdapter).getChatPushList(param);
for ( PushMessageDto dto : chatPushJson.pushMessageList) { for ( PushMessageDto dto : chatPushJson.pushMessageList) {
PushMessageDto dtoTemp = mPushMessageDao.selectChat(dto.pushMessageId, dto.operationId, dto.pushSendDate); PushMessageDto dtoTemp = mPushMessageDao.selectChat(dto.pushMessageId, dto.operationId, dto.pushSendDate);
...@@ -131,7 +131,7 @@ public class OperationLogic extends AbstractLogic { ...@@ -131,7 +131,7 @@ public class OperationLogic extends AbstractLogic {
mPushMessageDao.insert(dto); mPushMessageDao.insert(dto);
} }
} }
} }*/
......
...@@ -369,13 +369,21 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -369,13 +369,21 @@ public class OperationListActivity extends ABVUIActivity {
break; break;
} }
final OperationDto tempOperationDto = mOperationDao.getOperationJoinContent(jsonParam.getInt(ABookKeys.OPERATION_ID)); final OperationDto tempOperationDto = mOperationDao.getOperationJoinContent(jsonParam.getInt(ABookKeys.OPERATION_ID));
runOnUiThread(new Runnable() { if (tempOperationDto.needSyncFlg) {
@Override runOnUiThread(new Runnable() {
public void run() { @Override
startSyncOperation(tempOperationDto); public void run() {
} startSyncOperation(tempOperationDto, new Runnable() {
}); @Override
openReportView(tempOperationDto); public void run() {
openReportView(tempOperationDto);
}
});
}
});
} else {
openReportView(tempOperationDto);
}
break; break;
case ABookKeys.CMD_KEY.GO_COMMUNICATION: case ABookKeys.CMD_KEY.GO_COMMUNICATION:
...@@ -384,13 +392,21 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -384,13 +392,21 @@ public class OperationListActivity extends ABVUIActivity {
case ABookKeys.CMD_KEY.GO_PANORAMA_EDIT: case ABookKeys.CMD_KEY.GO_PANORAMA_EDIT:
final OperationDto panoramaOperationDto = mOperationDao.getOperationJoinContent(jsonParam.getInt(ABookKeys.OPERATION_ID)); final OperationDto panoramaOperationDto = mOperationDao.getOperationJoinContent(jsonParam.getInt(ABookKeys.OPERATION_ID));
runOnUiThread(new Runnable() { if (panoramaOperationDto.needSyncFlg) {
@Override runOnUiThread(new Runnable() {
public void run() { @Override
startSyncOperation(panoramaOperationDto); public void run() {
} startSyncOperation(panoramaOperationDto, new Runnable() {
}); @Override
startTaskDirectionOrReportView(panoramaOperationDto); public void run() {
startTaskDirectionOrReportView(panoramaOperationDto);
}
});
}
});
} else {
startTaskDirectionOrReportView(panoramaOperationDto);
}
break; break;
case ABookKeys.CMD_KEY.REFRESH_CONTENT: case ABookKeys.CMD_KEY.REFRESH_CONTENT:
...@@ -1387,7 +1403,7 @@ public class OperationListActivity extends ABVUIActivity { ...@@ -1387,7 +1403,7 @@ public class OperationListActivity extends ABVUIActivity {
* 同期処理 * 同期処理
* @param operationDto * @param operationDto
*/ */
public void startSyncOperation(final OperationDto operationDto) { public void startSyncOperation(final OperationDto operationDto, final Runnable callback) {
//ネットワークチェック //ネットワークチェック
if (!ABVEnvironment.getInstance().networkAdapter.isNetworkConnected()) { if (!ABVEnvironment.getInstance().networkAdapter.isNetworkConnected()) {
ABVToastUtil.showMakeText(OperationListActivity.this, R.string.request_network_connection, Toast.LENGTH_SHORT); ABVToastUtil.showMakeText(OperationListActivity.this, R.string.request_network_connection, Toast.LENGTH_SHORT);
......
...@@ -167,7 +167,7 @@ public abstract class OperationListHelper { ...@@ -167,7 +167,7 @@ public abstract class OperationListHelper {
@Override @Override
public void onSyncOperation(final OperationDto operationDto) { public void onSyncOperation(final OperationDto operationDto) {
// 同期処理 // 同期処理
mAppActivity.startSyncOperation(operationDto); mAppActivity.startSyncOperation(operationDto, null);
} }
}); });
...@@ -235,7 +235,7 @@ public abstract class OperationListHelper { ...@@ -235,7 +235,7 @@ public abstract class OperationListHelper {
@Override @Override
public void onSyncOperation(final OperationDto operationDto) { public void onSyncOperation(final OperationDto operationDto) {
// 同期処理 // 同期処理
mAppActivity.startSyncOperation(operationDto); mAppActivity.startSyncOperation(operationDto, null);
} }
}); });
......
...@@ -25,6 +25,7 @@ import android.widget.RelativeLayout; ...@@ -25,6 +25,7 @@ import android.widget.RelativeLayout;
import android.widget.Toast; import android.widget.Toast;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List;
import jp.agentec.abook.abv.bl.acms.client.json.content.ContentJSON; import jp.agentec.abook.abv.bl.acms.client.json.content.ContentJSON;
import jp.agentec.abook.abv.bl.acms.type.AcmsApis; import jp.agentec.abook.abv.bl.acms.type.AcmsApis;
...@@ -40,6 +41,8 @@ import jp.agentec.abook.abv.bl.data.dao.OperationDao; ...@@ -40,6 +41,8 @@ import jp.agentec.abook.abv.bl.data.dao.OperationDao;
import jp.agentec.abook.abv.bl.download.ContentDownloader; import jp.agentec.abook.abv.bl.download.ContentDownloader;
import jp.agentec.abook.abv.bl.download.ContentZipDownloadNotification; import jp.agentec.abook.abv.bl.download.ContentZipDownloadNotification;
import jp.agentec.abook.abv.bl.dto.OperationDto; import jp.agentec.abook.abv.bl.dto.OperationDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.OperationLogic;
import jp.agentec.abook.abv.cl.util.ContentLogUtil; import jp.agentec.abook.abv.cl.util.ContentLogUtil;
import jp.agentec.abook.abv.launcher.android.R; import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType; import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
...@@ -72,6 +75,8 @@ public class HTMLWebViewActivity extends ParentWebViewActivity { ...@@ -72,6 +75,8 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
private JsInf jsInf = new JsInf(); private JsInf jsInf = new JsInf();
private ValueCallback<Uri[]> mUploadMessage; private ValueCallback<Uri[]> mUploadMessage;
private OperationLogic mOperationLogic = AbstractLogic.getLogic(OperationLogic.class);
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
Logger.i(TAG, "onCreate"); Logger.i(TAG, "onCreate");
...@@ -487,6 +492,15 @@ public class HTMLWebViewActivity extends ParentWebViewActivity { ...@@ -487,6 +492,15 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
finishActivity(); // 開いてる画面を閉じる finishActivity(); // 開いてる画面を閉じる
} }
} }
@JavascriptInterface
public String getOperation() {
ArrayList<OperationDto> operationDtos = new ArrayList<OperationDto>();
OperationDto opertaionDto = mOperationLogic.getOperation(mOperationId);
operationDtos.add(opertaionDto);
String operationJson = mOperationLogic.createOperationListJson(operationDtos, null);
return operationJson;
}
} }
@Override @Override
......
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