EKP qhky 流程启接口addReview 支持明细表地址本传递多值

 

问题描述:  流程启动接口(addReview),给第一行多人员地址本字段  传多个部门,后台代码解析不成功

 

 

 

 

							/**
							 *
							 *  20230703定制处理附件列表问题sjx
							 *
							 * **/


							for (int i = 0; i < attForms.size(); i++) {
								String fdKey = attForms.get(i).getFdKey();
								if (StringUtil.isNotNull(fdKey)) {
									if (fdKey.indexOf("liebiao") != -1) {
										fdKey = fdKey.replace("liebiao", "");
										String uuid = UUID.randomUUID().toString().replace("-", "");
										attForms.get(i).setFdKey(uuid);
										ArrayList<HashMap> o = (ArrayList<HashMap>) kmReviewMain.getExtendDataFormInfo().getFormData().get("fd_3be5996b465510");
										HashMap hashMap = o.get(i);
										hashMap.put(fdKey, uuid);
									}
								}
							}

							/**
							 *
							 *  -------------------------------------------------------
							 *
							 * **/


							if (formData.get("fd_3c61c27c02d270") != null) {
								ArrayList<HashMap> hashMapArrayList = (ArrayList<HashMap>) kmReviewMain.getExtendDataFormInfo().getFormData().get("fd_3c61c27c02d270");
								setHgjhDetailValue(hashMapArrayList);
						}

  

 

	public ArrayList<HashMap> setHgjhDetailValue(ArrayList<HashMap> hashMapArrayList) {

		try {
			String ids = "";
			String names = "";
			boolean flag = false;
			String filedId = "";
			String type = "";
			String fd_reform_dept = "fd_reform_dept";
			String fd_reform_person = "fd_reform_person";
			String fd_reform_comper_dept = "fd_reform_comper_dept";
			String fd_reform_comper_person = "fd_reform_comper_person";
			String fd_reform_charge_person = "fd_reform_charge_person";

			Iterator<HashMap> iterator = hashMapArrayList.iterator();
			while (iterator.hasNext()) {
				HashMap map = iterator.next();
				HashMap copyMap = new HashMap();
				for (Object key : map.keySet()) {

					if (fd_reform_dept.equals(key)) {
						filedId = "fd_3c61c32da39346";
						type = "dept";
						flag = true;
					} else if (fd_reform_person.equals(key)) {
						filedId = "fd_3c61c3302ef18c";
						type = "person";
						flag = true;
					} else if (fd_reform_comper_dept.equals(key)) {
						filedId = "fd_3c61c335032fd6";
						type = "dept";
						flag = true;
					} else if (fd_reform_comper_person.equals(key)) {
						filedId = "fd_3c61c3380d46e6";
						type = "person";
						flag = true;
					} else if (fd_reform_charge_person.equals(key)) {
						filedId = "fd_3c61c341e0b57a";
						type = "person";
						flag = true;
					}

					if (flag) {
						ids = (String) map.get(key);
						names = getOrgOrPostName(ids, type);
						HashMap reform = new HashMap();
						if (StringUtil.isNotNull(ids)) {
							reform.put("id", ids);
							reform.put("name", names);
							copyMap.put(filedId, reform);
						}
					}
				}

				for (Object key : copyMap.keySet()) {
					map.put(key, copyMap.get(key));
				}
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}

	public String getOrgOrPostName(String ids, String type) {
		StringBuilder strBuild = null;
		try {
			String[] arr = ids.split(";");
			strBuild = new StringBuilder();
			for (String s : arr) {
				String value = "";
				if ("dept".equals(type)) {
					System.out.println(s);
					SysOrgDept sysOrgDept = (SysOrgDept) getSysOrgDeptService().findByPrimaryKey(s, null, true);
					if (sysOrgDept != null) {
						value = sysOrgDept.getFdName();
					}
				} else {
					SysOrgElement sysOrgElement = (SysOrgElement) getSysOrgElementService().findByPrimaryKey(s, null, true);
					if (sysOrgElement != null) {
						value = sysOrgElement.getFdName();
					}
				}
				if (StringUtil.isNotNull(value)) {
					if (strBuild.length() == 0) {
						strBuild.append(value);
					} else {
						strBuild.append(";" + value);
					}
				}
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		return strBuild.toString();
	}

  

 

posted @ 2023-12-25 10:04  CrushGirl  阅读(30)  评论(0编辑  收藏  举报