|
|
@@ -13,7 +13,7 @@ import com.xzjmyk.pm.activity.MyApplication;
|
|
|
import com.xzjmyk.pm.activity.R;
|
|
|
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.oa.Approval;
|
|
|
+import com.xzjmyk.pm.activity.ui.erp.model.oa.Approvals;
|
|
|
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;
|
|
|
@@ -58,12 +58,8 @@ public class ApprovalPresenter implements OnHttpResultListener {
|
|
|
private final int LOAD_FORMAND_GRIDDATA = 0x21;//当前明细表
|
|
|
|
|
|
private DBManager manager;
|
|
|
- private Approval.NodeRecord record;
|
|
|
- private List<Approval.ItemData> mainList;//主表
|
|
|
- private List<Approval.ItemData> detailedList;//明细表
|
|
|
- private List<Approval.ItemData> nodeList;//历史审批节点列表
|
|
|
- private List<Approval.ItemData> pointsList;//要点列表
|
|
|
- private List<Approval.Enclosure> enclosureList;//附件列表
|
|
|
+ private Approvals.NodeRecord record;
|
|
|
+ private List<Approvals.ItemData> pointsList;//要点列表,用于记录
|
|
|
|
|
|
private IApproval iApproval;
|
|
|
private boolean submiting;
|
|
|
@@ -85,14 +81,9 @@ public class ApprovalPresenter implements OnHttpResultListener {
|
|
|
}
|
|
|
|
|
|
private void initLoad(int nodeId) {
|
|
|
- iApproval.initStatus();
|
|
|
- record = new Approval.NodeRecord();
|
|
|
- mainList = new ArrayList<>();
|
|
|
- detailedList = new ArrayList<>();
|
|
|
- nodeList = new ArrayList<>();
|
|
|
- pointsList = new ArrayList<>();
|
|
|
- enclosureList = new ArrayList<>();
|
|
|
+ record = new Approvals.NodeRecord();
|
|
|
record.nodeId = nodeId;
|
|
|
+ iApproval.initStatus();
|
|
|
loadCurrentNode();
|
|
|
}
|
|
|
|
|
|
@@ -103,10 +94,48 @@ public class ApprovalPresenter implements OnHttpResultListener {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public void loadProcessUpdate(String nodeLog,
|
|
|
+ List<Approvals.ItemData> mainList,
|
|
|
+ List<Approvals.ItemData> detailedList
|
|
|
+ , List<Approvals.ItemData> pointsList) {
|
|
|
+ this.pointsList = pointsList;
|
|
|
+ if (!customDes(new StringBuilder(), pointsList))
|
|
|
+ return;
|
|
|
+ String url = "common/processUpdate.action";
|
|
|
+ Map<String, Object> param = new HashMap<>();
|
|
|
+ Map<String, Object> formStore = new HashMap<>();
|
|
|
+ List<Map<String, Object>> params = new ArrayList<>();
|
|
|
+ if (!putItem2FormStore(formStore, mainList)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (!putItem2Params(params, detailedList)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if ((formStore.isEmpty() || formStore.size() <= 1) && ListUtils.isEmpty(params)) {
|
|
|
+ LogUtil.i("formStore.isEmpty()&&ListUtils.isEmpty(params)");
|
|
|
+ agree(nodeLog);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ iApproval.showLoading();
|
|
|
+ param.put("caller", record.caller);
|
|
|
+ param.put("processInstanceId", record.processInstanceId);
|
|
|
+ String form = StringUtils.mapToJson(formStore);
|
|
|
+ param.put("formStore", StringUtils.isEmpty(form) ? "{}" : form);
|
|
|
+ param.put("param", StringUtils.mapToJson(params));
|
|
|
+ Bundle bundle = new Bundle();
|
|
|
+ bundle.putString("nodeLog", nodeLog);
|
|
|
+ Request.Bulider bulider = new Request.Bulider()
|
|
|
+ .setUrl(url)
|
|
|
+ .setBundle(bundle)
|
|
|
+ .setWhat(LOAD_PROCESS_UPDATE)
|
|
|
+ .setParam(param);
|
|
|
+ OAHttpHelper.getInstance().requestHttp(bulider.bulid(), this);
|
|
|
+ }
|
|
|
|
|
|
- public void agree(String nodeLog) {
|
|
|
+ private void agree(String nodeLog) {
|
|
|
StringBuilder customDes = new StringBuilder();
|
|
|
- if (!customDes(customDes)) return;
|
|
|
+ if (!customDes(customDes, pointsList)) return;
|
|
|
+ pointsList = new ArrayList<>();
|
|
|
LogUtil.i("customDes=" + customDes.toString());
|
|
|
if (!canSubmit()) return;
|
|
|
submiting = true;
|
|
|
@@ -167,7 +196,7 @@ public class ApprovalPresenter implements OnHttpResultListener {
|
|
|
param.put("taskId", record.nodeId);
|
|
|
param.put("assigneeId", emCode);//新处理人的员工编号
|
|
|
param.put("processInstanceId", record.processInstanceId);//流程实例id
|
|
|
- param.put("description", nodeLog.getText().toString());//流程实例id
|
|
|
+ param.put("description", OACheckUtil.getText(nodeLog));//流程实例id
|
|
|
param.put("_center", "0");//是否集团账套
|
|
|
param.put("_noc", 1);//权限管控
|
|
|
Request.Bulider bulider = new Request.Bulider()
|
|
|
@@ -195,6 +224,8 @@ public class ApprovalPresenter implements OnHttpResultListener {
|
|
|
|
|
|
public void loadNextProcess() {
|
|
|
iApproval.showLoading();
|
|
|
+ if (submiting) return;
|
|
|
+ submiting = true;
|
|
|
String url = "common/getNextProcess.action";
|
|
|
Map<String, Object> param = new HashMap<>();
|
|
|
param.put("taskId", record.nodeId);
|
|
|
@@ -296,40 +327,6 @@ public class ApprovalPresenter implements OnHttpResultListener {
|
|
|
OAHttpHelper.getInstance().requestHttp(bulider.bulid(), this);
|
|
|
}
|
|
|
|
|
|
- public boolean loadProcessUpdate(String nodeLog) {
|
|
|
- String url = "common/processUpdate.action";
|
|
|
- Map<String, Object> param = new HashMap<>();
|
|
|
- Map<String, Object> formStore = new HashMap<>();
|
|
|
- List<Map<String, Object>> params = new ArrayList<>();
|
|
|
- LogUtil.i("loadProcessUpdate");
|
|
|
- if (!putItem2FormStore(formStore)) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (!putItem2Params(params)) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- if ((formStore.isEmpty() || formStore.size() <= 1) && ListUtils.isEmpty(params)) {
|
|
|
- LogUtil.i("formStore.isEmpty()&&ListUtils.isEmpty(params)");
|
|
|
- agree(nodeLog);
|
|
|
- return true;
|
|
|
- }
|
|
|
- iApproval.showLoading();
|
|
|
- param.put("caller", record.caller);
|
|
|
- param.put("processInstanceId", record.processInstanceId);
|
|
|
- String form = StringUtils.mapToJson(formStore);
|
|
|
- param.put("formStore", StringUtils.isEmpty(form) ? "{}" : form);
|
|
|
- param.put("param", StringUtils.mapToJson(params));
|
|
|
- Bundle bundle = new Bundle();
|
|
|
- bundle.putString("nodeLog", nodeLog);
|
|
|
- Request.Bulider bulider = new Request.Bulider()
|
|
|
- .setUrl(url)
|
|
|
- .setBundle(bundle)
|
|
|
- .setWhat(LOAD_PROCESS_UPDATE)
|
|
|
- .setParam(param);
|
|
|
- OAHttpHelper.getInstance().requestHttp(bulider.bulid(), this);
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
|
|
|
@Override
|
|
|
public void result(int what, boolean isJSON, String message, Bundle bundle) {
|
|
|
@@ -354,6 +351,7 @@ public class ApprovalPresenter implements OnHttpResultListener {
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
+ submiting = false;
|
|
|
break;
|
|
|
case LOAD_JNODES:
|
|
|
handlerNode(object);
|
|
|
@@ -425,13 +423,16 @@ public class ApprovalPresenter implements OnHttpResultListener {
|
|
|
public void error(int what, String message, Bundle bundle) {
|
|
|
if (StringUtils.isEmpty(message)) return;
|
|
|
iApproval.dimssLoading();
|
|
|
+ submiting = false;
|
|
|
if (what == LOAD_AGREE && message.contains("程序错误")) {
|
|
|
loadEndProcess();
|
|
|
- submiting = false;
|
|
|
} else {
|
|
|
- String errorKey = "esss";
|
|
|
+ String errorKey = "exceptionInfo";
|
|
|
if (new JsonValidator().validate(message) && !StringUtils.isEmpty(getJson2Text(parseObject(message), errorKey))) {
|
|
|
- iApproval.showToast(getJson2Text(parseObject(message), errorKey), R.color.load_submit);
|
|
|
+ LogUtil.i("new JsonValidator().validate(message) && !StringUtils.isEmpty(getJson2Text(parseObject(message), errorKey)");
|
|
|
+ String remain = getJson2Text(parseObject(message), errorKey);
|
|
|
+ LogUtil.i("remain=" + remain);
|
|
|
+ iApproval.showToast(remain, R.color.load_submit);
|
|
|
} else {
|
|
|
iApproval.showToast(message, R.color.load_submit);
|
|
|
}
|
|
|
@@ -493,7 +494,7 @@ public class ApprovalPresenter implements OnHttpResultListener {
|
|
|
loadDetailedList();
|
|
|
loadCustomSetupOfTask();
|
|
|
} else {
|
|
|
- //TODO 由于个别原因出现的错误
|
|
|
+ submiting = false;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -508,8 +509,9 @@ public class ApprovalPresenter implements OnHttpResultListener {
|
|
|
}
|
|
|
});
|
|
|
if (!ListUtils.isEmpty(formconfigs) && formdata != null) {
|
|
|
- List<Approval.ItemData> itemDatas = setData2List(formdata, formconfigs);
|
|
|
+ List<Approvals.ItemData> itemDatas = setData2List(formdata, formconfigs);
|
|
|
if (!ListUtils.isEmpty(itemDatas)) {
|
|
|
+ final List<Approvals.ItemData> mainList = new ArrayList<>();
|
|
|
mainList.addAll(itemDatas);
|
|
|
OAHttpHelper.getInstance().post(new Runnable() {
|
|
|
@Override
|
|
|
@@ -521,14 +523,15 @@ public class ApprovalPresenter implements OnHttpResultListener {
|
|
|
}
|
|
|
JSONArray griddatas = OACheckUtil.getJsonArray(object, "griddata");
|
|
|
JSONArray gridconfigs = OACheckUtil.getJsonArray(object, "gridconfigs");
|
|
|
+ final List<Approvals.ItemData> detailedList = new ArrayList<>();
|
|
|
if (!ListUtils.isEmpty(griddatas) && !ListUtils.isEmpty(gridconfigs)) {
|
|
|
for (int i = 0; i < griddatas.size(); i++) {
|
|
|
//获取到单个明细表单
|
|
|
- List<Approval.ItemData> itemDatas = setData2List(griddatas.getJSONObject(i), gridconfigs);
|
|
|
+ List<Approvals.ItemData> itemDatas = setData2List(griddatas.getJSONObject(i), gridconfigs);
|
|
|
if (!ListUtils.isEmpty(itemDatas)) {
|
|
|
- Approval.ItemData itemData = new Approval.ItemData();
|
|
|
+ Approvals.ItemData itemData = new Approvals.ItemData();
|
|
|
itemData.key = MyApplication.getInstance().getString(R.string.serial_number) + (i + 1);
|
|
|
- itemData.type = Approval.ItemType.TAG;
|
|
|
+ itemData.type = Approvals.ItemType.TAG;
|
|
|
itemDatas.add(0, itemData);
|
|
|
detailedList.addAll(itemDatas);
|
|
|
}
|
|
|
@@ -556,11 +559,12 @@ public class ApprovalPresenter implements OnHttpResultListener {
|
|
|
}
|
|
|
|
|
|
private void handlerEnclosure(JSONArray array) throws Exception {
|
|
|
+ List<Approvals.Enclosure> enclosureList = new ArrayList<>();
|
|
|
if (!ListUtils.isEmpty(array)) {
|
|
|
for (int i = 0; i < array.size(); i++) {
|
|
|
JSONObject o = array.getJSONObject(i);
|
|
|
if (o == null) continue;
|
|
|
- Approval.Enclosure enclosure = new Approval.Enclosure();
|
|
|
+ Approvals.Enclosure enclosure = new Approvals.Enclosure();
|
|
|
enclosure.reId = OACheckUtil.getJsonIntager(o, "fp_id");
|
|
|
// enclosure.url = baseUrl + OACheckUtil.getJson2Text(o, "fp_path");
|
|
|
enclosure.url = getImageUrl(enclosure.reId);
|
|
|
@@ -571,15 +575,15 @@ public class ApprovalPresenter implements OnHttpResultListener {
|
|
|
iApproval.showEnclosureList(enclosureList);
|
|
|
}
|
|
|
|
|
|
- private List<Approval.ItemData> setData2List(JSONObject data, JSONArray configs) throws Exception {
|
|
|
- List<Approval.ItemData> itemDatas = new ArrayList<>();
|
|
|
+ private List<Approvals.ItemData> setData2List(JSONObject data, JSONArray configs) throws Exception {
|
|
|
+ List<Approvals.ItemData> itemDatas = new ArrayList<>();
|
|
|
String idTag = "";
|
|
|
int id = 0;
|
|
|
StringBuilder merged = new StringBuilder();
|
|
|
for (int i = 0; i < configs.size(); i++) {
|
|
|
JSONObject config = configs.getJSONObject(i);
|
|
|
if (config == null) continue;
|
|
|
- Approval.ItemData itemData = new Approval.ItemData();
|
|
|
+ Approvals.ItemData itemData = new Approvals.ItemData();
|
|
|
String key = getJson2Text(config, "FD_CAPTION", "DG_CAPTION");//获取第一个字段字段名称
|
|
|
String valueKey = getJson2Text(config, "FD_FIELD", "DG_FIELD");
|
|
|
String type = getJson2Text(config, "FD_TYPE", "DG_TYPE");
|
|
|
@@ -597,41 +601,22 @@ public class ApprovalPresenter implements OnHttpResultListener {
|
|
|
boolean mergeAble = OACheckUtil.getJsonIntager(config, "FD_APPWIDTH", "FD_APPWIDTH") == 1 || "MT".equals(OACheckUtil.getJson2Text(config, "FD_TYPE"));
|
|
|
itemData.key = key;
|
|
|
itemData.valuesTag = valueKey;
|
|
|
- if (type.equals("D")) {
|
|
|
- long time = TimeUtils.f_str_2_long(value);
|
|
|
- if (time > 0) {
|
|
|
- itemData.values = TimeUtils.s_long_2_str(time);
|
|
|
- } else {
|
|
|
- itemData.values = value;
|
|
|
- }
|
|
|
- } else if ("C".equals(type)) {
|
|
|
- if (value.equals("0") || value.equals("-1")) {
|
|
|
- if (value.equals("0")) itemData.values = "是";
|
|
|
- else itemData.values = "否";
|
|
|
- } else {
|
|
|
- itemData.values = value;
|
|
|
- }
|
|
|
- } else {
|
|
|
- itemData.values = value;
|
|
|
- }
|
|
|
+ itemData.values = value;
|
|
|
+ itemData.fdType = type;
|
|
|
+ itemData.data2Values();
|
|
|
itemData.mustInput = true;
|
|
|
- if (type.equals("D")) {
|
|
|
- itemData.inputType = 2;
|
|
|
- } else if (type.equals("floatcolumn8")) {
|
|
|
- itemData.inputType = 4;
|
|
|
- } else {
|
|
|
- itemData.inputType = 1;
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
if (!StringUtils.isEmpty(record.needInputKeys) && record.needInputKeys.contains(valueKey) && record.status == 1) {
|
|
|
- if ("C".equals(type)) {
|
|
|
+ if (itemData.isSelect()) {
|
|
|
itemData.data = "是;否";
|
|
|
- itemData.type = Approval.ItemType.SELECT;
|
|
|
+ itemData.type = Approvals.ItemType.SELECT;
|
|
|
} else {
|
|
|
- itemData.type = Approval.ItemType.P;
|
|
|
+ itemData.type = Approvals.ItemType.P;
|
|
|
}
|
|
|
} else {
|
|
|
if (StringUtils.isEmpty(itemData.values)) continue;//如果不是要输入的对象,同时显示值为空,需要隐藏去
|
|
|
- itemData.type = Approval.ItemType.V;
|
|
|
+ itemData.type = Approvals.ItemType.V;
|
|
|
}
|
|
|
if (mergeAble) {
|
|
|
String valueTagKey = getJson2Text(config, "FD_LOGICTYPE", "DG_LOGICTYPE");//获取第二个值的key
|
|
|
@@ -646,7 +631,7 @@ public class ApprovalPresenter implements OnHttpResultListener {
|
|
|
itemDatas.add(itemData);
|
|
|
}
|
|
|
if (!StringUtils.isEmpty(idTag) && id > 0 && !ListUtils.isEmpty(itemDatas)) {
|
|
|
- for (Approval.ItemData itemData : itemDatas) {
|
|
|
+ for (Approvals.ItemData itemData : itemDatas) {
|
|
|
itemData.idTag = idTag;
|
|
|
itemData.id = id;
|
|
|
}
|
|
|
@@ -670,16 +655,16 @@ public class ApprovalPresenter implements OnHttpResultListener {
|
|
|
JSONArray nodes = OACheckUtil.getJsonArray(object, "nodes");
|
|
|
JSONArray processs = OACheckUtil.getJsonArray(object, "processs");
|
|
|
JSONArray datas = OACheckUtil.getJsonArray(object, "data");
|
|
|
- List<Approval.ItemData> itemDatas = getNodDatas(datas);
|
|
|
+ List<Approvals.ItemData> itemDatas = getNodDatas(datas);
|
|
|
if (!ListUtils.isEmpty(processs)) {
|
|
|
mergeNode(processs, itemDatas, false);
|
|
|
}
|
|
|
if (!ListUtils.isEmpty(nodes)) {
|
|
|
mergeNode(nodes, itemDatas, true);
|
|
|
}
|
|
|
- for (Approval.ItemData itemData : itemDatas) {
|
|
|
+ for (Approvals.ItemData itemData : itemDatas) {
|
|
|
if (!StringUtils.isEmpty(itemData.values)) {
|
|
|
- if (itemData.status.contains("待审批") && record.status == 2) {
|
|
|
+ if (StringUtils.isEmpty(itemData.status) || (itemData.status.contains("待审批") && record.status == 2)) {
|
|
|
record.status = 0;
|
|
|
}
|
|
|
String[] emcode = itemData.values.split(",");
|
|
|
@@ -689,7 +674,7 @@ public class ApprovalPresenter implements OnHttpResultListener {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- nodeList = itemDatas;
|
|
|
+ final List<Approvals.ItemData> nodeList = itemDatas;
|
|
|
OAHttpHelper.getInstance().post(new Runnable() {
|
|
|
@Override
|
|
|
public void run() {
|
|
|
@@ -710,7 +695,7 @@ public class ApprovalPresenter implements OnHttpResultListener {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- private void mergeNode(JSONArray array, List<Approval.ItemData> itemDatas, boolean isLog) {
|
|
|
+ private void mergeNode(JSONArray array, List<Approvals.ItemData> itemDatas, boolean isLog) {
|
|
|
for (int i = 0; i < array.size(); i++) {
|
|
|
JSONObject o = array.getJSONObject(i);
|
|
|
String name = OACheckUtil.getJson2Text(o, "jp_nodeName", "jn_name");//节点名称
|
|
|
@@ -719,7 +704,7 @@ public class ApprovalPresenter implements OnHttpResultListener {
|
|
|
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");//执行操作
|
|
|
- for (Approval.ItemData itemData : itemDatas) {
|
|
|
+ for (Approvals.ItemData itemData : itemDatas) {
|
|
|
if (name.equals(itemData.valuesTag)) {//为当前结点
|
|
|
if (!isLog) {
|
|
|
itemData.values = nodeDealCode;
|
|
|
@@ -744,14 +729,14 @@ public class ApprovalPresenter implements OnHttpResultListener {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private List<Approval.ItemData> getNodDatas(JSONArray datas) {
|
|
|
- List<Approval.ItemData> itemDatas = new ArrayList<>();
|
|
|
+ private List<Approvals.ItemData> getNodDatas(JSONArray datas) {
|
|
|
+ List<Approvals.ItemData> itemDatas = 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");
|
|
|
- Approval.ItemData itemData = new Approval.ItemData();
|
|
|
+ Approvals.ItemData itemData = new Approvals.ItemData();
|
|
|
itemData.key = manName;
|
|
|
itemData.values = emCode;
|
|
|
itemData.valuesTag = nodeName;
|
|
|
@@ -780,8 +765,9 @@ public class ApprovalPresenter implements OnHttpResultListener {
|
|
|
//需要把该数据填充到对应上面
|
|
|
datas = data.split(";");
|
|
|
}
|
|
|
+ List<Approvals.ItemData> pointsList = new ArrayList<>();
|
|
|
for (int i = 0; i < arrayCS.size(); i++) {
|
|
|
- Approval.ItemData itemData = getItemBySetupTask(arrayCS.getString(i), datas);
|
|
|
+ Approvals.ItemData itemData = getItemBySetupTask(arrayCS.getString(i), datas);
|
|
|
if (itemData != null) {
|
|
|
pointsList.add(itemData);
|
|
|
}
|
|
|
@@ -800,10 +786,10 @@ public class ApprovalPresenter implements OnHttpResultListener {
|
|
|
* ..$N为非必填字段,
|
|
|
* ..$Y表示该字段为必填字段,
|
|
|
*/
|
|
|
- private Approval.ItemData getItemBySetupTask(String cs, String[] datas) throws Exception {
|
|
|
+ private Approvals.ItemData getItemBySetupTask(String cs, String[] datas) throws Exception {
|
|
|
if (!StringUtils.isEmpty(cs)) {
|
|
|
LogUtil.i("cs=" + cs);
|
|
|
- Approval.ItemData itemData = new Approval.ItemData();
|
|
|
+ Approvals.ItemData itemData = new Approvals.ItemData();
|
|
|
String[] css = cs.split("\\^");
|
|
|
LogUtil.i("css[0]=" + css[0]);
|
|
|
LogUtil.i("css[1]=" + css[1]);
|
|
|
@@ -820,29 +806,29 @@ public class ApprovalPresenter implements OnHttpResultListener {
|
|
|
//1数字 2.日期 3|0.字符
|
|
|
if ("D".equals(inputType)) {
|
|
|
itemData.inputType = 2;
|
|
|
- itemData.type = Approval.ItemType.DATE;
|
|
|
+ itemData.type = Approvals.ItemType.DATE;
|
|
|
} else if ("N".equals(inputType)) {
|
|
|
itemData.inputType = 1;
|
|
|
- itemData.type = Approval.ItemType.P;
|
|
|
+ itemData.type = Approvals.ItemType.P;
|
|
|
} else if ("C".equals(inputType)) {
|
|
|
itemData.data = OACheckUtil.getLastBracket(neer);
|
|
|
if (StringUtils.isEmpty(itemData.data)) {
|
|
|
- itemData.type = Approval.ItemType.P;
|
|
|
+ itemData.type = Approvals.ItemType.P;
|
|
|
} else {
|
|
|
- itemData.type = Approval.ItemType.SELECT;
|
|
|
+ itemData.type = Approvals.ItemType.SELECT;
|
|
|
}
|
|
|
} else if ("B".equals(inputType)) {
|
|
|
itemData.data = OACheckUtil.getLastBracket(neer);
|
|
|
if (StringUtils.isEmpty(itemData.data)) {
|
|
|
itemData.data = "是;否";
|
|
|
}
|
|
|
- itemData.type = Approval.ItemType.SELECT;
|
|
|
+ itemData.type = Approvals.ItemType.SELECT;
|
|
|
} else {
|
|
|
itemData.inputType = 3;
|
|
|
- itemData.type = Approval.ItemType.P;
|
|
|
+ itemData.type = Approvals.ItemType.P;
|
|
|
}
|
|
|
} else {
|
|
|
- itemData.type = Approval.ItemType.P;
|
|
|
+ itemData.type = Approvals.ItemType.P;
|
|
|
}
|
|
|
if (!StringUtils.isEmpty(neer)) {
|
|
|
itemData.mustInput = neer.contains("Y");
|
|
|
@@ -859,11 +845,11 @@ public class ApprovalPresenter implements OnHttpResultListener {
|
|
|
}
|
|
|
}
|
|
|
if (record.status != 1) {
|
|
|
- itemData.type = Approval.ItemType.V;
|
|
|
+ itemData.type = Approvals.ItemType.V;
|
|
|
}
|
|
|
itemData.editBg = 0;
|
|
|
itemData.editGravity = Gravity.RIGHT;
|
|
|
- if (itemData.type == Approval.ItemType.V && StringUtils.isEmpty(itemData.values))
|
|
|
+ if (itemData.type == Approvals.ItemType.V && StringUtils.isEmpty(itemData.values))
|
|
|
return null;
|
|
|
return itemData;
|
|
|
}
|
|
|
@@ -872,10 +858,10 @@ public class ApprovalPresenter implements OnHttpResultListener {
|
|
|
}
|
|
|
|
|
|
//判断要点
|
|
|
- private boolean customDes(StringBuilder customDes) {
|
|
|
+ private boolean customDes(StringBuilder customDes, List<Approvals.ItemData> pointsList) {
|
|
|
if (!ListUtils.isEmpty(pointsList)) {
|
|
|
LogUtil.i("show Presenter pointsList .....");
|
|
|
- for (Approval.ItemData itemData : pointsList) {
|
|
|
+ for (Approvals.ItemData itemData : pointsList) {
|
|
|
LogUtil.i(itemData.toString());
|
|
|
if (itemData.mustInput && StringUtils.isEmpty(itemData.values)) {
|
|
|
String message = OACheckUtil.getString(R.string.approval_points) + " " + itemData.key + " " + OACheckUtil.getString(R.string.is_must_input);
|
|
|
@@ -891,23 +877,15 @@ public class ApprovalPresenter implements OnHttpResultListener {
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
- private boolean putItem2FormStore(Map<String, Object> formstore) {
|
|
|
+ private boolean putItem2FormStore(Map<String, Object> formstore, List<Approvals.ItemData> mainList) {
|
|
|
if (!ListUtils.isEmpty(mainList)) {
|
|
|
- for (Approval.ItemData itemData : mainList) {
|
|
|
+ for (Approvals.ItemData itemData : mainList) {
|
|
|
if (StringUtils.isEmpty(itemData.key)) continue;
|
|
|
LogUtil.i(itemData.toString());
|
|
|
formstore.put(itemData.idTag, itemData.id);
|
|
|
- if (itemData.type == Approval.ItemType.P || itemData.type == Approval.ItemType.SELECT || itemData.type == Approval.ItemType.DATE) {
|
|
|
+ if (itemData.type == Approvals.ItemType.P || itemData.type == Approvals.ItemType.SELECT || itemData.type == Approvals.ItemType.DATE) {
|
|
|
if (!StringUtils.isEmpty(itemData.values)) {
|
|
|
- if (itemData.type == Approval.ItemType.SELECT) {
|
|
|
- if (itemData.values.equals("是"))
|
|
|
- formstore.put(itemData.valuesTag, 0);
|
|
|
- else if (itemData.values.equals("否"))
|
|
|
- formstore.put(itemData.valuesTag, -1);
|
|
|
- else
|
|
|
- formstore.put(itemData.valuesTag, itemData.values);
|
|
|
- } else
|
|
|
- formstore.put(itemData.valuesTag, itemData.values);
|
|
|
+ formstore.put(itemData.valuesTag,itemData. getValues());
|
|
|
} else {
|
|
|
String message = OACheckUtil.getString(R.string.must_input_key) + " " + itemData.key + " " + OACheckUtil.getString(R.string.is_must_input);
|
|
|
iApproval.showToast(message);
|
|
|
@@ -921,13 +899,12 @@ public class ApprovalPresenter implements OnHttpResultListener {
|
|
|
}
|
|
|
|
|
|
|
|
|
- private boolean putItem2Params(List<Map<String, Object>> params) {
|
|
|
- LogUtil.i("setItem2Map");
|
|
|
+ private boolean putItem2Params(List<Map<String, Object>> params, List<Approvals.ItemData> detailedList) {
|
|
|
if (!ListUtils.isEmpty(detailedList)) {
|
|
|
Map<String, Object> param = null;
|
|
|
- for (Approval.ItemData itemData : detailedList) {
|
|
|
+ for (Approvals.ItemData itemData : detailedList) {
|
|
|
if (StringUtils.isEmpty(itemData.key)) continue;
|
|
|
- if (param == null || itemData.type == Approval.ItemType.TAG) {
|
|
|
+ if (param == null || itemData.type == Approvals.ItemType.TAG) {
|
|
|
if (param != null && !param.isEmpty()) {
|
|
|
LogUtil.i("params.add(param)111");
|
|
|
params.add(param);
|
|
|
@@ -937,17 +914,10 @@ public class ApprovalPresenter implements OnHttpResultListener {
|
|
|
}
|
|
|
LogUtil.i(itemData.toString());
|
|
|
param.put(itemData.idTag, itemData.id);
|
|
|
- if (itemData.type == Approval.ItemType.P || itemData.type == Approval.ItemType.SELECT || itemData.type == Approval.ItemType.DATE) {
|
|
|
+ if (itemData.type == Approvals.ItemType.P || itemData.type == Approvals.ItemType.SELECT || itemData.type == Approvals.ItemType.DATE) {
|
|
|
if (!StringUtils.isEmpty(itemData.values)) {
|
|
|
- if (itemData.type == Approval.ItemType.SELECT) {
|
|
|
- if (itemData.values.equals("是"))
|
|
|
- param.put(itemData.valuesTag, 0);
|
|
|
- else if (itemData.values.equals("否"))
|
|
|
- param.put(itemData.valuesTag, -1);
|
|
|
- else
|
|
|
- param.put(itemData.valuesTag, itemData.values);
|
|
|
- } else
|
|
|
- param.put(itemData.valuesTag, itemData.values);
|
|
|
+ param.put(itemData.valuesTag,itemData. getValues());
|
|
|
+
|
|
|
} else {
|
|
|
String message = OACheckUtil.getString(R.string.must_input_key) + " " + itemData.key + " " + OACheckUtil.getString(R.string.is_must_input);
|
|
|
iApproval.showToast(message);
|