|
|
@@ -8,28 +8,29 @@ import android.os.Looper;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.common.LogUtil;
|
|
|
+import com.common.data.DateFormatUtil;
|
|
|
+import com.common.data.JSONUtil;
|
|
|
+import com.common.data.ListUtils;
|
|
|
+import com.common.data.StringUtil;
|
|
|
+import com.common.thread.ThreadUtil;
|
|
|
+import com.core.dao.DBManager;
|
|
|
+import com.core.model.EmployeesEntity;
|
|
|
+import com.core.net.http.http.OAHttpHelper;
|
|
|
+import com.core.net.http.http.OnHttpResultListener;
|
|
|
+import com.core.net.http.http.Request;
|
|
|
+import com.core.utils.CommonUtil;
|
|
|
+import com.core.utils.TimeUtils;
|
|
|
+import com.core.utils.ToastUtil;
|
|
|
+import com.uas.appworks.OA.erp.activity.form.DataFormFieldActivity;
|
|
|
import com.xzjmyk.pm.activity.MyApplication;
|
|
|
import com.xzjmyk.pm.activity.R;
|
|
|
-import com.xzjmyk.pm.activity.ui.erp.activity.form.DataFormFieldActivity;
|
|
|
-import com.xzjmyk.pm.activity.ui.erp.db.DBManager;
|
|
|
-import com.xzjmyk.pm.activity.ui.erp.entity.EmployeesEntity;
|
|
|
import com.xzjmyk.pm.activity.ui.erp.model.form.Data;
|
|
|
import com.xzjmyk.pm.activity.ui.erp.model.oa.Approval;
|
|
|
import com.xzjmyk.pm.activity.ui.erp.model.oa.ApprovalRecord;
|
|
|
import com.xzjmyk.pm.activity.ui.erp.presenter.imp.IApproval;
|
|
|
-import com.xzjmyk.pm.activity.ui.erp.util.CommonUtil;
|
|
|
-import com.xzjmyk.pm.activity.ui.erp.util.Constants;
|
|
|
-import com.xzjmyk.pm.activity.ui.erp.util.JsonValidator;
|
|
|
-import com.xzjmyk.pm.activity.ui.erp.util.ListUtils;
|
|
|
-import com.xzjmyk.pm.activity.ui.erp.util.LogUtil;
|
|
|
-import com.xzjmyk.pm.activity.ui.erp.util.OACheckUtil;
|
|
|
-import com.xzjmyk.pm.activity.ui.erp.util.StringUtils;
|
|
|
-import com.xzjmyk.pm.activity.ui.erp.util.oa.http.OAHttpHelper;
|
|
|
-import com.xzjmyk.pm.activity.ui.erp.util.oa.http.OnHttpResultListener;
|
|
|
-import com.xzjmyk.pm.activity.ui.erp.util.oa.http.Request;
|
|
|
-import com.xzjmyk.pm.activity.ui.tool.ThreadUtil;
|
|
|
-import com.xzjmyk.pm.activity.util.TimeUtils;
|
|
|
-import com.xzjmyk.pm.activity.util.ToastUtil;
|
|
|
+
|
|
|
+import org.jivesoftware.smack.util.StringUtils;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
@@ -38,9 +39,6 @@ import java.util.Map;
|
|
|
|
|
|
import static com.alibaba.fastjson.JSON.parseObject;
|
|
|
import static com.xzjmyk.pm.activity.ui.erp.model.oa.Approval.DETAIL;
|
|
|
-import static com.xzjmyk.pm.activity.ui.erp.util.OACheckUtil.getJson2Text;
|
|
|
-import static com.xzjmyk.pm.activity.ui.erp.util.OACheckUtil.getJsonIntager;
|
|
|
-import static com.xzjmyk.pm.activity.ui.erp.util.OACheckUtil.getString;
|
|
|
|
|
|
/**
|
|
|
* Created by Bitliker on 2017/7/7.
|
|
|
@@ -106,12 +104,12 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
|
|
|
public boolean isApprovaling() {
|
|
|
if (StringUtils.isEmpty(title)) return false;
|
|
|
- return title.equals(OACheckUtil.getString(R.string.title_approval));
|
|
|
+ return title.equals(StringUtil.getMessage(R.string.title_approval));
|
|
|
}
|
|
|
|
|
|
public boolean isApprovaled() {
|
|
|
if (StringUtils.isEmpty(title)) return false;
|
|
|
- return title.equals(OACheckUtil.getString(R.string.task_confimed));
|
|
|
+ return title.equals(StringUtil.getMessage(R.string.task_confimed));
|
|
|
}
|
|
|
|
|
|
public void trun2SetActivity(Activity activity) {
|
|
|
@@ -141,7 +139,7 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
}
|
|
|
|
|
|
public String getUrl(String baseUrl, String title) {
|
|
|
- String endStatus = (StringUtils.isEmpty(title) || title.equals(OACheckUtil.getString(R.string.title_approval)) ? "" : "%26_do=1");
|
|
|
+ String endStatus = (StringUtils.isEmpty(title) || title.equals(StringUtil.getMessage(R.string.title_approval)) ? "" : "%26_do=1");
|
|
|
if (StringUtils.isEmpty(baseUrl) || endStatus.contains("26_do=1")) {
|
|
|
baseUrl = "jsps/mobile/process.jsp?nodeId=";
|
|
|
}
|
|
|
@@ -268,9 +266,9 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
param.put("caller", record.caller);
|
|
|
param.put("master", master);
|
|
|
param.put("processInstanceId", record.processInstanceId);
|
|
|
- String form = StringUtils.mapToJson(formStore);
|
|
|
+ String form = JSONUtil.map2JSON(formStore);
|
|
|
param.put("formStore", StringUtils.isEmpty(form) ? "{}" : form);
|
|
|
- param.put("param", StringUtils.mapToJson(params));
|
|
|
+ param.put("param", JSONUtil.map2JSON(params));
|
|
|
Bundle bundle = new Bundle();
|
|
|
bundle.putString("nodeLog", nodeLog);
|
|
|
Request.Bulider bulider = new Request.Bulider()
|
|
|
@@ -285,13 +283,13 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
private void agree(String nodeLog) {
|
|
|
LogUtil.i("agree");
|
|
|
iApproval.showLoading();
|
|
|
- String points = OACheckUtil.getString(chchePoints);
|
|
|
+ String points = StringUtil.getMessage(chchePoints);
|
|
|
points.replaceAll("@", "").replaceAll("\\@", "").replaceAll("\\\\@", "");
|
|
|
String url = "common/review.action";
|
|
|
Map<String, Object> param = new HashMap<>();
|
|
|
param.put("taskId", record.nodeId);
|
|
|
param.put("nodeName", record.nodeName);
|
|
|
- param.put("nodeLog", OACheckUtil.getString(nodeLog));
|
|
|
+ param.put("nodeLog", StringUtil.getMessage(nodeLog));
|
|
|
param.put("result", true);
|
|
|
param.put("master", master);
|
|
|
param.put("attachs", "");//附件id
|
|
|
@@ -406,7 +404,7 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
params.put("em_code", emCode);
|
|
|
param.put("master", master);
|
|
|
params.put("nodeId", record.chcheNode);
|
|
|
- param.put("params", StringUtils.mapToJson(params));
|
|
|
+ param.put("params", JSONUtil.map2JSON(params));
|
|
|
param.put("_noc", "1");
|
|
|
Request.Bulider bulider = new Request.Bulider()
|
|
|
.setUrl(url)
|
|
|
@@ -566,9 +564,9 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
break;
|
|
|
}
|
|
|
String errorKey = "exceptionInfo";
|
|
|
- if (new JsonValidator().validate(message) && !StringUtils.isEmpty(getJson2Text(parseObject(message), errorKey))) {
|
|
|
- LogUtil.i("new JsonValidator().validate(message) && !StringUtils.isEmpty(getJson2Text(parseObject(message), errorKey)");
|
|
|
- String remain = getJson2Text(parseObject(message), errorKey);
|
|
|
+ if (JSONUtil.validate(message) && !StringUtils.isEmpty(JSONUtil.getText(parseObject(message), errorKey))) {
|
|
|
+ LogUtil.i("new JsonValidator().validate(message) && !StringUtils.isEmpty(JSONUtil.getText(parseObject(message), errorKey)");
|
|
|
+ String remain = JSONUtil.getText(parseObject(message), errorKey);
|
|
|
LogUtil.i("remain=" + remain);
|
|
|
iApproval.showToast(remain, R.color.load_submit);
|
|
|
} else {
|
|
|
@@ -579,14 +577,14 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
private void hander(int what, final JSONObject object, Bundle bundle) throws Exception {
|
|
|
switch (what) {
|
|
|
case LOAD_CURRENT_NODE:
|
|
|
- handlerCurrentNode(OACheckUtil.getJSONObject(object, "info"));
|
|
|
+ handlerCurrentNode(JSONUtil.getJSONObject(object, "info"));
|
|
|
break;
|
|
|
case LOAD_FORMAND_GRIDDATA:
|
|
|
ThreadUtil.getInstance().addTask(new Runnable() {
|
|
|
@Override
|
|
|
public void run() {
|
|
|
try {
|
|
|
- handlerFormandGriddataInThread(OACheckUtil.getJSONObject(object, "datas"));
|
|
|
+ handlerFormandGriddataInThread(JSONUtil.getJSONObject(object, "datas"));
|
|
|
} catch (Exception e) {
|
|
|
LogUtil.i("handlerFormandGriddataInThread =" + e.getMessage());
|
|
|
loading = false;
|
|
|
@@ -607,7 +605,7 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
break;
|
|
|
case LOAD_NEXT_PROCESS:
|
|
|
if (loading) return;
|
|
|
- int nextnode = OACheckUtil.getJsonIntager(object, "nodeId");
|
|
|
+ int nextnode = JSONUtil.getInt(object, "nodeId");
|
|
|
if (nextnode > 0) {
|
|
|
initLoad(nextnode);
|
|
|
} else {
|
|
|
@@ -616,32 +614,32 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
}
|
|
|
break;
|
|
|
case LOAD_UPDATE_ASSIGNEE:
|
|
|
- nextnode = OACheckUtil.getJsonIntager(object, "nextnode");
|
|
|
+ nextnode = JSONUtil.getInt(object, "nextnode");
|
|
|
if (nextnode > 0) {
|
|
|
iApproval.showToast(R.string.load_next_approval, R.color.load_submit);
|
|
|
initLoad(nextnode);
|
|
|
} else {
|
|
|
- iApproval.showToast(getString(R.string.make_adeal_success) + getString(R.string.load_not_next_data), R.color.load_submit);
|
|
|
+ iApproval.showToast(StringUtil.getMessage(R.string.make_adeal_success) + StringUtil.getMessage(R.string.load_not_next_data), R.color.load_submit);
|
|
|
iApproval.finish();
|
|
|
}
|
|
|
break;
|
|
|
case LOAD_FILE_PATHS:
|
|
|
- handlerEnclosure(OACheckUtil.getJsonArray(object, "files"));
|
|
|
+ handlerEnclosure(JSONUtil.getJSONArray(object, "files"));
|
|
|
break;
|
|
|
case LOAD_TAKE_OVER://接管成功后
|
|
|
- if (OACheckUtil.getJsonBoolean(object, "success")) {
|
|
|
+ if (JSONUtil.getBoolean(object, "success")) {
|
|
|
initLoad(record.nodeId);
|
|
|
} else {
|
|
|
iApproval.showToast(R.string.load_take_over_error, R.color.load_submit);
|
|
|
}
|
|
|
break;
|
|
|
case LOAD_DISAGREE:
|
|
|
- nextnode = OACheckUtil.getJsonIntager(object, "nextnode");
|
|
|
+ nextnode = JSONUtil.getInt(object, "nextnode");
|
|
|
if (nextnode > 0) {
|
|
|
iApproval.showToast(R.string.load_next_approval, R.color.load_submit);
|
|
|
initLoad(nextnode);
|
|
|
} else {
|
|
|
- iApproval.showToast(getString(R.string.make_adeal_success) + getString(R.string.load_not_next_data), R.color.load_submit);
|
|
|
+ iApproval.showToast(StringUtil.getMessage(R.string.make_adeal_success) + StringUtil.getMessage(R.string.load_not_next_data), R.color.load_submit);
|
|
|
iApproval.finish();
|
|
|
}
|
|
|
break;
|
|
|
@@ -672,9 +670,9 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
|
|
|
private void handlerNextStepoInstance(JSONObject object) {
|
|
|
if (object.containsKey("assigns")) {
|
|
|
- JSONArray array = OACheckUtil.getJsonArray(object, "assigns");
|
|
|
+ JSONArray array = JSONUtil.getJSONArray(object, "assigns");
|
|
|
JSONObject o = array.getJSONObject(0);
|
|
|
- String noid = OACheckUtil.getJson2Text(o, "JP_NODEID");
|
|
|
+ String noid = JSONUtil.getText(o, "JP_NODEID");
|
|
|
JSONArray data = null;
|
|
|
if (o != null && o.containsKey("JP_CANDIDATES")) {
|
|
|
data = o.getJSONArray("JP_CANDIDATES");
|
|
|
@@ -693,19 +691,19 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
//处理当前结点信息
|
|
|
private void handlerCurrentNode(JSONObject object) throws Exception {
|
|
|
if (object != null && !loading) {
|
|
|
- record.processInstanceId = getJson2Text(object, "InstanceId");
|
|
|
- record.isForknode = OACheckUtil.getJsonIntager(object, "forknode") == 0;
|
|
|
- JSONObject currentnode = OACheckUtil.getJSONObject(object, "currentnode");
|
|
|
+ record.processInstanceId = JSONUtil.getText(object, "InstanceId");
|
|
|
+ record.isForknode = JSONUtil.getInt(object, "forknode") == 0;
|
|
|
+ JSONObject currentnode = JSONUtil.getJSONObject(object, "currentnode");
|
|
|
if (currentnode != null) {
|
|
|
- String recordName = getJson2Text(currentnode, "jp_launcherName");
|
|
|
- String nodeDealMan = getJson2Text(currentnode, "jp_nodeDealMan");
|
|
|
- String launcherCode = getJson2Text(currentnode, "jp_launcherId");
|
|
|
+ String recordName = JSONUtil.getText(currentnode, "jp_launcherName");
|
|
|
+ String nodeDealMan = JSONUtil.getText(currentnode, "jp_nodeDealMan");
|
|
|
+ String launcherCode = JSONUtil.getText(currentnode, "jp_launcherId");
|
|
|
iApproval.nodeDealMan(nodeDealMan);
|
|
|
- String nodeName = getJson2Text(currentnode, "jp_nodeName");
|
|
|
- int keyValue = getJsonIntager(currentnode, "jp_keyValue");
|
|
|
- record.title = record.callerName = getJson2Text(currentnode, "jp_name");
|
|
|
- record.status = OACheckUtil.getJson2Text(currentnode, "jp_status");
|
|
|
- String caller = OACheckUtil.getJson2Text(currentnode, "jp_caller");
|
|
|
+ String nodeName = JSONUtil.getText(currentnode, "jp_nodeName");
|
|
|
+ int keyValue = JSONUtil.getInt(currentnode, "jp_keyValue");
|
|
|
+ record.title = record.callerName = JSONUtil.getText(currentnode, "jp_name");
|
|
|
+ record.status = JSONUtil.getText(currentnode, "jp_status");
|
|
|
+ String caller = JSONUtil.getText(currentnode, "jp_caller");
|
|
|
if (keyValue != 0) {
|
|
|
record.id = keyValue;
|
|
|
}
|
|
|
@@ -724,9 +722,9 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
record.imid = String.valueOf(getImByCode(launcherCode));
|
|
|
}
|
|
|
}
|
|
|
- JSONObject button = OACheckUtil.getJSONObject(object, "button");
|
|
|
+ JSONObject button = JSONUtil.getJSONObject(object, "button");
|
|
|
if (currentnode != null) {
|
|
|
- record.needInputKeys = getJson2Text(button, "jt_neccessaryfield");
|
|
|
+ record.needInputKeys = JSONUtil.getText(button, "jt_neccessaryfield");
|
|
|
}
|
|
|
handerTitle(0);
|
|
|
loadDetailedList();//获取明细表
|
|
|
@@ -739,20 +737,20 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
private void handlerFormandGriddataInThread(JSONObject object) throws Exception {
|
|
|
if (object != null) {
|
|
|
//计算主表
|
|
|
- JSONArray formdatas = OACheckUtil.getJsonArray(object, "formdata");
|
|
|
- JSONArray formconfigs = OACheckUtil.getJsonArray(object, "formconfigs");
|
|
|
+ JSONArray formdatas = JSONUtil.getJSONArray(object, "formdata");
|
|
|
+ JSONArray formconfigs = JSONUtil.getJSONArray(object, "formconfigs");
|
|
|
List<Approval> mainDetailList = new ArrayList<>();
|
|
|
if (!ListUtils.isEmpty(formconfigs)) {
|
|
|
final JSONObject formdata = ListUtils.isEmpty(formdatas) ? null : formdatas.getJSONObject(0);
|
|
|
final JSONObject changeData = ListUtils.getSize(formdatas) <= 1 ? null : formdatas.getJSONObject(1);
|
|
|
if (!ListUtils.isEmpty(formconfigs)) {
|
|
|
- final List<Approval> mainApproval = formandGriddata(OACheckUtil.getJSONObject(changeData, "change-new"), formdata, formconfigs, record.caller, true, true);
|
|
|
+ final List<Approval> mainApproval = formandGriddata(JSONUtil.getJSONObject(changeData, "change-new"), formdata, formconfigs, record.caller, true, true);
|
|
|
mainDetailList.addAll(mainApproval);
|
|
|
}
|
|
|
}
|
|
|
//计算从表
|
|
|
- JSONArray griddatas = OACheckUtil.getJsonArray(object, "griddata");
|
|
|
- JSONArray gridconfigs = OACheckUtil.getJsonArray(object, "gridconfigs");
|
|
|
+ JSONArray griddatas = JSONUtil.getJSONArray(object, "griddata");
|
|
|
+ JSONArray gridconfigs = JSONUtil.getJSONArray(object, "gridconfigs");
|
|
|
final List<Approval> detailedList = new ArrayList<>();
|
|
|
if (!ListUtils.isEmpty(gridconfigs)) {
|
|
|
if (ListUtils.isEmpty(griddatas)) {
|
|
|
@@ -773,7 +771,7 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
}
|
|
|
}
|
|
|
//计算多从表
|
|
|
- JSONArray othergrids = OACheckUtil.getJsonArray(object, "othergrids");
|
|
|
+ JSONArray othergrids = JSONUtil.getJSONArray(object, "othergrids");
|
|
|
if (!ListUtils.isEmpty(othergrids)) {
|
|
|
JSONObject o = null;
|
|
|
String caller = null;
|
|
|
@@ -782,10 +780,10 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
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");
|
|
|
+ name = JSONUtil.getText(o, "name");
|
|
|
+ caller = JSONUtil.getText(o, "caller");
|
|
|
+ otherGriddata = JSONUtil.getJSONArray(o, "griddata");
|
|
|
+ otherGridconfigs = JSONUtil.getJSONArray(o, "gridconfigs");
|
|
|
if (!ListUtils.isEmpty(otherGriddata) && !ListUtils.isEmpty(otherGridconfigs)) {
|
|
|
for (int j = 0; j < otherGriddata.size(); j++) {
|
|
|
//获取到单个明细表单
|
|
|
@@ -832,19 +830,19 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
JSONObject config = configs.getJSONObject(i);
|
|
|
if (config == null) continue;
|
|
|
Approval approval = new Approval(isMain ? Approval.MAIN : DETAIL);
|
|
|
- String caption = getJson2Text(config, "FD_CAPTION", "DG_CAPTION");//获取第一个字段字段名称
|
|
|
- String valueKey = getJson2Text(config, "FD_FIELD", "DG_FIELD");
|
|
|
- JSONArray combostore = OACheckUtil.getJsonArray(config, "COMBOSTORE");
|
|
|
- String type = getJson2Text(config, "FD_TYPE", "DG_TYPE");
|
|
|
+ String caption = JSONUtil.getText(config, "FD_CAPTION", "DG_CAPTION");//获取第一个字段字段名称
|
|
|
+ String valueKey = JSONUtil.getText(config, "FD_FIELD", "DG_FIELD");
|
|
|
+ JSONArray combostore = JSONUtil.getJSONArray(config, "COMBOSTORE");
|
|
|
+ String type = JSONUtil.getText(config, "FD_TYPE", "DG_TYPE");
|
|
|
//添加类型
|
|
|
approval.setDfType(type);
|
|
|
approval.setCaption(caption);
|
|
|
approval.setValuesKey(valueKey);
|
|
|
- int isdefault = OACheckUtil.getJsonIntager(config, "MFD_ISDEFAULT", "MDG_ISDEFAULT");
|
|
|
- int appwidth = OACheckUtil.getJsonIntager(config, "FD_APPWIDTH", "DG_APPWIDTH");
|
|
|
+ int isdefault = JSONUtil.getInt(config, "MFD_ISDEFAULT", "MDG_ISDEFAULT");
|
|
|
+ int appwidth = JSONUtil.getInt(config, "FD_APPWIDTH", "DG_APPWIDTH");
|
|
|
boolean showAble = data != null && data.containsKey(valueKey);
|
|
|
- String values = OACheckUtil.getJson2Text(data, valueKey);
|
|
|
- String newValues = OACheckUtil.getJson2Text(changeData, valueKey);
|
|
|
+ String values = JSONUtil.getText(data, valueKey);
|
|
|
+ String newValues = JSONUtil.getText(changeData, valueKey);
|
|
|
if (showAble && !StringUtils.isEmpty(newValues) && !newValues.equals(values)) {
|
|
|
approval.setOldValues(values);
|
|
|
} else {
|
|
|
@@ -863,15 +861,15 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
//获取Id
|
|
|
if (!StringUtils.isEmpty(caption) && (caption.equals("ID") || caption.equals("id"))) {
|
|
|
idTag = valueKey;
|
|
|
- id = OACheckUtil.getJsonIntager(data, valueKey);
|
|
|
+ id = JSONUtil.getInt(data, valueKey);
|
|
|
}
|
|
|
if (approval.isDftypeEQ("H")
|
|
|
|| isdefault != -1
|
|
|
|| appwidth == 0
|
|
|
- || (!isMain && OACheckUtil.getJsonIntager(config, "DG_WIDTH") == 0)) {
|
|
|
+ || (!isMain && JSONUtil.getInt(config, "DG_WIDTH") == 0)) {
|
|
|
continue;
|
|
|
}
|
|
|
- if (!OACheckUtil.isEmpty(caption)) {
|
|
|
+ if (!StringUtil.isEmpty(caption)) {
|
|
|
if (showAble) {
|
|
|
approval.setValues(newValues); //获取第一个字段的值
|
|
|
if (addHint) {
|
|
|
@@ -882,15 +880,15 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (OACheckUtil.isEmpty(valueKey) || OACheckUtil.isEmpty(caption) || (merged.length() > 0 && merged.toString().contains("," + valueKey + ","))) {
|
|
|
+ if (StringUtil.isEmpty(valueKey) || StringUtil.isEmpty(caption) || (merged.length() > 0 && merged.toString().contains("," + valueKey + ","))) {
|
|
|
continue;
|
|
|
}
|
|
|
//添加下拉数据
|
|
|
if (!ListUtils.isEmpty(combostore)) {
|
|
|
for (int j = 0; j < combostore.size(); j++) {
|
|
|
JSONObject object = combostore.getJSONObject(j);
|
|
|
- String value = getJson2Text(object, "DLC_VALUE");
|
|
|
- String display = getJson2Text(object, "DLC_DISPLAY");
|
|
|
+ String value = JSONUtil.getText(object, "DLC_VALUE");
|
|
|
+ String display = JSONUtil.getText(object, "DLC_DISPLAY");
|
|
|
if (!StringUtils.isEmpty(value) || !StringUtils.isEmpty(display))
|
|
|
approval.getDatas().add(new Approval.Data(display, value));
|
|
|
}
|
|
|
@@ -917,9 +915,9 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
continue;//如果不是要输入的对象,同时显示值为空,需要隐藏去
|
|
|
}
|
|
|
if (mergeAble) {
|
|
|
- String valueTagKey = getJson2Text(config, "FD_LOGICTYPE", "DG_LOGICTYPE");//获取第二个值的key
|
|
|
+ String valueTagKey = JSONUtil.getText(config, "FD_LOGICTYPE", "DG_LOGICTYPE");//获取第二个值的key
|
|
|
if (!StringUtils.isEmpty(valueTagKey)) {
|
|
|
- String valueTag = OACheckUtil.getJson2Text(data, valueTagKey);
|
|
|
+ String valueTag = JSONUtil.getText(data, valueTagKey);
|
|
|
if (!StringUtils.isEmpty(valueTag)) {
|
|
|
merged.append("," + valueTagKey + ",");
|
|
|
approval.addValues("/" + valueTag);
|
|
|
@@ -937,7 +935,7 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
}
|
|
|
|
|
|
private List<Approval> handlerHistorySetuptask(JSONObject object) {
|
|
|
- JSONArray nodes = OACheckUtil.getJsonArray(object, "nodes");
|
|
|
+ JSONArray nodes = JSONUtil.getJSONArray(object, "nodes");
|
|
|
List<Approval> nodeApprovals = new ArrayList<>();
|
|
|
if (!ListUtils.isEmpty(nodes)) {
|
|
|
List<Approval> setuptasks = new ArrayList<>();
|
|
|
@@ -960,10 +958,10 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
}
|
|
|
|
|
|
private List<Approval> getSetuptask(JSONObject node) {
|
|
|
- String name = OACheckUtil.getJson2Text(node, "jn_dealManName");
|
|
|
+ String name = JSONUtil.getText(node, "jn_dealManName");
|
|
|
Approval approval = new Approval(Approval.TAG);
|
|
|
approval.setCaption(name + "的审批记录");
|
|
|
- List<Approval> itemSetuptasks = getSetuptaskByData(OACheckUtil.getJson2Text(node, "jn_operatedDescription"));
|
|
|
+ List<Approval> itemSetuptasks = getSetuptaskByData(JSONUtil.getText(node, "jn_operatedDescription"));
|
|
|
if (!ListUtils.isEmpty(itemSetuptasks)) {
|
|
|
itemSetuptasks.add(0, approval);
|
|
|
}
|
|
|
@@ -972,13 +970,13 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
|
|
|
// //1.forknode==0 (非并行节点) 2.jn_dealResult == '同意' 3.jn_attach == 'T'
|
|
|
private Approval getNodeApproval(JSONObject object) {
|
|
|
- String nodeName = OACheckUtil.getJson2Text(object, "jn_name");//当前结点名称
|
|
|
- String emCode = OACheckUtil.getJson2Text(object, "jn_dealManId");//节点处理人编号
|
|
|
- String manName = OACheckUtil.getJson2Text(object, "jn_dealManName");//处理人名字
|
|
|
- String dealTime = OACheckUtil.getJson2Text(object, "jn_dealTime");//审批时间
|
|
|
- String result = OACheckUtil.getJson2Text(object, "jn_dealResult");//审批结果
|
|
|
- String attach = OACheckUtil.getJson2Text(object, "jn_attach");//选择类型
|
|
|
- String description = OACheckUtil.getJson2Text(object, "jn_nodeDescription");//审批意见
|
|
|
+ String nodeName = JSONUtil.getText(object, "jn_name");//当前结点名称
|
|
|
+ String emCode = JSONUtil.getText(object, "jn_dealManId");//节点处理人编号
|
|
|
+ String manName = JSONUtil.getText(object, "jn_dealManName");//处理人名字
|
|
|
+ String dealTime = JSONUtil.getText(object, "jn_dealTime");//审批时间
|
|
|
+ String result = JSONUtil.getText(object, "jn_dealResult");//审批结果
|
|
|
+ String attach = JSONUtil.getText(object, "jn_attach");//选择类型
|
|
|
+ String description = JSONUtil.getText(object, "jn_nodeDescription");//审批意见
|
|
|
Approval approval = new Approval(Approval.NODES);
|
|
|
approval.setNeerInput("T".equals(attach));
|
|
|
approval.setMustInput(result.equals("同意"));
|
|
|
@@ -986,7 +984,7 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
approval.setCaption(manName);
|
|
|
approval.setDfType(emCode);
|
|
|
if (!StringUtils.isEmpty(dealTime)) {
|
|
|
- approval.setValues(TimeUtils.long2str(TimeUtils.f_str_2_long(dealTime), "MM-dd HH:mm"));
|
|
|
+ approval.setValues(DateFormatUtil.long2Str(TimeUtils.f_str_2_long(dealTime), "MM-dd HH:mm"));
|
|
|
}
|
|
|
StringBuilder resultBuilder = new StringBuilder();
|
|
|
if (!StringUtils.isEmpty(result)) {
|
|
|
@@ -1021,9 +1019,9 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
@Override
|
|
|
public void run() {
|
|
|
boolean showNode = true;
|
|
|
- JSONArray nodes = OACheckUtil.getJsonArray(object, "nodes");
|
|
|
- JSONArray processs = OACheckUtil.getJsonArray(object, "processs");
|
|
|
- JSONArray datas = OACheckUtil.getJsonArray(object, "data");
|
|
|
+ JSONArray nodes = JSONUtil.getJSONArray(object, "nodes");
|
|
|
+ JSONArray processs = JSONUtil.getJSONArray(object, "processs");
|
|
|
+ JSONArray datas = JSONUtil.getJSONArray(object, "data");
|
|
|
List<Approval> approvals = getNodDatas(datas);
|
|
|
if (bundle != null && !StringUtils.isEmpty(bundle.getString("historyNode"))) {
|
|
|
historyNodes = handlerHistorySetuptask(JSON.parseObject(bundle.getString("historyNode")));
|
|
|
@@ -1134,10 +1132,10 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
JSONObject o = array.getJSONObject(i);
|
|
|
if (o == null) continue;
|
|
|
Approval enclosure = new Approval(Approval.ENCLOSURE);
|
|
|
- int id = OACheckUtil.getJsonIntager(o, "fp_id");
|
|
|
+ int id = JSONUtil.getInt(o, "fp_id");
|
|
|
enclosure.setId(id);
|
|
|
enclosure.setIdKey(getImageUrl(id));
|
|
|
- enclosure.setCaption(OACheckUtil.getJson2Text(o, "fp_name"));
|
|
|
+ enclosure.setCaption(JSONUtil.getText(o, "fp_name"));
|
|
|
enclosureList.add(enclosure);
|
|
|
}
|
|
|
}
|
|
|
@@ -1183,12 +1181,12 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
private void mergeNode(JSONArray array, List<Approval> approvals, boolean isLog) {
|
|
|
for (int i = 0; i < array.size(); i++) {
|
|
|
JSONObject o = array.getJSONObject(i);
|
|
|
- String name = OACheckUtil.getJson2Text(o, "jp_nodeName", "jn_name");//节点名称
|
|
|
- long launchTime = OACheckUtil.getJsonTime(o, "jp_launchTime", "jn_dealTime");//时间
|
|
|
- String status = OACheckUtil.getJson2Text(o, "jp_status", "jn_dealResult");//状态
|
|
|
- String nodeDealCode = OACheckUtil.getJson2Text(o, "jp_nodeDealMan", "jn_dealManId");//处理人编号
|
|
|
- String nodeDealName = OACheckUtil.getJson2Text(o, "jp_nodeDealManName", "jn_dealManName");//执行人
|
|
|
- String nodeDescription = OACheckUtil.getJson2Text(o, "jn_nodeDescription");//执行操作
|
|
|
+ String name = JSONUtil.getText(o, "jp_nodeName", "jn_name");//节点名称
|
|
|
+ long launchTime = JSONUtil.getTime(o, "jp_launchTime", "jn_dealTime");//时间
|
|
|
+ String status = JSONUtil.getText(o, "jp_status", "jn_dealResult");//状态
|
|
|
+ String nodeDealCode = JSONUtil.getText(o, "jp_nodeDealMan", "jn_dealManId");//处理人编号
|
|
|
+ String nodeDealName = JSONUtil.getText(o, "jp_nodeDealManName", "jn_dealManName");//执行人
|
|
|
+ String nodeDescription = JSONUtil.getText(o, "jn_nodeDescription");//执行操作
|
|
|
boolean hanEnd = false;
|
|
|
setNodeStatus(status);
|
|
|
for (int j = approvals.size() - 1; j >= 0; j--) {
|
|
|
@@ -1203,12 +1201,12 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
a.setCaption(nodeDealName);
|
|
|
a.setIdKey(hanEnd ? "待审批" : status);
|
|
|
if (launchTime > 0) {
|
|
|
- a.setValues(TimeUtils.long2str(launchTime, "MM-dd HH:mm"));
|
|
|
+ a.setValues(DateFormatUtil.long2Str(launchTime, "MM-dd HH:mm"));
|
|
|
}
|
|
|
} else {
|
|
|
if (a.isDftypeEQ(nodeDealCode)) {
|
|
|
if (launchTime > 0) {
|
|
|
- a.setValues(TimeUtils.long2str(launchTime, "MM-dd HH:mm"));
|
|
|
+ a.setValues(DateFormatUtil.long2Str(launchTime, "MM-dd HH:mm"));
|
|
|
}
|
|
|
if (status.equals("不同意")) {
|
|
|
a.setIdKey(hanEnd ? "待审批" : "未通过");
|
|
|
@@ -1236,9 +1234,9 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
List<Approval> approvals = new ArrayList<>();
|
|
|
for (int i = datas.size() - 1; i >= 0; i--) {
|
|
|
JSONObject object = datas.getJSONObject(i);
|
|
|
- String nodeName = OACheckUtil.getJson2Text(object, "JP_NODENAME");//当前结点名称
|
|
|
- String emCode = OACheckUtil.getJson2Text(object, "JP_NODEDEALMAN");//节点处理人编号
|
|
|
- String manName = OACheckUtil.getJson2Text(object, "JP_NODEDEALMANNAME");
|
|
|
+ String nodeName = JSONUtil.getText(object, "JP_NODENAME");//当前结点名称
|
|
|
+ String emCode = JSONUtil.getText(object, "JP_NODEDEALMAN");//节点处理人编号
|
|
|
+ String manName = JSONUtil.getText(object, "JP_NODEDEALMANNAME");
|
|
|
Approval approval = new Approval(Approval.NODES);
|
|
|
approval.setCaption(StringUtils.isEmpty(manName) ? nodeName : manName);
|
|
|
approval.setDfType(emCode);
|
|
|
@@ -1260,7 +1258,7 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
String description = datas[j];
|
|
|
if (description.contains("(")) {
|
|
|
String caption = description.substring(0, description.indexOf("("));
|
|
|
- String values = OACheckUtil.getFirstBrackets(description);
|
|
|
+ String values = StringUtil.getFirstBrackets(description);
|
|
|
if (!StringUtils.isEmpty(caption) && !StringUtils.isEmpty(values)) {
|
|
|
approval = new Approval(Approval.SETUPTASK);
|
|
|
approval.setNeerInput(false);
|
|
|
@@ -1280,10 +1278,10 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
ThreadUtil.getInstance().addTask(new Runnable() {
|
|
|
@Override
|
|
|
public void run() {
|
|
|
- final int isApprove = OACheckUtil.getJsonIntager(object, "isApprove");
|
|
|
- JSONArray arrayCS = OACheckUtil.getJsonArray(object, "cs");
|
|
|
+ final int isApprove = JSONUtil.getInt(object, "isApprove");
|
|
|
+ JSONArray arrayCS = JSONUtil.getJSONArray(object, "cs");
|
|
|
if (!ListUtils.isEmpty(arrayCS)) {
|
|
|
- String data = OACheckUtil.getJson2Text(object, "data");
|
|
|
+ String data = JSONUtil.getText(object, "data");
|
|
|
String[] datas = null;
|
|
|
if (!StringUtils.isEmpty(data)) {
|
|
|
//需要把该数据填充到对应上面
|
|
|
@@ -1298,7 +1296,7 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
}
|
|
|
if (!ListUtils.isEmpty(pointsList)) {
|
|
|
Approval points = new Approval(Approval.TAG);
|
|
|
- points.setCaption(OACheckUtil.getString(R.string.approval_points));
|
|
|
+ points.setCaption(StringUtil.getMessage(R.string.approval_points));
|
|
|
pointsList.add(0, points);
|
|
|
ApprovaPresenter.this.pointsList = pointsList;
|
|
|
setData2ListThread();
|
|
|
@@ -1339,7 +1337,7 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
String[] tags = tag.split("\\$");
|
|
|
approval.setDfType(tags[0]);
|
|
|
String neer = tags[1];
|
|
|
- String data = OACheckUtil.getLastBracket(neer);
|
|
|
+ String data = StringUtil.getLastBracket(neer);
|
|
|
if (StringUtils.isEmpty(data)) {
|
|
|
data = "是;否";
|
|
|
}
|
|
|
@@ -1360,7 +1358,7 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
if (datas != null && datas.length > 0) {
|
|
|
for (String data : datas) {
|
|
|
if (data.startsWith(approval.getCaption())) {
|
|
|
- String values = OACheckUtil.getFirstBrackets(data);
|
|
|
+ String values = StringUtil.getFirstBrackets(data);
|
|
|
if (!StringUtils.isEmpty(values)
|
|
|
&& !values.equals("null")
|
|
|
&& !values.equals("(null)")
|
|
|
@@ -1392,7 +1390,7 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
}
|
|
|
|
|
|
private String getImageUrl(int id) {
|
|
|
- return Constants.getAppBaseUrl(MyApplication.getInstance()) + "common/downloadbyId.action?id=" + id + "&sessionId=" +
|
|
|
+ return CommonUtil.getAppBaseUrl(MyApplication.getInstance()) + "common/downloadbyId.action?id=" + id + "&sessionId=" +
|
|
|
CommonUtil.getSharedPreferences(MyApplication.getInstance(), "sessionId") +
|
|
|
"&sessionUser=" + CommonUtil.getSharedPreferences(MyApplication.getInstance(), "erp_username") +
|
|
|
"&master=" + CommonUtil.getSharedPreferences(MyApplication.getInstance(), "erp_master");
|
|
|
@@ -1412,14 +1410,14 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
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);
|
|
|
+ String message = StringUtil.getMessage(R.string.approval_points) + " " + approval.getCaption() + " " + StringUtil.getMessage(R.string.is_must_input);
|
|
|
iApproval.showToast(message, R.color.load_submit);
|
|
|
return false;
|
|
|
}
|
|
|
if (!StringUtils.isEmpty(approval.getCaption())
|
|
|
&& !StringUtils.isEmpty(approval.getValues()) && customDes != null) {
|
|
|
if (approval.getValues().contains("@")) {
|
|
|
- String message = OACheckUtil.getString(R.string.approval_points) + " " + approval.getCaption() + " 带有特殊字符";
|
|
|
+ String message = StringUtil.getMessage(R.string.approval_points) + " " + approval.getCaption() + " 带有特殊字符";
|
|
|
iApproval.showToast(message, R.color.load_submit);
|
|
|
return false;
|
|
|
}
|
|
|
@@ -1432,7 +1430,7 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- OACheckUtil.removieLast(customDes);
|
|
|
+ StringUtil.removieLast(customDes);
|
|
|
}
|
|
|
return true;
|
|
|
}
|
|
|
@@ -1475,11 +1473,11 @@ public class ApprovaPresenter implements OnHttpResultListener {
|
|
|
for (Approval approval : approvals) {
|
|
|
if (approval.isNeerInput()) {
|
|
|
if (StringUtils.isEmpty(approval.getValues())) {
|
|
|
- String message = OACheckUtil.getString(R.string.must_input_key) + " " + approval.getCaption() + " " + OACheckUtil.getString(R.string.is_must_input);
|
|
|
+ String message = StringUtil.getMessage(R.string.must_input_key) + " " + approval.getCaption() + " " + StringUtil.getMessage(R.string.is_must_input);
|
|
|
iApproval.showToast(message);
|
|
|
return null;
|
|
|
- } else if (StringUtils.isEmpty(StringUtils.string2Json(approval.getValues()))) {
|
|
|
- String message = OACheckUtil.getString(R.string.must_input_key) + " " + approval.getCaption() + " " + OACheckUtil.getString(R.string.limit_unno_zijie);
|
|
|
+ } else if (StringUtils.isEmpty(approval.getValues())) {
|
|
|
+ String message = StringUtil.getMessage(R.string.must_input_key) + " " + approval.getCaption() + " " + StringUtil.getMessage(R.string.limit_unno_zijie);
|
|
|
iApproval.showToast(message);
|
|
|
return null;
|
|
|
} else {
|