From 3ef0e72a9361a8d4dc23c2825c78711d3e3c3f71 Mon Sep 17 00:00:00 2001
From: xuhy <3313886187@qq.com>
Date: 星期五, 24 三月 2023 18:12:20 +0800
Subject: [PATCH] 基础信息管理

---
 management/guns-admin/src/main/webapp/WEB-INF/view/system/tHtml/cancellationAgreement.html                         |   41 +
 management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TBroadcastServiceImpl.java      |    8 
 management/guns-admin/src/main/webapp/WEB-INF/view/system/tBroadcast/tBroadcast_edit.html                          |   18 
 management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITBroadcastService.java              |    2 
 management/guns-admin/src/main/webapp/WEB-INF/view/system/tHtml/estimatedPriceExplain.html                         |   41 +
 management/guns-admin/src/main/webapp/WEB-INF/view/system/tHtml/startingFareExplain.html                           |   41 +
 management/guns-admin/src/main/webapp/WEB-INF/view/system/tHtml/tHtml_add.html                                     |   29 +
 management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITHtmlService.java                   |   16 
 management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/enums/HtmlTypeEnum.java                      |   63 +++
 management/guns-admin/src/main/webapp/WEB-INF/view/system/tHtml/tHtml.html                                         |   38 +
 management/guns-admin/src/main/webapp/static/modular/system/tBroadcast/tBroadcast_info.js                          |   68 ++
 management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/THtml.java                             |   88 ++++
 management/guns-admin/src/main/webapp/static/modular/system/tHtml/tHtml_info.js                                    |   99 ++++
 management/guns-admin/src/main/webapp/WEB-INF/view/system/tHtml/commissionRuleExplain.html                         |   41 +
 management/guns-admin/src/main/webapp/WEB-INF/view/system/tHtml/aboutUs.html                                       |   41 +
 management/guns-admin/src/main/webapp/static/modular/system/tHtml/tHtml.js                                         |  100 ++++
 management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/THtmlMapper.xml                  |   18 
 management/guns-admin/src/main/webapp/WEB-INF/view/system/tHtml/tripRecordingExplain.html                          |   41 +
 management/guns-admin/src/main/webapp/WEB-INF/view/system/tHtml/integralExplain.html                               |   41 +
 management/guns-admin/src/main/webapp/static/modular/system/tBroadcast/tBroadcast.js                               |   57 ++
 management/guns-admin/src/main/webapp/WEB-INF/view/system/tBroadcast/tBroadcast_add.html                           |   16 
 management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/THtmlMapper.java                         |   16 
 management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/THtmlServiceImpl.java           |   20 
 management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/THtmlController.java      |  187 ++++++++
 management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TBroadcastController.java |   45 ++
 management/guns-admin/src/main/webapp/WEB-INF/view/system/tHtml/tHtml_edit.html                                    |   29 +
 management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TBroadcast.java                        |   11 
 27 files changed, 1,173 insertions(+), 42 deletions(-)

diff --git a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TBroadcastController.java b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TBroadcastController.java
index 3b9f7dd..e1daf8e 100644
--- a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TBroadcastController.java
+++ b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TBroadcastController.java
@@ -2,6 +2,7 @@
 
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.stylefeng.guns.core.base.controller.BaseController;
+import com.stylefeng.guns.core.base.tips.SuccessTip;
 import com.stylefeng.guns.core.util.DateUtil;
 import com.stylefeng.guns.modular.system.enums.StatusEnum;
 import com.stylefeng.guns.modular.system.model.TSystemBulletin;
@@ -98,6 +99,12 @@
     @RequestMapping(value = "/add")
     @ResponseBody
     public Object add(TBroadcast tBroadcast) {
+        Boolean exit = tBroadcastService.isExit(tBroadcast.getId(), tBroadcast.getSort());
+        if(exit){
+            return new SuccessTip(500,"该排序已存在!");
+        }
+        tBroadcast.setStatus(StatusEnum.NORMAL.getCode());
+        tBroadcast.setCreateTime(new Date());
         tBroadcastService.insert(tBroadcast);
         return SUCCESS_TIP;
     }
