puzhibing
2023-06-01 c4a098e3f88bc5071e36b92b9e5dcceb51129957
management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/THtmlController.java
@@ -1,5 +1,7 @@
package com.stylefeng.guns.modular.system.controller.general;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.stylefeng.guns.core.base.controller.BaseController;
import com.stylefeng.guns.modular.system.controller.util.LabelReplaceUtil;
@@ -14,6 +16,8 @@
import org.springframework.web.bind.annotation.RequestParam;
import com.stylefeng.guns.modular.system.model.THtml;
import com.stylefeng.guns.modular.system.service.ITHtmlService;
import java.util.Objects;
/**
 * 控制器
@@ -104,7 +108,7 @@
    public String startingFareExplain(Model model) {
        THtml html = queryHtmlByType(HtmlTypeEnum.SPECIFICATION_STARTING_PRICE.getCode());
        model.addAttribute("html",html);
        return PREFIX + "estimatedPriceExplain.html";
        return PREFIX + "startingFareExplain.html";
    }
    /**
@@ -128,6 +132,52 @@
    }
    /**
     * 跳转到代驾服务协议与隐私政策保护,法律条款,个人信息处理规则
     */
    @RequestMapping("/agreementExplain")
    public String agentDrivingServiceExplain(Integer type,Model model) {
        THtml one = queryHtmlByType(HtmlTypeEnum.AGENT_DRIVING_SERVICE_EXPLAIN.getCode());
        model.addAttribute("one",one);
        THtml two = queryHtmlByType(HtmlTypeEnum.CLAUSE.getCode());
        model.addAttribute("two",two);
        THtml three = queryHtmlByType(HtmlTypeEnum.PERSONAL_INFORMATION_RULES.getCode());
        model.addAttribute("three",three);
        return PREFIX + "agreementExplain.html";
    }
    /**
     * 跳转到加盟基本要求
     */
    @RequestMapping("/requirementsJoinExplain")
    public String requirementsJoinExplain(Model model) {
        THtml tHtml = queryHtmlByType(HtmlTypeEnum.BASIC_REQUIREMENTS_JOINING.getCode());
        JSONObject jsonObject = JSONObject.parseObject(tHtml.getHtml());
        JSONArray rules = jsonObject.getJSONArray("rules");
        JSONArray objects = new JSONArray();
        for (int i = 0; i < rules.size(); i++) {
            JSONObject jsonObject1 = JSONObject.parseObject(JSONObject.toJSONString(rules.get(i)));
            if(i == 0){
                jsonObject1.put("key",0);
            }else {
                jsonObject1.put("key",1);
            }
            objects.add(jsonObject1);
        }
        model.addAttribute("array",objects);
        model.addAttribute("id",tHtml.getId());
        return PREFIX + "requirementsJoinExplain.html";
    }
    /**
     * 跳转到代驾服务协议与隐私政策保护,法律条款,个人信息处理规则
     */
    @RequestMapping("/agreement")
    @ResponseBody
    public Object agreement(Integer type) {
        return queryHtmlByType(type);
    }
    /**
     * 获取列表
     */
    @RequestMapping(value = "/list")