|
|
@@ -119,10 +119,12 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public String getUrl(String title) {
|
|
|
+ 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");
|
|
|
- return "jsps/mobile/process.jsp?nodeId=" + record.nodeId + endStatus;
|
|
|
+ return baseUrl + record.nodeId + endStatus;
|
|
|
}
|
|
|
|
|
|
public void initLoad() {
|
|
|
@@ -144,10 +146,10 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
}
|
|
|
|
|
|
public void loadProcessUpdate(String nodeLog, List<Approval> approvals) {
|
|
|
- StringBuilder points = new StringBuilder();
|
|
|
- if (!inputAllPoints(points, approvals))
|
|
|
+ StringBuilder pointsBuilder = new StringBuilder();
|
|
|
+ if (!inputAllPoints(pointsBuilder, approvals))
|
|
|
return;
|
|
|
- chchePoints = points.toString();
|
|
|
+ chchePoints = pointsBuilder.toString();
|
|
|
LogUtil.i("chchePoints=" + chchePoints);
|
|
|
String url = "common/processUpdate.action";
|
|
|
Map<String, Object> param = new HashMap<>();
|
|
|
@@ -310,7 +312,7 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
Map<String, Object> param = new HashMap<>();
|
|
|
param.put("caller", record.caller);
|
|
|
param.put("id", record.id);
|
|
|
-// param.put("isprocess", 1);
|
|
|
+ param.put("isprocess", 1);
|
|
|
Request.Bulider bulider = new Request.Bulider()
|
|
|
.setUrl(url)
|
|
|
.setWhat(LOAD_FORMAND_GRIDDATA)
|
|
|
@@ -639,8 +641,10 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
String caller = null;
|
|
|
JSONArray otherGriddata = null;
|
|
|
JSONArray otherGridconfigs = null;
|
|
|
+ String name = null;
|
|
|
for (int i = 0; i < othergrids.size(); i++) {
|
|
|
o = othergrids.getJSONObject(i);
|
|
|
+ name = OACheckUtil.getJson2Text(o, "name");
|
|
|
caller = OACheckUtil.getJson2Text(o, "caller");
|
|
|
otherGriddata = OACheckUtil.getJsonArray(o, "griddata");
|
|
|
otherGridconfigs = OACheckUtil.getJsonArray(o, "gridconfigs");
|
|
|
@@ -649,8 +653,7 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
//获取到单个明细表单
|
|
|
final List<Approval> detailedApproval = formandGriddata(otherGriddata.getJSONObject(j), otherGridconfigs, caller, false);
|
|
|
Approval approval = new Approval(Approval.TAG);
|
|
|
- approval.setCaption(getString(R.string.subtabulation) + " " + (i + 1) + " " +
|
|
|
- getString(R.string.serial_number) + (j + 1));
|
|
|
+ approval.setCaption(name + " " + getString(R.string.serial_number) + (j + 1));
|
|
|
detailedApproval.add(0, approval);
|
|
|
detailedList.addAll(detailedApproval);
|
|
|
}
|
|
|
@@ -682,9 +685,9 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
String type = getJson2Text(config, "FD_TYPE", "DG_TYPE");
|
|
|
//添加类型
|
|
|
approval.setDfType(type);
|
|
|
- int isdefault = OACheckUtil.getJsonIntager(config, "MFD_ISDEFAULT", "MDG_ISDEFAULT");
|
|
|
+// int isdefault = OACheckUtil.getJsonIntager(config, "MFD_ISDEFAULT", "MDG_ISDEFAULT");
|
|
|
int appwidth = OACheckUtil.getJsonIntager(config, "FD_APPWIDTH", "DG_APPWIDTH");
|
|
|
- if (isMain && caption.equals("附件")) {
|
|
|
+ if (isMain && approval.isDftypeEQ("MF")) {
|
|
|
final String fb_attach = valueKey;
|
|
|
OAHttpHelper.getInstance().post(new Runnable() {
|
|
|
@Override
|
|
|
@@ -694,12 +697,12 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
});
|
|
|
}
|
|
|
//获取Id
|
|
|
- if (!StringUtils.isEmpty(caption) && caption.equals("ID")) {
|
|
|
+ if (!StringUtils.isEmpty(caption) && (caption.equals("ID") || caption.equals("id"))) {
|
|
|
idTag = valueKey;
|
|
|
id = OACheckUtil.getJsonIntager(data, valueKey);
|
|
|
}
|
|
|
- if (isdefault != -1
|
|
|
- || approval.isDftypeEQ("H")
|
|
|
+ if (approval.isDftypeEQ("H")
|
|
|
+// || isdefault != -1
|
|
|
|| appwidth == 0
|
|
|
|| (!isMain && OACheckUtil.getJsonIntager(config, "DG_WIDTH") == 0)
|
|
|
|| OACheckUtil.isEmpty(valueKey)
|
|
|
@@ -960,8 +963,12 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
approval.getDatas().add(new Approval.Data(v, v));
|
|
|
}
|
|
|
}
|
|
|
- if (!StringUtils.isEmpty(neer))
|
|
|
+ if (!StringUtils.isEmpty(neer)) {
|
|
|
approval.setMustInput(neer.startsWith("Y"));
|
|
|
+ if (neer.contains("@A")) {
|
|
|
+ approval.setDfType("@A");
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
if (datas != null && datas.length > 0) {
|
|
|
for (String data : datas) {
|
|
|
@@ -1014,12 +1021,10 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
//判断要点
|
|
|
private boolean inputAllPoints(StringBuilder customDes, List<Approval> approvals) {
|
|
|
if (!ListUtils.isEmpty(approvals)) {
|
|
|
- LogUtil.i("show Presenter pointsList .....");
|
|
|
for (Approval approval : approvals) {
|
|
|
if (approval.getType() == Approval.POINTS) {
|
|
|
if (approval.isMustInput() && StringUtils.isEmpty(approval.getValues())) {
|
|
|
String message = OACheckUtil.getString(R.string.approval_points) + " " + approval.getCaption() + " " + OACheckUtil.getString(R.string.is_must_input);
|
|
|
- LogUtil.i("message=" + message);
|
|
|
iApproval.showToast(message, R.color.load_submit);
|
|
|
return false;
|
|
|
}
|
|
|
@@ -1030,7 +1035,12 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
iApproval.showToast(message, R.color.load_submit);
|
|
|
return false;
|
|
|
}
|
|
|
- customDes.append(approval.getCaption() + "(" + approval.getValues() + ");");
|
|
|
+ if (approval.isDftypeEQ("@A")) {
|
|
|
+ customDes.append(approval.getCaption() + "(" + approval.getValues() + ")" + "@A@;");
|
|
|
+ } else {
|
|
|
+ customDes.append(approval.getCaption() + "(" + approval.getValues() + ");");
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -1060,11 +1070,12 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
if (formstore == null)
|
|
|
return false;
|
|
|
formStore.putAll(formstore);
|
|
|
+
|
|
|
for (List<Approval> details : detailList) {
|
|
|
Map<String, Object> param = putItem2Params(details);
|
|
|
if (param == null)
|
|
|
return false;
|
|
|
- if (param.isEmpty()) continue;
|
|
|
+ if (param.isEmpty() || param.keySet().size() <= 1) continue;
|
|
|
params.add(param);
|
|
|
}
|
|
|
}
|