@@ -109,6 +116,9 @@
     @ResponseBody
     public Object delete(@RequestParam Integer tBroadcastId) {
         TBroadcast tBroadcast = tBroadcastService.selectById(tBroadcastId);
+        if(1 == tBroadcast.getUpDown()){
+            return new SuccessTip(500,"上架中的广播不可删除!");
+        }
         tBroadcast.setStatus(StatusEnum.DELETE.getCode());
         tBroadcastService.updateById(tBroadcast);
         return SUCCESS_TIP;
@@ -120,6 +130,41 @@
     @RequestMapping(value = "/update")
     @ResponseBody
     public Object update(TBroadcast tBroadcast) {
+        Boolean exit = tBroadcastService.isExit(tBroadcast.getId(), tBroadcast.getSort());
+        if(exit){
+            return new SuccessTip(500,"该排序已存在!");
+        }
+        tBroadcastService.updateById(tBroadcast);
+        return SUCCESS_TIP;
+    }
+
+    /**
+     * 上架
+     */
+    @RequestMapping(value = "/up")
+    @ResponseBody
+    public Object up(Integer id) {
+
+        int count = tBroadcastService.selectCount(new EntityWrapper<TBroadcast>()
+                .eq("upDown", 1)
+                .ne("status", StatusEnum.DELETE.getCode()));
+        if(count>4){
+            return new SuccessTip(500,"最多可上架5条广播!");
+        }
+        TBroadcast tBroadcast = tBroadcastService.selectById(id);
+        tBroadcast.setUpDown(1);
+        tBroadcastService.updateById(tBroadcast);
+        return SUCCESS_TIP;
+    }
+
+    /**
+     * 下架
+     */
+    @RequestMapping(value = "/down")
+    @ResponseBody
+    public Object down(Integer id) {
+        TBroadcast tBroadcast = tBroadcastService.selectById(id);
+        tBroadcast.setUpDown(2);
         tBroadcastService.updateById(tBroadcast);
         return SUCCESS_TIP;
     }
diff --git a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/THtmlController.java b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/THtmlController.java
new file mode 100644
index 0000000..cc3c68e
--- /dev/null
+++ b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/THtmlController.java
@@ -0,0 +1,187 @@
+package com.stylefeng.guns.modular.system.controller.general;
+
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.stylefeng.guns.core.base.controller.BaseController;
+import com.stylefeng.guns.modular.system.controller.util.LabelReplaceUtil;
+import com.stylefeng.guns.modular.system.enums.HtmlTypeEnum;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.beans.factory.annotation.Autowired;
+import com.stylefeng.guns.core.log.LogObjectHolder;
+import org.springframework.web.bind.annotation.RequestParam;
+import com.stylefeng.guns.modular.system.model.THtml;
+import com.stylefeng.guns.modular.system.service.ITHtmlService;
+
+/**
+ * 控制器
+ *
+ * @author fengshuonan
+ * @Date 2023-03-24 10:50:08
+ */
+@Controller
+@RequestMapping("/tHtml")
+public class THtmlController extends BaseController {
+
+    private String PREFIX = "/system/tHtml/";
+
+    @Autowired
+    private ITHtmlService tHtmlService;
+
+    /**
+     * 跳转到首页
+     */
+    @RequestMapping("")
+    public String index() {
+        return PREFIX + "tHtml.html";
+    }
+
+    /**
+     * 跳转到添加
+     */
+    @RequestMapping("/tHtml_add")
+    public String tHtmlAdd() {
+        return PREFIX + "tHtml_add.html";
+    }
+
+    /**
+     * 跳转到修改
+     */
+    @RequestMapping("/tHtml_update/{tHtmlId}")
+    public String tHtmlUpdate(@PathVariable Integer tHtmlId, Model model) {
+        THtml tHtml = tHtmlService.selectById(tHtmlId);
+        model.addAttribute("item",tHtml);
+        LogObjectHolder.me().set(tHtml);
+        return PREFIX + "tHtml_edit.html";
+    }
+
+    /**
+     * 跳转到积分说明
+     */
+    @RequestMapping("/integralExplain")
+    public String integralExplain(Model model) {
+        THtml html = queryHtmlByType(HtmlTypeEnum.INTEGRAL_EXPLAIN.getCode());
+        model.addAttribute("html",html);
+        return PREFIX + "integralExplain.html";
+    }
+
+    /**
+     * 跳转到佣金规则说明
+     */
+    @RequestMapping("/commissionRuleExplain")
+    public String commissionRuleExplain(Model model) {
+        THtml html = queryHtmlByType(HtmlTypeEnum.COMMISSION_RULE_EXPLAIN.getCode());
+        model.addAttribute("html",html);
+        return PREFIX + "commissionRuleExplain.html";
+    }
+
+    /**
+     * 跳转到行程录音说明
+     */
+    @RequestMapping("/tripRecordingExplain")
+    public String tripRecordingExplain(Model model) {
+        THtml html = queryHtmlByType(HtmlTypeEnum.TRIP_RECORDING_EXPLAIN.getCode());
+        model.addAttribute("html",html);
+        return PREFIX + "tripRecordingExplain.html";
+    }
+
+    /**
+     * 跳转到预估价格说明
+     */
+    @RequestMapping("/estimatedPriceExplain")
+    public String estimatedPriceExplain(Model model) {
+        THtml html = queryHtmlByType(HtmlTypeEnum.ESTIMATED_PRICE_EXPLAIN.getCode());
+        model.addAttribute("html",html);
+        return PREFIX + "estimatedPriceExplain.html";
+    }
+
+    /**
+     * 跳转到起步价说明
+     */
+    @RequestMapping("/startingFareExplain")
+    public String startingFareExplain(Model model) {
+        THtml html = queryHtmlByType(HtmlTypeEnum.SPECIFICATION_STARTING_PRICE.getCode());
+        model.addAttribute("html",html);
+        return PREFIX + "estimatedPriceExplain.html";
+    }
+
+    /**
+     * 跳转到注销协议
+     */
+    @RequestMapping("/cancellationAgreement")
+    public String cancellationAgreement(Model model) {
+        THtml html = queryHtmlByType(HtmlTypeEnum.CANCELLATION_AGREEMENT.getCode());
+        model.addAttribute("html",html);
+        return PREFIX + "cancellationAgreement.html";
+    }
+
+    /**
+     * 跳转到关于我们
+     */
+    @RequestMapping("/aboutUs")
+    public String aboutUs(Model model) {
+        THtml html = queryHtmlByType(HtmlTypeEnum.ABOUT_US.getCode());
+        model.addAttribute("html",html);
+        return PREFIX + "aboutUs.html";
+    }
+
+    /**
+     * 获取列表
+     */
+    @RequestMapping(value = "/list")
+    @ResponseBody
+    public Object list(String condition) {
+        return tHtmlService.selectList(null);
+    }
+
+    /**
+     * 通过类型查询配置
+     */
+    @RequestMapping(value = "/queryHtmlByType")
+    @ResponseBody
+    public THtml queryHtmlByType(Integer type) {
+        return tHtmlService.selectOne(new EntityWrapper<THtml>().eq("type", type).last("LIMIT 1"));
+    }
+
+    /**
+     * 新增
+     */
+    @RequestMapping(value = "/add")
+    @ResponseBody
+    public Object add(THtml tHtml) {
+        tHtmlService.insert(tHtml);
+        return SUCCESS_TIP;
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping(value = "/delete")
+    @ResponseBody
+    public Object delete(@RequestParam Integer tHtmlId) {
+        tHtmlService.deleteById(tHtmlId);
+        return SUCCESS_TIP;
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping(value = "/update")
+    @ResponseBody
+    public Object update(THtml tHtml) {
+        tHtml.setHtml(LabelReplaceUtil.replace(tHtml.getHtml()));
+        tHtmlService.updateById(tHtml);
+        return SUCCESS_TIP;
+    }
+
+    /**
+     * 详情
+     */
+    @RequestMapping(value = "/detail/{tHtmlId}")
+    @ResponseBody
+    public Object detail(@PathVariable("tHtmlId") Integer tHtmlId) {
+        return tHtmlService.selectById(tHtmlId);
+    }
+}
diff --git a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/THtmlMapper.java b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/THtmlMapper.java
new file mode 100644
index 0000000..fa2d934
--- /dev/null
+++ b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/THtmlMapper.java
@@ -0,0 +1,16 @@
+package com.stylefeng.guns.modular.system.dao;
+
+import com.stylefeng.guns.modular.system.model.THtml;
+import com.baomidou.mybatisplus.mapper.BaseMapper;
+
+/**
+ * <p>
+ * H5富文本 Mapper 接口
+ * </p>
+ *
+ * @author stylefeng
+ * @since 2023-03-24
+ */
+public interface THtmlMapper extends BaseMapper<THtml> {
+
+}
diff --git a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/THtmlMapper.xml b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/THtmlMapper.xml
new file mode 100644
index 0000000..53d2f41
--- /dev/null
+++ b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/THtmlMapper.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.stylefeng.guns.modular.system.dao.THtmlMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.THtml">
+        <id column="id" property="id" />
+        <result column="type" property="type" />
+        <result column="html" property="html" />
+        <result column="createTime" property="createTime" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        id, type, html, createTime
+    </sql>
+
+</mapper>
diff --git a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/enums/HtmlTypeEnum.java b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/enums/HtmlTypeEnum.java
new file mode 100644
index 0000000..0285c97
--- /dev/null
+++ b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/enums/HtmlTypeEnum.java
@@ -0,0 +1,63 @@
+package com.stylefeng.guns.modular.system.enums;
+
+
+
+/**
+ * @Description H5富文本枚举
+ * @Author xiaochen
+ * @Date 2023/02/15 9:42
+ */
+public enum HtmlTypeEnum {
+
+    /*类型(1=代驾服务协议与隐私政策保护,2=法律条款,3=个人信息处理规则,4=积分说明,5=佣金规则说明,6=行程录音说明,7=预估价格说明,8=加盟基本要求,9=加盟流程,10=起步价说明,11=注销协议,12=关于我们,13=司机消单说明)*/
+
+    AGENT_DRIVING_SERVICE_EXPLAIN(1, "代驾服务协议与隐私政策保护"),
+    CLAUSE(2, "法律条款"),
+    PERSONAL_INFORMATION_RULES(3, "个人信息处理规则"),
+    INTEGRAL_EXPLAIN(4, "积分说明"),
+    COMMISSION_RULE_EXPLAIN(5, "佣金规则说明"),
+    TRIP_RECORDING_EXPLAIN(6, "行程录音说明"),
+    ESTIMATED_PRICE_EXPLAIN(7,"预估价格说明"),
+    BASIC_REQUIREMENTS_JOINING(8, "加盟基本要求"),
+    JOINING_PROCESS(9, "加盟流程"),
+    SPECIFICATION_STARTING_PRICE(10, "起步价说明"),
+    CANCELLATION_AGREEMENT(11,"注销协议"),
+    ABOUT_US(12,"关于我们"),
+    DRIVER_EXPLAIN_CANCELLATION(13,"司机消单说明");
+
+    private String desc;
+
+
+    private int code;
+
+
+    HtmlTypeEnum(int code, String desc) {
+        this.code = code;
+        this.desc = desc;
+    }
+
+    public String getDesc() {
+        return desc;
+    }
+
+    public int getCode() {
+        return code;
+    }
+
+    /**
+     * 通过code获取枚举
+     *
+     * @param code
+     * @return
+     */
+    public static HtmlTypeEnum fromCode(Integer code) {
+        HtmlTypeEnum[] resultTypes = HtmlTypeEnum.values();
+        for (HtmlTypeEnum resultType : resultTypes) {
+            if (code.equals(resultType.getCode())) {
+                return resultType;
+            }
+        }
+        return null;
+    }
+
+}
diff --git a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TBroadcast.java b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TBroadcast.java
index ecea805..e5fd009 100644
--- a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TBroadcast.java
+++ b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TBroadcast.java
@@ -45,21 +45,22 @@
     /**
      * 是否显示 1是 0否
      */
-    private Boolean isShow;
+    private Boolean show;
 
     /**
      * 上下架 1上架 2下架
      */
     private Integer upDown;
 
-    public Boolean getIsShow() {
-        return isShow;
+    public Boolean getShow() {
+        return show;
     }
 
-    public void setIsShow(Boolean isShow) {
-        this.isShow = isShow;
+    public void setShow(Boolean show) {
+        this.show = show;
     }
 
+
     public Integer getUpDown() {
         return upDown;
     }
diff --git a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/THtml.java b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/THtml.java
new file mode 100644
index 0000000..9d39a21
--- /dev/null
+++ b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/THtml.java
@@ -0,0 +1,88 @@
+package com.stylefeng.guns.modular.system.model;
+
+import com.baomidou.mybatisplus.enums.IdType;
+import java.util.Date;
+import com.baomidou.mybatisplus.annotations.TableId;
+import com.baomidou.mybatisplus.activerecord.Model;
+import com.baomidou.mybatisplus.annotations.TableName;
+import java.io.Serializable;
+
+/**
+ * <p>
+ * H5富文本
+ * </p>
+ *
+ * @author stylefeng
+ * @since 2023-03-24
+ */
+@TableName("t_html")
+public class THtml extends Model<THtml> {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+    /**
+     * 类型(1=代驾服务协议与隐私政策保护,2=法律条款,3=个人信息处理规则,4=积分说明,5=佣金规则说明,6=行程录音说明,7=预估价格说明,8=加盟基本要求,9=加盟流程,10=起步价说明,11=注销协议,12=关于我们,13=司机消单说明)
+     */
+    private Integer type;
+    /**
+     * H5内容
+     */
+    private String html;
+    /**
+     * 添加时间
+     */
+    private Date createTime;
+
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public String getHtml() {
+        return html;
+    }
+
+    public void setHtml(String html) {
+        this.html = html;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    @Override
+    protected Serializable pkVal() {
+        return this.id;
+    }
+
+    @Override
+    public String toString() {
+        return "THtml{" +
+        "id=" + id +
+        ", type=" + type +
+        ", html=" + html +
+        ", createTime=" + createTime +
+        "}";
+    }
+}
diff --git a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITBroadcastService.java b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITBroadcastService.java
index 15b32fb..3634a98 100644
--- a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITBroadcastService.java
+++ b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITBroadcastService.java
@@ -18,6 +18,6 @@
      *
      * @return
      */
-    Boolean isExit(String id, Integer sort);
+    Boolean isExit(Integer id, Integer sort);
 
 }
diff --git a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITHtmlService.java b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITHtmlService.java
new file mode 100644
index 0000000..ea7f946
--- /dev/null
+++ b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITHtmlService.java
@@ -0,0 +1,16 @@
+package com.stylefeng.guns.modular.system.service;
+
+import com.stylefeng.guns.modular.system.model.THtml;
+import com.baomidou.mybatisplus.service.IService;
+
+/**
+ * <p>
+ * H5富文本 服务类
+ * </p>
+ *
+ * @author stylefeng
+ * @since 2023-03-24
+ */
+public interface ITHtmlService extends IService<THtml> {
+
+}
diff --git a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TBroadcastServiceImpl.java b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TBroadcastServiceImpl.java
index 18b0e00..8acc288 100644
--- a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TBroadcastServiceImpl.java
+++ b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TBroadcastServiceImpl.java
@@ -1,6 +1,7 @@
 package com.stylefeng.guns.modular.system.service.impl;
 
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.stylefeng.guns.modular.system.enums.StatusEnum;
 import com.stylefeng.guns.modular.system.model.TBroadcast;
 import com.stylefeng.guns.modular.system.dao.TBroadcastMapper;
 import com.stylefeng.guns.modular.system.service.ITBroadcastService;
@@ -26,10 +27,11 @@
     private TBroadcastMapper tBroadcastMapper;
 
     @Override
-    public Boolean isExit(String id, Integer sort) {
+    public Boolean isExit(Integer id, Integer sort) {
         Integer count = tBroadcastMapper.selectCount(new EntityWrapper<TBroadcast>()
-                .eq("sort", sort));
-        if (StringUtils.hasLength(id)) {
+                .eq("sort", sort)
+                .ne("status", StatusEnum.DELETE.getCode()));
+        if (Objects.nonNull(id)) {
             // 修改
             TBroadcast tBroadcast = tBroadcastMapper.selectById(id);
             return Objects.nonNull(tBroadcast) && !tBroadcast.getSort().equals(sort) && count > 0;
diff --git a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/THtmlServiceImpl.java b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/THtmlServiceImpl.java
new file mode 100644
index 0000000..ccfd7d9
--- /dev/null
+++ b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/THtmlServiceImpl.java
@@ -0,0 +1,20 @@
+package com.stylefeng.guns.modular.system.service.impl;
+
+import com.stylefeng.guns.modular.system.model.THtml;
+import com.stylefeng.guns.modular.system.dao.THtmlMapper;
+import com.stylefeng.guns.modular.system.service.ITHtmlService;
+import com.baomidou.mybatisplus.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * H5富文本 服务实现类
+ * </p>
+ *
+ * @author stylefeng
+ * @since 2023-03-24
+ */
+@Service
+public class THtmlServiceImpl extends ServiceImpl<THtmlMapper, THtml> implements ITHtmlService {
+
+}
diff --git a/management/guns-admin/src/main/webapp/WEB-INF/view/system/tBroadcast/tBroadcast_add.html b/management/guns-admin/src/main/webapp/WEB-INF/view/system/tBroadcast/tBroadcast_add.html
index 8560072..be25cfa 100644
--- a/management/guns-admin/src/main/webapp/WEB-INF/view/system/tBroadcast/tBroadcast_add.html
+++ b/management/guns-admin/src/main/webapp/WEB-INF/view/system/tBroadcast/tBroadcast_add.html
@@ -12,16 +12,14 @@
                         <div class="col-sm-12" style="cursor: pointer;text-align: right;">
 
                             <div class="initialLevel col-sm-12 control-label form-group"  >
-                                <div style="background-color: gray;height: 35px;line-height: 35px">
-                                    <label style="color: #0C0C0C">滚动消息</label>
-                                </div>
+                                <label >滚动消息</label>
                             </div>
 
                             <div class="initialLevel col-sm-12 control-label form-group"  >
                                 <div class="initialLevel col-sm-3 control-label form-group"  >
                                     <span style="color:red">*</span>
                                     <label class="control-label" >消息内容:</label>
-                                    <input id="content" name="content" type="text" maxlength="200" style="height: 30px" required="required">
+                                    <input id="content" name="content" type="text" maxlength="200" placeholder="请输入" style="height: 30px" required="required">
                                 </div>
                             </div>
 
@@ -37,10 +35,10 @@
                                 <div class="initialLevel col-sm-3 control-label form-group"  >
                                     <span style="color:red">*</span>
                                     <label class="control-label" >是否显示:</label>
-                                    <select class="input-group col-sm-6" id="isShow" style="width: 180px;height: 30px" name="isShow">
+                                    <select  id="show" style="width: 180px;height: 30px" name="show">
                                         <option value="">选择是否显示</option>
-                                        <option value="1">是</option>
-                                        <option value="0">否</option>
+                                        <option value="true">是</option>
+                                        <option value="false">否</option>
                                     </select>
                                 </div>
                             </div>
@@ -52,8 +50,8 @@
 
                 <div class="row btn-group-m-t">
                     <div class="col-sm-10" style="text-align: center">
-                        <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TBranchOfficeInfoDlg.close()"/>
-                        <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TBranchOfficeInfoDlg.addSubmit()"/>
+                        <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TBroadcastInfoDlg.close()"/>
+                        <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TBroadcastInfoDlg.addSubmit()"/>
                     </div>
                 </div>
             </div>
diff --git a/management/guns-admin/src/main/webapp/WEB-INF/view/system/tBroadcast/tBroadcast_edit.html b/management/guns-admin/src/main/webapp/WEB-INF/view/system/tBroadcast/tBroadcast_edit.html
index 6d7d472..2fd0cb2 100644
--- a/management/guns-admin/src/main/webapp/WEB-INF/view/system/tBroadcast/tBroadcast_edit.html
+++ b/management/guns-admin/src/main/webapp/WEB-INF/view/system/tBroadcast/tBroadcast_edit.html
@@ -8,8 +8,9 @@
             <div class="ibox-content" id="broadcastInfoForm">
                 <div class="row row-lg">
                     <div class="col-sm-12">
-
                         <div class="col-sm-12" style="cursor: pointer;text-align: right;">
+
+                            <input hidden id="id" value="${item.id}">
 
                             <div class="initialLevel col-sm-12 control-label form-group"  >
                                 <div style="background-color: gray;height: 35px;line-height: 35px">
@@ -21,7 +22,7 @@
                                 <div class="initialLevel col-sm-3 control-label form-group"  >
                                     <span style="color:red">*</span>
                                     <label class="control-label" >消息内容:</label>
-                                    <input id="content" value="${content}" type="text" maxlength="200" style="height: 30px" required="required">
+                                    <input id="content" value="${item.content}" type="text" maxlength="200" style="height: 30px" required="required">
                                 </div>
                             </div>
 
@@ -29,7 +30,7 @@
                                 <div class="initialLevel col-sm-3 control-label form-group"  >
                                     <span style="color:red">*</span>
                                     <label class="control-label" >排序:</label>
-                                    <input id="sort" value="${sort}" type="number" style="height: 30px" maxlength="4"  placeholder="请输入" required="required">
+                                    <input id="sort" value="${item.sort}" type="number" style="height: 30px" maxlength="4"  placeholder="请输入" required="required">
                                 </div>
                             </div>
 
@@ -37,10 +38,9 @@
                                 <div class="initialLevel col-sm-3 control-label form-group"  >
                                     <span style="color:red">*</span>
                                     <label class="control-label" >是否显示:</label>
-                                    <select class="input-group col-sm-6" id="isShow" style="width: 180px;height: 30px" name="isShow">
-                                        <option value="">选择是否显示</option>
-                                        <option value="1">是</option>
-                                        <option value="0">否</option>
+                                    <select id="show" style="width: 180px;height: 30px">
+                                        <option value="true"${item.show == true ? 'selected=selected' : ''}>是</option>
+                                        <option value="false"${item.show == false ? 'selected=selected' : ''}>否</option>
                                     </select>
                                 </div>
                             </div>
@@ -52,8 +52,8 @@
 
                 <div class="row btn-group-m-t">
                     <div class="col-sm-10" style="text-align: center">
-                        <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TBranchOfficeInfoDlg.close()"/>
-                        <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TBranchOfficeInfoDlg.addSubmit()"/>
+                        <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TBroadcastInfoDlg.close()"/>
+                        <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TBroadcastInfoDlg.editSubmit()"/>
                     </div>
                 </div>
             </div>
diff --git a/management/guns-admin/src/main/webapp/WEB-INF/view/system/tHtml/aboutUs.html b/management/guns-admin/src/main/webapp/WEB-INF/view/system/tHtml/aboutUs.html
new file mode 100644
index 0000000..5f6b358
--- /dev/null
+++ b/management/guns-admin/src/main/webapp/WEB-INF/view/system/tHtml/aboutUs.html
@@ -0,0 +1,41 @@
+@layout("/common/_container.html"){
+<div class="row">
+    <div class="col-sm-12">
+        <div class="ibox float-e-margins">
+            <div class="ibox-title">
+                <h5>关于我们</h5>
+            </div>
+            <div class="ibox-content">
+                <div class="row row-lg">
+                    <div class="col-sm-12">
+
+                        <div class="col-sm-12" style="cursor: pointer;text-align: left;">
+
+                            <input hidden id="id" value="${html.id}">
+
+                            <div class="initialLevel col-sm-12 control-label form-group"  >
+                                <label>关于我们</label>
+                            </div>
+
+                            <div class="initialLevel col-sm-12 control-label form-group">
+                                <div class="initialLevel col-sm-6 control-label form-group"  >
+                                    <textarea type="text/plain" id="html" name="html" style="width:100%;height:350px;">${html.html}</textarea>
+                                </div>
+                            </div>
+
+                        </div>
+
+                    </div>
+                </div>
+
+                <div class="row btn-group-m-t">
+                    <div class="col-sm-10" style="text-align: center">
+                        <#button btnCss="info" name="保存" id="ensure" icon="fa-check" clickFun="THtmlInfoDlg.editSubmit()"/>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+<script src="${ctxPath}/static/modular/system/tHtml/tHtml_info.js"></script>
+@}
diff --git a/management/guns-admin/src/main/webapp/WEB-INF/view/system/tHtml/cancellationAgreement.html b/management/guns-admin/src/main/webapp/WEB-INF/view/system/tHtml/cancellationAgreement.html
new file mode 100644
index 0000000..0723ecc
--- /dev/null
+++ b/management/guns-admin/src/main/webapp/WEB-INF/view/system/tHtml/cancellationAgreement.html
@@ -0,0 +1,41 @@
+@layout("/common/_container.html"){
+<div class="row">
+    <div class="col-sm-12">
+        <div class="ibox float-e-margins">
+            <div class="ibox-title">
+                <h5>注销协议</h5>
+            </div>
+            <div class="ibox-content">
+                <div class="row row-lg">
+                    <div class="col-sm-12">
+
+                        <div class="col-sm-12" style="cursor: pointer;text-align: left;">
+
+                            <input hidden id="id" value="${html.id}">
+
+                            <div class="initialLevel col-sm-12 control-label form-group"  >
+                                <label>注销协议</label>
+                            </div>
+
+                            <div class="initialLevel col-sm-12 control-label form-group">
+                                <div class="initialLevel col-sm-6 control-label form-group"  >
+                                    <textarea type="text/plain" id="html" name="html" style="width:100%;height:350px;">${html.html}</textarea>
+                                </div>
+                            </div>
+
+                        </div>
+
+                    </div>
+                </div>
+
+                <div class="row btn-group-m-t">
+                    <div class="col-sm-10" style="text-align: center">
+                        <#button btnCss="info" name="保存" id="ensure" icon="fa-check" clickFun="THtmlInfoDlg.editSubmit()"/>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+<script src="${ctxPath}/static/modular/system/tHtml/tHtml_info.js"></script>
+@}
diff --git a/management/guns-admin/src/main/webapp/WEB-INF/view/system/tHtml/commissionRuleExplain.html b/management/guns-admin/src/main/webapp/WEB-INF/view/system/tHtml/commissionRuleExplain.html
new file mode 100644
index 0000000..906485b
--- /dev/null
+++ b/management/guns-admin/src/main/webapp/WEB-INF/view/system/tHtml/commissionRuleExplain.html
@@ -0,0 +1,41 @@
+@layout("/common/_container.html"){
+<div class="row">
+    <div class="col-sm-12">
+        <div class="ibox float-e-margins">
+            <div class="ibox-title">
+                <h5>佣金规则说明</h5>
+            </div>
+            <div class="ibox-content">
+                <div class="row row-lg">
+                    <div class="col-sm-12">
+
+                        <div class="col-sm-12" style="cursor: pointer;text-align: left;">
+
+                            <input hidden id="id" value="${html.id}">
+
+                            <div class="initialLevel col-sm-12 control-label form-group"  >
+                                <label>佣金规则说明</label>
+                            </div>
+
+                            <div class="initialLevel col-sm-12 control-label form-group">
+                                <div class="initialLevel col-sm-6 control-label form-group"  >
+                                    <textarea type="text/plain" id="html" name="html" style="width:100%;height:350px;">${html.html}</textarea>
+                                </div>
+                            </div>
+
+                        </div>
+
+                    </div>
+                </div>
+
+                <div class="row btn-group-m-t">
+                    <div class="col-sm-10" style="text-align: center">
+                        <#button btnCss="info" name="保存" id="ensure" icon="fa-check" clickFun="THtmlInfoDlg.editSubmit()"/>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+<script src="${ctxPath}/static/modular/system/tHtml/tHtml_info.js"></script>
+@}
diff --git a/management/guns-admin/src/main/webapp/WEB-INF/view/system/tHtml/estimatedPriceExplain.html b/management/guns-admin/src/main/webapp/WEB-INF/view/system/tHtml/estimatedPriceExplain.html
new file mode 100644
index 0000000..0ffcfed
--- /dev/null
+++ b/management/guns-admin/src/main/webapp/WEB-INF/view/system/tHtml/estimatedPriceExplain.html
@@ -0,0 +1,41 @@
+@layout("/common/_container.html"){
+<div class="row">
+    <div class="col-sm-12">
+        <div class="ibox float-e-margins">
+            <div class="ibox-title">
+                <h5>预估价格说明</h5>
+            </div>
+            <div class="ibox-content">
+                <div class="row row-lg">
+                    <div class="col-sm-12">
+
+                        <div class="col-sm-12" style="cursor: pointer;text-align: left;">
+
+                            <input hidden id="id" value="${html.id}">
+
+                            <div class="initialLevel col-sm-12 control-label form-group"  >
+                                <label>预估价格说明</label>
+                            </div>
+
+                            <div class="initialLevel col-sm-12 control-label form-group">
+                                <div class="initialLevel col-sm-6 control-label form-group"  >
+                                    <textarea type="text/plain" id="html" name="html" style="width:100%;height:350px;">${html.html}</textarea>
+                                </div>
+                            </div>
+
+                        </div>
+
+                    </div>
+                </div>
+
+                <div class="row btn-group-m-t">
+                    <div class="col-sm-10" style="text-align: center">
+                        <#button btnCss="info" name="保存" id="ensure" icon="fa-check" clickFun="THtmlInfoDlg.editSubmit()"/>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+<script src="${ctxPath}/static/modular/system/tHtml/tHtml_info.js"></script>
+@}
diff --git a/management/guns-admin/src/main/webapp/WEB-INF/view/system/tHtml/integralExplain.html b/management/guns-admin/src/main/webapp/WEB-INF/view/system/tHtml/integralExplain.html
new file mode 100644
index 0000000..779690d
--- /dev/null
+++ b/management/guns-admin/src/main/webapp/WEB-INF/view/system/tHtml/integralExplain.html
@@ -0,0 +1,41 @@
+@layout("/common/_container.html"){
+<div class="row">
+    <div class="col-sm-12">
+        <div class="ibox float-e-margins">
+            <div class="ibox-title">
+                <h5>积分说明</h5>
+            </div>
+            <div class="ibox-content">
+                <div class="row row-lg">
+                    <div class="col-sm-12">
+
+                        <div class="col-sm-12" style="cursor: pointer;text-align: left;">
+
+                            <input hidden id="id" value="${html.id}">
+
+                            <div class="initialLevel col-sm-12 control-label form-group"  >
+                                <label>积分说明</label>
+                            </div>
+
+                            <div class="initialLevel col-sm-12 control-label form-group">
+                                <div class="initialLevel col-sm-6 control-label form-group"  >
+                                    <textarea type="text/plain" id="html" name="html" style="width:100%;height:350px;">${html.html}</textarea>
+                                </div>
+                            </div>
+
+                        </div>
+
+                    </div>
+                </div>
+
+                <div class="row btn-group-m-t">
+                    <div class="col-sm-10" style="text-align: center">
+                        <#button btnCss="info" name="保存" id="ensure" icon="fa-check" clickFun="THtmlInfoDlg.editSubmit()"/>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+<script src="${ctxPath}/static/modular/system/tHtml/tHtml_info.js"></script>
+@}
diff --git a/management/guns-admin/src/main/webapp/WEB-INF/view/system/tHtml/startingFareExplain.html b/management/guns-admin/src/main/webapp/WEB-INF/view/system/tHtml/startingFareExplain.html
new file mode 100644
index 0000000..72a1668
--- /dev/null
+++ b/management/guns-admin/src/main/webapp/WEB-INF/view/system/tHtml/startingFareExplain.html
@@ -0,0 +1,41 @@
+@layout("/common/_container.html"){
+<div class="row">
+    <div class="col-sm-12">
+        <div class="ibox float-e-margins">
+            <div class="ibox-title">
+                <h5>起步价说明</h5>
+            </div>
+            <div class="ibox-content">
+                <div class="row row-lg">
+                    <div class="col-sm-12">
+
+                        <div class="col-sm-12" style="cursor: pointer;text-align: left;">
+
+                            <input hidden id="id" value="${html.id}">
+
+                            <div class="initialLevel col-sm-12 control-label form-group"  >
+                                <label>起步价说明</label>
+                            </div>
+
+                            <div class="initialLevel col-sm-12 control-label form-group">
+                                <div class="initialLevel col-sm-6 control-label form-group"  >
+                                    <textarea type="text/plain" id="html" name="html" style="width:100%;height:350px;">${html.html}</textarea>
+                                </div>
+                            </div>
+
+                        </div>
+
+                    </div>
+                </div>
+
+                <div class="row btn-group-m-t">
+                    <div class="col-sm-10" style="text-align: center">
+                        <#button btnCss="info" name="保存" id="ensure" icon="fa-check" clickFun="THtmlInfoDlg.editSubmit()"/>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+<script src="${ctxPath}/static/modular/system/tHtml/tHtml_info.js"></script>
+@}
diff --git a/management/guns-admin/src/main/webapp/WEB-INF/view/system/tHtml/tHtml.html b/management/guns-admin/src/main/webapp/WEB-INF/view/system/tHtml/tHtml.html
new file mode 100644
index 0000000..f6b6948
--- /dev/null
+++ b/management/guns-admin/src/main/webapp/WEB-INF/view/system/tHtml/tHtml.html
@@ -0,0 +1,38 @@
+@layout("/common/_container.html"){
+<div class="row">
+    <div class="col-sm-12">
+        <div class="ibox float-e-margins">
+            <div class="ibox-title">
+                <h5>管理</h5>
+            </div>
+            <div class="ibox-content">
+                <div class="row row-lg">
+                    <div class="col-sm-12">
+                        <div class="row">
+                            <div class="col-sm-3">
+                                <#NameCon id="condition" name="名称" />
+                            </div>
+                            <div class="col-sm-3">
+                                <#button name="搜索" icon="fa-search" clickFun="THtml.search()"/>
+                            </div>
+                        </div>
+                        <div class="hidden-xs" id="THtmlTableToolbar" role="group">
+                            @if(shiro.hasPermission("/tHtml/add")){
+                                <#button name="添加" icon="fa-plus" clickFun="THtml.openAddTHtml()"/>
+                            @}
+                            @if(shiro.hasPermission("/tHtml/update")){
+                                <#button name="修改" icon="fa-edit" clickFun="THtml.openTHtmlDetail()" space="true"/>
+                            @}
+                            @if(shiro.hasPermission("/tHtml/delete")){
+                                <#button name="删除" icon="fa-remove" clickFun="THtml.delete()" space="true"/>
+                            @}
+                        </div>
+                        <#table id="THtmlTable"/>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+<script src="${ctxPath}/static/modular/system/tHtml/tHtml.js"></script>
+@}
diff --git a/management/guns-admin/src/main/webapp/WEB-INF/view/system/tHtml/tHtml_add.html b/management/guns-admin/src/main/webapp/WEB-INF/view/system/tHtml/tHtml_add.html
new file mode 100644
index 0000000..2cfa1da
--- /dev/null
+++ b/management/guns-admin/src/main/webapp/WEB-INF/view/system/tHtml/tHtml_add.html
@@ -0,0 +1,29 @@
+@layout("/common/_container.html"){
+<div class="ibox float-e-margins">
+    <div class="ibox-content">
+        <div class="form-horizontal">
+
+            <div class="row">
+                <div class="col-sm-6 b-r">
+                            <#input id="id" name="主键" underline="true"/>
+                            <#input id="type" name="类型(1=代驾服务协议与隐私政策保护,2=法律条款,3=个人信息处理规则,4=积分说明,5=佣金规则说明,6=行程录音说明,7=预估价格说明,8=加盟基本要求,9=加盟流程,10=起步价说明,11=注销协议,12=关于我们,13=司机消单说明)"/>
+                </div>
+
+                <div class="col-sm-6">
+                            <#input id="html" name="H5内容" underline="true"/>
+                            <#input id="createTime" name="添加时间" underline="true"/>
+                </div>
+            </div>
+
+            <div class="row btn-group-m-t">
+                <div class="col-sm-10">
+                    <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="THtmlInfoDlg.addSubmit()"/>
+                    <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="THtmlInfoDlg.close()"/>
+                </div>
+            </div>
+        </div>
+
+    </div>
+</div>
+<script src="${ctxPath}/static/modular/system/tHtml/tHtml_info.js"></script>
+@}
diff --git a/management/guns-admin/src/main/webapp/WEB-INF/view/system/tHtml/tHtml_edit.html b/management/guns-admin/src/main/webapp/WEB-INF/view/system/tHtml/tHtml_edit.html
new file mode 100644
index 0000000..ed0c89b
--- /dev/null
+++ b/management/guns-admin/src/main/webapp/WEB-INF/view/system/tHtml/tHtml_edit.html
@@ -0,0 +1,29 @@
+@layout("/common/_container.html"){
+<div class="ibox float-e-margins">
+    <div class="ibox-content">
+        <div class="form-horizontal">
+
+            <div class="row">
+                <div class="col-sm-6 b-r">
+                            <#input id="id" name="主键" value="${item.id}" underline="true"/>
+                            <#input id="type" name="类型(1=代驾服务协议与隐私政策保护,2=法律条款,3=个人信息处理规则,4=积分说明,5=佣金规则说明,6=行程录音说明,7=预估价格说明,8=加盟基本要求,9=加盟流程,10=起步价说明,11=注销协议,12=关于我们,13=司机消单说明)" value="${item.type}" />
+                </div>
+
+                <div class="col-sm-6">
+                            <#input id="html" name="H5内容" value="${item.html}" underline="true"/>
+                            <#input id="createTime" name="添加时间" value="${item.createTime}" />
+                </div>
+            </div>
+
+            <div class="row btn-group-m-t">
+                <div class="col-sm-10">
+                    <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="THtmlInfoDlg.editSubmit()"/>
+                    <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="THtmlInfoDlg.close()"/>
+                </div>
+            </div>
+        </div>
+
+    </div>
+</div>
+<script src="${ctxPath}/static/modular/system/tHtml/tHtml_info.js"></script>
+@}
diff --git a/management/guns-admin/src/main/webapp/WEB-INF/view/system/tHtml/tripRecordingExplain.html b/management/guns-admin/src/main/webapp/WEB-INF/view/system/tHtml/tripRecordingExplain.html
new file mode 100644
index 0000000..15e4ab9
--- /dev/null
+++ b/management/guns-admin/src/main/webapp/WEB-INF/view/system/tHtml/tripRecordingExplain.html
@@ -0,0 +1,41 @@
+@layout("/common/_container.html"){
+<div class="row">
+    <div class="col-sm-12">
+        <div class="ibox float-e-margins">
+            <div class="ibox-title">
+                <h5>行程录音说明</h5>
+            </div>
+            <div class="ibox-content">
+                <div class="row row-lg">
+                    <div class="col-sm-12">
+
+                        <div class="col-sm-12" style="cursor: pointer;text-align: left;">
+
+                            <input hidden id="id" value="${html.id}">
+
+                            <div class="initialLevel col-sm-12 control-label form-group"  >
+                                <label>行程录音说明</label>
+                            </div>
+
+                            <div class="initialLevel col-sm-12 control-label form-group">
+                                <div class="initialLevel col-sm-6 control-label form-group"  >
+                                    <textarea type="text/plain" id="html" name="html" style="width:100%;height:350px;">${html.html}</textarea>
+                                </div>
+                            </div>
+
+                        </div>
+
+                    </div>
+                </div>
+
+                <div class="row btn-group-m-t">
+                    <div class="col-sm-10" style="text-align: center">
+                        <#button btnCss="info" name="保存" id="ensure" icon="fa-check" clickFun="THtmlInfoDlg.editSubmit()"/>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+<script src="${ctxPath}/static/modular/system/tHtml/tHtml_info.js"></script>
+@}
diff --git a/management/guns-admin/src/main/webapp/static/modular/system/tBroadcast/tBroadcast.js b/management/guns-admin/src/main/webapp/static/modular/system/tBroadcast/tBroadcast.js
index 700f2cc..2257664 100644
--- a/management/guns-admin/src/main/webapp/static/modular/system/tBroadcast/tBroadcast.js
+++ b/management/guns-admin/src/main/webapp/static/modular/system/tBroadcast/tBroadcast.js
@@ -17,9 +17,9 @@
             {title: '主键', field: 'id', visible: false, align: 'center', valign: 'middle'},
         {title: '添加时间', field: 'createTime', visible: true, align: 'center', valign: 'middle'},
         {title: '消息内容', field: 'content', visible: true, align: 'center', valign: 'middle'},
-        {title: '是否显示', field: 'isShow', visible: true, align: 'center', valign: 'middle',
+        {title: '是否显示', field: 'show', visible: true, align: 'center', valign: 'middle',
             formatter: function (value, row) {
-                if (row.isShow){
+                if (row.show){
                     return '<span>是</span>'
                 }else {
                     return '<span>否</span>'
@@ -30,10 +30,10 @@
         {title: '状态(1=正常,2=冻结,3=删除)', field: 'status', visible: false, align: 'center', valign: 'middle'},
         {title: '操作', visible: true, align: 'center', valign: 'middle',width:150,
             formatter: function (value, row) {
-                if (row.isShow){
-                    return '<a href="#" onclick="TBroadcast.updateStatus('+row.id+')" style="color:red">下架</a>'
+                if (row.upDown === 1){
+                    return '<a href="#" onclick="TBroadcast.down('+row.id+')" style="color:red">下架</a>'
                 }else{
-                    return '<a href="#" onclick="TBroadcast.updateStatus('+row.id+')" style="color:blue">上架</a>' +'&nbsp;' +
+                    return '<a href="#" onclick="TBroadcast.up('+row.id+')" style="color:blue">上架</a>' +'&nbsp;' +
                         '<a href="#" onclick="TBroadcast.delete('+row.id+')" style="color:red">删除</a>'
                 }
             }
@@ -92,8 +92,13 @@
  */
 TBroadcast.delete = function (id) {
     var ajax = new $ax(Feng.ctxPath + "/tBroadcast/delete", function (data) {
-        Feng.success("删除成功!");
-        TBroadcast.table.refresh();
+        if(500 == data.code){
+            Feng.error(data.message);
+            return;
+        }else {
+            Feng.success("删除成功!");
+            TBroadcast.table.refresh();
+        }
     }, function (data) {
         Feng.error("删除失败!" + data.responseJSON.message + "!");
     });
@@ -102,6 +107,44 @@
 };
 
 /**
+ * 上架
+ */
+TBroadcast.up = function (id) {
+    var ajax = new $ax(Feng.ctxPath + "/tBroadcast/up", function (data) {
+        if(500 == data.code){
+            Feng.error(data.message);
+            return;
+        }else {
+            Feng.success("上架成功!");
+            TBroadcast.table.refresh();
+        }
+    }, function (data) {
+        Feng.error("上架失败!" + data.responseJSON.message + "!");
+    });
+    ajax.set("id",id);
+    ajax.start();
+};
+
+/**
+ * 下架
+ */
+TBroadcast.down = function (id) {
+    var ajax = new $ax(Feng.ctxPath + "/tBroadcast/down", function (data) {
+        if(500 == data.code){
+            Feng.error(data.message);
+            return;
+        }else {
+            Feng.success("下架成功!");
+            TBroadcast.table.refresh();
+        }
+    }, function (data) {
+        Feng.error("下架失败!" + data.responseJSON.message + "!");
+    });
+    ajax.set("id",id);
+    ajax.start();
+};
+
+/**
  * 查询列表
  */
 TBroadcast.search = function () {
diff --git a/management/guns-admin/src/main/webapp/static/modular/system/tBroadcast/tBroadcast_info.js b/management/guns-admin/src/main/webapp/static/modular/system/tBroadcast/tBroadcast_info.js
index 54f4bdf..af3a5f2 100644
--- a/management/guns-admin/src/main/webapp/static/modular/system/tBroadcast/tBroadcast_info.js
+++ b/management/guns-admin/src/main/webapp/static/modular/system/tBroadcast/tBroadcast_info.js
@@ -2,7 +2,39 @@
  * 初始化详情对话框
  */
 var TBroadcastInfoDlg = {
-    tBroadcastInfoData : {}
+    tBroadcastInfoData : {},
+    validateFields: {
+        content: {
+            validators: {
+                notEmpty: {
+                    message: '消息内容不能为空'
+                }
+            }
+        },
+        sort: {
+            validators: {
+                notEmpty: {
+                    message: '排序不能为空'
+                }
+            }
+        },
+        show: {
+            validators: {
+                notEmpty: {
+                    message: '请选择是否显示'
+                }
+            }
+        },
+    }
+};
+
+/**
+ * 验证数据是否为空
+ */
+TBroadcastInfoDlg.validate = function () {
+    $('#broadcastInfoForm').data("bootstrapValidator").resetForm();
+    $('#broadcastInfoForm').bootstrapValidator('validate');
+    return $("#broadcastInfoForm").data('bootstrapValidator').isValid();
 };
 
 /**
@@ -49,6 +81,8 @@
     .set('content')
     .set('sort')
     .set('status')
+    .set('show')
+    .set('upDown')
     .set('createTime');
 }
 
@@ -60,11 +94,20 @@
     this.clearData();
     this.collectData();
 
+    if(!this.validate()){
+        return ;
+    }
+
     //提交信息
     var ajax = new $ax(Feng.ctxPath + "/tBroadcast/add", function(data){
-        Feng.success("添加成功!");
-        window.parent.TBroadcast.table.refresh();
-        TBroadcastInfoDlg.close();
+        if(500 == data.code){
+            Feng.error(data.message);
+            return;
+        }else {
+            Feng.success("添加成功!");
+            window.parent.TBroadcast.table.refresh();
+            TBroadcastInfoDlg.close();
+        }
     },function(data){
         Feng.error("添加失败!" + data.responseJSON.message + "!");
     });
@@ -80,11 +123,20 @@
     this.clearData();
     this.collectData();
 
+    if(!this.validate()){
+        return ;
+    }
+
     //提交信息
     var ajax = new $ax(Feng.ctxPath + "/tBroadcast/update", function(data){
-        Feng.success("修改成功!");
-        window.parent.TBroadcast.table.refresh();
-        TBroadcastInfoDlg.close();
+        if(500 == data.code){
+            Feng.error(data.message);
+            return;
+        }else {
+            Feng.success("修改成功!");
+            window.parent.TBroadcast.table.refresh();
+            TBroadcastInfoDlg.close();
+        }
     },function(data){
         Feng.error("修改失败!" + data.responseJSON.message + "!");
     });
@@ -93,5 +145,5 @@
 }
 
 $(function() {
-
+    Feng.initValidator("broadcastInfoForm", TBroadcastInfoDlg.validateFields);
 });
diff --git a/management/guns-admin/src/main/webapp/static/modular/system/tHtml/tHtml.js b/management/guns-admin/src/main/webapp/static/modular/system/tHtml/tHtml.js
new file mode 100644
index 0000000..70a45df
--- /dev/null
+++ b/management/guns-admin/src/main/webapp/static/modular/system/tHtml/tHtml.js
@@ -0,0 +1,100 @@
+/**
+ * 管理初始化
+ */
+var THtml = {
+    id: "THtmlTable",	//表格id
+    seItem: null,		//选中的条目
+    table: null,
+    layerIndex: -1
+};
+
+/**
+ * 初始化表格的列
+ */
+THtml.initColumn = function () {
+    return [
+        {field: 'selectItem', radio: true},
+            {title: '主键', field: 'id', visible: true, align: 'center', valign: 'middle'},
+            {title: '类型(1=代驾服务协议与隐私政策保护,2=法律条款,3=个人信息处理规则,4=积分说明,5=佣金规则说明,6=行程录音说明,7=预估价格说明,8=加盟基本要求,9=加盟流程,10=起步价说明,11=注销协议,12=关于我们,13=司机消单说明)', field: 'type', visible: true, align: 'center', valign: 'middle'},
+            {title: 'H5内容', field: 'html', visible: true, align: 'center', valign: 'middle'},
+            {title: '添加时间', field: 'createTime', visible: true, align: 'center', valign: 'middle'}
+    ];
+};
+
+/**
+ * 检查是否选中
+ */
+THtml.check = function () {
+    var selected = $('#' + this.id).bootstrapTable('getSelections');
+    if(selected.length == 0){
+        Feng.info("请先选中表格中的某一记录!");
+        return false;
+    }else{
+        THtml.seItem = selected[0];
+        return true;
+    }
+};
+
+/**
+ * 点击添加
+ */
+THtml.openAddTHtml = function () {
+    var index = layer.open({
+        type: 2,
+        title: '添加',
+        area: ['800px', '420px'], //宽高
+        fix: false, //不固定
+        maxmin: true,
+        content: Feng.ctxPath + '/tHtml/tHtml_add'
+    });
+    this.layerIndex = index;
+};
+
+/**
+ * 打开查看详情
+ */
+THtml.openTHtmlDetail = function () {
+    if (this.check()) {
+        var index = layer.open({
+            type: 2,
+            title: '详情',
+            area: ['800px', '420px'], //宽高
+            fix: false, //不固定
+            maxmin: true,
+            content: Feng.ctxPath + '/tHtml/tHtml_update/' + THtml.seItem.id
+        });
+        this.layerIndex = index;
+    }
+};
+
+/**
+ * 删除
+ */
+THtml.delete = function () {
+    if (this.check()) {
+        var ajax = new $ax(Feng.ctxPath + "/tHtml/delete", function (data) {
+            Feng.success("删除成功!");
+            THtml.table.refresh();
+        }, function (data) {
+            Feng.error("删除失败!" + data.responseJSON.message + "!");
+        });
+        ajax.set("tHtmlId",this.seItem.id);
+        ajax.start();
+    }
+};
+
+/**
+ * 查询列表
+ */
+THtml.search = function () {
+    var queryData = {};
+    queryData['condition'] = $("#condition").val();
+    THtml.table.refresh({query: queryData});
+};
+
+$(function () {
+    var defaultColunms = THtml.initColumn();
+    var table = new BSTable(THtml.id, "/tHtml/list", defaultColunms);
+    table.setPaginationType("client");
+    THtml.table = table.init();
+});
diff --git a/management/guns-admin/src/main/webapp/static/modular/system/tHtml/tHtml_info.js b/management/guns-admin/src/main/webapp/static/modular/system/tHtml/tHtml_info.js
new file mode 100644
index 0000000..9b6ba02
--- /dev/null
+++ b/management/guns-admin/src/main/webapp/static/modular/system/tHtml/tHtml_info.js
@@ -0,0 +1,99 @@
+/**
+ * 初始化详情对话框
+ */
+var THtmlInfoDlg = {
+    tHtmlInfoData : {}
+};
+
+/**
+ * 清除数据
+ */
+THtmlInfoDlg.clearData = function() {
+    this.tHtmlInfoData = {};
+}
+
+/**
+ * 设置对话框中的数据
+ *
+ * @param key 数据的名称
+ * @param val 数据的具体值
+ */
+THtmlInfoDlg.set = function(key, val) {
+    this.tHtmlInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val;
+    return this;
+}
+
+/**
+ * 设置对话框中的数据
+ *
+ * @param key 数据的名称
+ * @param val 数据的具体值
+ */
+THtmlInfoDlg.get = function(key) {
+    return $("#" + key).val();
+}
+
+/**
+ * 关闭此对话框
+ */
+THtmlInfoDlg.close = function() {
+    parent.layer.close(window.parent.THtml.layerIndex);
+}
+
+/**
+ * 收集数据
+ */
+THtmlInfoDlg.collectData = function() {
+    if(UE.getEditor('html').hasContents()){
+        $('#html').val(UE.getEditor('html').getContent());
+    }
+    this
+    .set('id')
+    .set('type')
+    .set('html')
+    .set('createTime');
+}
+
+/**
+ * 提交添加
+ */
+THtmlInfoDlg.addSubmit = function() {
+
+    this.clearData();
+    this.collectData();
+
+    //提交信息
+    var ajax = new $ax(Feng.ctxPath + "/tHtml/add", function(data){
+        Feng.success("添加成功!");
+        window.parent.THtml.table.refresh();
+        THtmlInfoDlg.close();
+    },function(data){
+        Feng.error("添加失败!" + data.responseJSON.message + "!");
+    });
+    ajax.set(this.tHtmlInfoData);
+    ajax.start();
+}
+
+/**
+ * 提交修改
+ */
+THtmlInfoDlg.editSubmit = function() {
+
+    this.clearData();
+    this.collectData();
+
+    //提交信息
+    var ajax = new $ax(Feng.ctxPath + "/tHtml/update", function(data){
+        Feng.success("修改成功!");
+        window.parent.THtml.table.refresh();
+        THtmlInfoDlg.close();
+    },function(data){
+        Feng.error("修改失败!" + data.responseJSON.message + "!");
+    });
+    ajax.set(this.tHtmlInfoData);
+    ajax.start();
+}
+
+$(function() {
+    THtmlInfoDlg.editor = UE.getEditor('html');
+});

--
Gitblit v1.7.1