puzhibing
2023-06-30 f58cca364b731eac2d60a440ffaa804be3cd43fd
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TSystemConfigController.java
@@ -146,23 +146,29 @@
                .last("LIMIT 1"));
        JSONObject jsonObject = JSONObject.parseObject(tSystemConfig.getContent());
        JSONArray array = jsonObject.getJSONArray("ChargeStandard");
        JSONArray objects = new JSONArray();
        for (int i = 0; i < array.size(); i++) {
            JSONObject jsonObject1 = JSONObject.parseObject(JSONObject.toJSONString(array.get(i)));
            if(i == 0){
                jsonObject1.put("key",0);
            }else {
                jsonObject1.put("key",1);
            }
            objects.add(jsonObject1);
        JSONObject defaule = array.getJSONObject(0);
        JSONArray num3 = defaule.getJSONArray("num3");
        for (int i = 0; i < num3.size(); i++) {
            JSONObject jsonObject1 = num3.getJSONObject(i);
            jsonObject1.put("index", i);
        }
        JSONArray array1 = new JSONArray();
        for (int i = 1; i < array.size(); i++) {
            JSONObject jsonObject1 = array.getJSONObject(i);
            JSONArray num32 = jsonObject1.getJSONArray("num3");
            for (int j = 0; j < num32.size(); j++) {
                JSONObject jsonObject2 = num32.getJSONObject(j);
                jsonObject2.put("index", j);
            }
            array1.add(array.get(i));
        }
        model.addAttribute("defaule", defaule);
        model.addAttribute("array", array1);
        TSystemConfig config = tSystemConfigService.selectOne(new EntityWrapper<TSystemConfig>().eq("type", 8)
                .last("LIMIT 1"));
        JSONObject jsonObj = JSONObject.parseObject(config.getContent());
        Integer zcOne = jsonObj.getInteger("num1");
        model.addAttribute("zcOne",zcOne);
        model.addAttribute("array",objects);
        model.addAttribute("zcOne", zcOne);
        JSONObject extraCost = JSONObject.parseObject(jsonObject.getString("ExtraCost"));
        model.addAttribute("ExtraCost",extraCost);
        return PREFIX + "tSystemConfigPriceRules.html";