|
|
@@ -67,6 +67,9 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
private String title;
|
|
|
private List<Approval> approvals;
|
|
|
|
|
|
+ //审批要点\当前明细表\历史节点
|
|
|
+ private boolean setupTaskSubing, formDataSubing, jnodesSubing;
|
|
|
+
|
|
|
public boolean isApprovaling() {
|
|
|
if (StringUtils.isEmpty(title)) return false;
|
|
|
return title.equals(OACheckUtil.getString(R.string.title_approval));
|
|
|
@@ -120,10 +123,10 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
}
|
|
|
|
|
|
public String getUrl(String baseUrl, String title) {
|
|
|
- if (StringUtils.isEmpty(baseUrl))
|
|
|
- baseUrl = "jsps/mobile/process.jsp?nodeId=";
|
|
|
- LogUtil.i("title=" + title);
|
|
|
String endStatus = (StringUtils.isEmpty(title) || title.equals(OACheckUtil.getString(R.string.title_approval)) ? "" : "%26_do=1");
|
|
|
+ if (StringUtils.isEmpty(baseUrl) || endStatus.contains("26_do=1")) {
|
|
|
+ baseUrl = "jsps/mobile/process.jsp?nodeId=";
|
|
|
+ }
|
|
|
return baseUrl + record.nodeId + endStatus;
|
|
|
}
|
|
|
|
|
|
@@ -256,6 +259,7 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
}
|
|
|
|
|
|
public void loadTakeOver() {
|
|
|
+ if (submiting && canNext()) return;
|
|
|
iApproval.showLoading();
|
|
|
String url = "common/takeOverTask.action";
|
|
|
Map<String, Object> param = new HashMap<>();
|
|
|
@@ -289,9 +293,9 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
}
|
|
|
|
|
|
public void loadNextProcess() {
|
|
|
+ if (submiting && canNext()) return;
|
|
|
iApproval.showToast(R.string.loadtonext_approval, R.color.load_submit);
|
|
|
iApproval.showLoading();
|
|
|
- if (submiting) return;
|
|
|
submiting = true;
|
|
|
String url = "common/getNextProcess.action";
|
|
|
Map<String, Object> param = new HashMap<>();
|
|
|
@@ -308,6 +312,7 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
//下拉明细表数据
|
|
|
private void loadDetailedList() {
|
|
|
iApproval.showLoading();
|
|
|
+ formDataSubing = true;
|
|
|
String url = "mobile/common/getformandgriddata.action";
|
|
|
Map<String, Object> param = new HashMap<>();
|
|
|
param.put("caller", record.caller);
|
|
|
@@ -337,6 +342,7 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
//下拉审批要点
|
|
|
private void loadCustomSetupOfTask() {
|
|
|
iApproval.showLoading();
|
|
|
+ setupTaskSubing = true;
|
|
|
String url = "common/getCustomSetupOfTask.action";
|
|
|
Map<String, Object> param = new HashMap<>();
|
|
|
param.put("_noc", 1);
|
|
|
@@ -351,6 +357,7 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
//获取历史节点数据
|
|
|
private void loadJnodes() {
|
|
|
iApproval.showLoading();
|
|
|
+ jnodesSubing = true;
|
|
|
String url = "common/getCurrentJnodes.action";
|
|
|
Map<String, Object> param = new HashMap<>();
|
|
|
param.put("caller", record.caller);
|
|
|
@@ -456,8 +463,10 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
public void run() {
|
|
|
try {
|
|
|
handlerFormandGriddataInThread(OACheckUtil.getJSONObject(object, "datas"));
|
|
|
+ formDataSubing = false;
|
|
|
} catch (Exception e) {
|
|
|
submiting = false;
|
|
|
+ formDataSubing = false;
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
@@ -817,6 +826,7 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
}
|
|
|
});
|
|
|
submiting = false;
|
|
|
+ jnodesSubing = false;
|
|
|
}
|
|
|
|
|
|
private void handlerEnclosure(final JSONArray array) throws Exception {
|
|
|
@@ -926,6 +936,7 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
setData2ListThread(Approval.POINTS, pointsList);
|
|
|
}
|
|
|
}
|
|
|
+ setupTaskSubing = false;
|
|
|
}
|
|
|
});
|
|
|
|
|
|
@@ -1134,6 +1145,13 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
iApproval.showModels(approvals);
|
|
|
}
|
|
|
|
|
|
+ private boolean canNext() {
|
|
|
+ LogUtil.i("setupTaskSubing="+setupTaskSubing);
|
|
|
+ LogUtil.i("formDataSubing="+formDataSubing);
|
|
|
+ LogUtil.i("jnodesSubing="+jnodesSubing);
|
|
|
+
|
|
|
+ return !setupTaskSubing && !formDataSubing && !jnodesSubing;
|
|
|
+ }
|
|
|
|
|
|
private synchronized void setData2ListThread(int type, List<Approval> newApprovals) {
|
|
|
LogUtil.i("come to setData2ListThread=" + type);
|