<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # 組件源碼 ``` /** * <b>方法描述:</b> 容器多層次賦值 <br/> * <b>創建者:</b> admin <br/> * <b>創建時間:</b> 2018-05-11 11:54:16 <br/> * * @param con * 入參|容器|{@link java.util.Map} * @param nestKey * 入參|多級key的list,傳入String類型標識Map的key,int標識集合下標:如['key1',0]| * {@link com.ylink.ide.trade.runtime.context.JavaList} * @param value * 入參|值|{@link Object} * @return -1 異常<br/> * 0 失敗<br/> * 1 成功<br/> */ @Component(label = "容器多層次賦值", style = "判斷型", type = "同步組件", comment = "容器中變量多層次嵌套key賦值,如:map的value仍是map等。只支持map/list多層級混合嵌套", version = "1.0.0", deprecated = true, author = "admin", date = "2018-05-17 03:44:24") @InParams(param = {@Param(name = "con", comment = "容器", type = java.util.Map.class), @Param(name = "nestKey", comment = "多級key的list,傳入String類型標識Map的key,int標識集合下標:如['key1',0]", type = com.ylink.ide.trade.runtime.context.JavaList.class), @Param(name = "value", comment = "值", type = Object.class)}) @Returns( returns = {@Return(id = "-1", desp = "異常"), @Return(id = "0", desp = "失敗"), @Return(id = "1", desp = "成功")}) public static ResultBase P_setNestsValue(Map con, JavaList nestKey, Object value) { if (con == null) return ResultBase.newFailureResult("TPTC2011", "容器不能為空(Null)"); if (nestKey == null || nestKey.isEmpty()) return ResultBase.newFailureResult("TPTC2011", "賦值的參數不能為空"); try { Object m = con; for (int i = 0; i < nestKey.size() - 1; i++) { Object obj = nestKey.get(i); Object subObj = nestKey.get(i + 1); if (obj instanceof String) { if (!(m instanceof Map)) { AppLog.error("key:{},對應的值不是map類型", (i - 1)); return ResultBase.newFailureResult("TPTC2012", "容器中對應的key:" + (i - 1) + ",對應的值不是map"); } if (subObj instanceof String) { // 創建MAP子節點 Object tmpObj = ((Map)m).get((String)obj); if (tmpObj == null || !(tmpObj instanceof Map)) { tmpObj = new JavaContainer(); ((Map)m).put((String)obj, tmpObj); } m = tmpObj; } else if (subObj instanceof Number) { // 創建LIST子節點 Object tmpObj = ((Map)m).get((String)obj); if (tmpObj == null || !(tmpObj instanceof List)) { tmpObj = new JavaList(); ((Map)m).put((String)obj, tmpObj); } m = tmpObj; } else { return ResultBase.newFailureResult("TPTC2016", "多層次賦值下級下標只能傳String|Int類型參數"); } } else if (obj instanceof Number) { int index = (Integer)obj; if (!(m instanceof List)) { AppLog.error("key:{},對應的值不是List類型", (i - 1)); return ResultBase.newFailureResult("TPTC2014", "容器中對應的key:" + (i - 1) + ",對應的值不是List"); } List list = (List)m; while (list.size() <= index) { list.add((subObj instanceof String) ? new JavaContainer() : new JavaList()); } m = list.get(index); } else { return ResultBase.newFailureResult("TPTC2015", "多層次賦值當前下標只能傳String|Int類型參數"); } } Object lastKey = nestKey.get(nestKey.size() - 1); if (lastKey instanceof String) { if (!(m instanceof Map)) { AppLog.error("key:{},對應的值不是map類型", (nestKey.size() - 2)); return ResultBase.newFailureResult("TPTC2017", "容器中對應的key:" + (nestKey.size() - 2) + ",對應的值不是map"); } ((Map)m).put((String)lastKey, value); } else if (lastKey instanceof Number) { int index = (Integer)lastKey; if (!(m instanceof List)) { AppLog.error("key:{},對應的值不是List類型", (nestKey.size() - 2)); return ResultBase.newFailureResult("TPTC2018", "容器中對應的key:" + (nestKey.size() - 2) + ",對應的值不是List"); } while (((List)m).size() <= index) { ((List)m).add(null); } ((List)m).remove(index); ((List)m).add(index, value); } else { return ResultBase.newFailureResult("TPTC2016", "葉節點下標只能傳String|Int類型參數"); } } catch (Exception e) { AppLog.error("容器多層次賦值異常:{}", e); return ResultBase.newExceptionResult("TPTC2019", "容器多層次賦值異常:" + AppLog.errorMsg(e)); } return ResultBase.newSuccessResult(); } ``` # 交易中組件使用方式 ![](https://img.kancloud.cn/00/e6/00e67174c663b467bdaa08034ffde079_1867x891.png) # 參數說明及示例 ## 入口參數 容器:一個 Map 對象,示例: `__INNER__` 多級key的list,傳入String類型標識Map的key,int標識集合下標:如['key1',0]:key 列表,示例: `["key1",0,"key2",1,"key3",2]` 值:給 key 賦值,示例: `["v1","v2"]`
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看