Commit 36fb0eed by Lee Munkyeong

作業一覧対応

parent 1dd4363b
......@@ -81,6 +81,19 @@ public class ABookKeys {
public static final String ATTACHED_CHANGE_FLAG = "attachedChangeFlag";
public static final String ROUTINE_TASK_FLAG = "routineTaskFlag";
public static final String UPDATE_HOTSPOT_ONLY_FLAG = "updateHotSpotOnlyFlag";
//Webviewから呼び出すApiキー
public static final class CMD_KEY{
public static final String GO_SETTING = "goSetting";
public static final String GO_RELATION_CONTENT = "goRelationContent";
public static final String GO_PRINT_TARGET = "goPrintTarget";
public static final String GO_OPERATION = "goOperation";
public static final String GO_COMMUNICATION = "goCommunication";
public static final String GO_PANORAMA_EDIT = "goPanoramaEdit";
public static final String REFRESH_CONTENT = "refreshContent";
}
// #32782 指示者テーブル関連削除 start
// TODO change TASK_DIRECTIONS 削除が必要
// public static final String TASK_DIRECTIONS = "taskReport";
......
......@@ -1999,8 +1999,7 @@ public class OperationLogic extends AbstractLogic {
return isSuccess;
}
public void createOperationListJson(String filePath) {
List<OperationDto> operationList = getRefreshOperation(null, null, null, null);
public String createOperationListJson(List<OperationDto> operationList, String filePath) {
JSONObject operationListJsonObject = new JSONObject();
try {
JSONArray operationJsonArray = new JSONArray();
......@@ -2011,7 +2010,7 @@ public class OperationLogic extends AbstractLogic {
operationJson.put(ABookKeys.OPERATION_DESCRIPTIONS, operationList.get(i).operationDescriptions);
operationJson.put(ABookKeys.OPERATION_TYPE, operationList.get(i).operationType);
operationJson.put(ABookKeys.OPERATION_START_DATE, DateTimeUtil.toString(operationList.get(i).operationStartDate, DateTimeFormat.yyyyMMdd_slash));
operationJson.put(ABookKeys.OPERATION_END_DATE, DateTimeUtil.toString(operationList.get(i).operationStartDate, DateTimeFormat.yyyyMMdd_slash));
operationJson.put(ABookKeys.OPERATION_END_DATE, DateTimeUtil.toString(operationList.get(i).operationEndDate, DateTimeFormat.yyyyMMdd_slash));
operationJson.put(ABookKeys.LAST_EDIT_DATE, operationList.get(i).lastEditDate);
operationJson.put(ABookKeys.NEED_SYNC_FLG, operationList.get(i).needSyncFlg);
operationJson.put(ABookKeys.REPORT_TYPE, operationList.get(i).reportType);
......@@ -2024,11 +2023,13 @@ public class OperationLogic extends AbstractLogic {
operationJsonArray.put(operationJson);
}
operationListJsonObject.put(ABookKeys.OPERATION_LIST, operationJsonArray);
FileUtil.createFile(filePath + "/operationList.json", operationListJsonObject.toString());
if (!StringUtil.isNullOrEmpty(filePath)) {
FileUtil.createFile(filePath + "/operationList.json", operationListJsonObject.toString());
}
} catch (Exception e) {
e.printStackTrace();
}
return operationListJsonObject.toString();
}
}
......@@ -350,25 +350,25 @@ public class OperationListActivity extends ABVUIActivity {
public void sendParam(String param) {
JSONObject jsonParam = new JSONObject(param);
OperationDto operationDto;
if (jsonParam.has("cmd")) {
switch (jsonParam.getString("cmd")){
case "goSetting":
if (jsonParam.has(ABookKeys.CMD)) {
switch (jsonParam.getString(ABookKeys.CMD)){
case ABookKeys.CMD_KEY.GO_SETTING:
showSetting();
break;
case "goRelationContent":
case ABookKeys.CMD_KEY.GO_RELATION_CONTENT:
showCommonContent();
break;
case "goPrintTarget":
case ABookKeys.CMD_KEY.GO_PRINT_TARGET:
showPrintTargetSelect();
break;
case "goOperation":
if (!jsonParam.has("operationId")) {
case ABookKeys.CMD_KEY.GO_OPERATION:
if (!jsonParam.has(ABookKeys.OPERATION_ID)) {
break;
}
final OperationDto tempOperationDto = mOperationDao.getOperationJoinContent(jsonParam.getInt("operationId"));
final OperationDto tempOperationDto = mOperationDao.getOperationJoinContent(jsonParam.getInt(ABookKeys.OPERATION_ID));
runOnUiThread(new Runnable() {
@Override
public void run() {
......@@ -378,12 +378,12 @@ public class OperationListActivity extends ABVUIActivity {
openReportView(tempOperationDto);
break;
case "goCommunication":
case ABookKeys.CMD_KEY.GO_COMMUNICATION:
showCommunicationMenuDialog();
break;
case "goPanoramaEdit":
final OperationDto panoramaOperationDto = mOperationDao.getOperationJoinContent(jsonParam.getInt("operationId"));
case ABookKeys.CMD_KEY.GO_PANORAMA_EDIT:
final OperationDto panoramaOperationDto = mOperationDao.getOperationJoinContent(jsonParam.getInt(ABookKeys.OPERATION_ID));
runOnUiThread(new Runnable() {
@Override
public void run() {
......@@ -393,6 +393,15 @@ public class OperationListActivity extends ABVUIActivity {
startTaskDirectionOrReportView(panoramaOperationDto);
break;
case ABookKeys.CMD_KEY.REFRESH_CONTENT:
clearSearch();
runOnUiThread(new Runnable() {
@Override
public void run() {
mCheckWebView.loadUrl("javascript:location.reload();");
}
});
break;
}
}
}
......@@ -401,6 +410,16 @@ public class OperationListActivity extends ABVUIActivity {
public String getCachePath() {
return getCacheDir().getAbsolutePath();
}
@JavascriptInterface
public String searchOperationList(String searchKeyword, String searchStartDate, String searchEndDate) {
mSearchWord = searchKeyword;
mStartDateStr = searchStartDate;
mEndDateStr = searchEndDate;
List<OperationDto> operationList = mListHelper.filterOperationList();
String searchOperationListStr = mOperationLogic.createOperationListJson(operationList, null);
return searchOperationListStr;
}
}
// 共通資料画面表示
......@@ -1956,13 +1975,15 @@ public class OperationListActivity extends ABVUIActivity {
}
public void createJsonForOperationList(String filePath) {
mOperationLogic.createOperationListJson(filePath);
List<OperationDto> operationList = mListHelper.filterOperationList();
mOperationLogic.createOperationListJson(operationList, filePath);
mOperationGroupMasterLogic.createOperationGroupMasterListJson(filePath);
mOperationGroupMasterLogic.createOperationGroupMasterRelationListJson(filePath);
mPushMessageLogic.createOperationPushMessageListJson(filePath);
}
public void screenRefresh() {
showProgressPopup();
runOnUiThread(new Runnable() {
@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