xiaoshushu 3 年 前
コミット
c52cb0f003

+ 25 - 17
smart-admin/src/main/java/com/huijy/web/controller/api/ApiIndexController.java

@@ -32,6 +32,7 @@ import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartHttpServletRequest;
 import springfox.documentation.annotations.ApiIgnore;
 
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -184,17 +185,6 @@ public class ApiIndexController extends ApiAbstractController {
         return AjaxResult.success();
     }
 
-    //关于我们信息,包括小程序的展示素材
-    @GetMapping("/getAboutUs")
-    @ApiOperation("获取关于我们的信息")
-    @UnLogin
-    public AjaxResult getAboutUs(@ApiIgnore @LoginMember Member member) {
-        AboutUs aboutUs = aboutUsService.selectAboutUsByAboutUsId(1L);
-        Map<String, Object> resultObj = new HashMap<String, Object>();
-        resultObj.put("aboutUs", aboutUs);
-        return AjaxResult.success(resultObj);
-    }
-
     //分页获取主要内容信息
     @GetMapping("/getPageContent")
     @ApiOperation("分页获取主要内容信息")
@@ -206,7 +196,6 @@ public class ApiIndexController extends ApiAbstractController {
             @ApiImplicitParam(name = "pageSize", required = true, defaultValue = "20", value = "显示记录数", paramType = "query")
     })
     public TableDataInfo getPageContent(@ApiIgnore @LoginMember Member member, Integer type) {
-        // AboutUs aboutUs = aboutUsService.selectAboutUsByAboutUsId(1L);
         Content content = new Content();
         content.setServiceInfo(type + "");
         content.setReleaseFlag("1");
@@ -300,13 +289,20 @@ public class ApiIndexController extends ApiAbstractController {
     //是否开启酒店预订
     @GetMapping("/hotelEnable")
     @ApiOperation("是否开启酒店预订")
-    public AjaxResult hotelEnable(Long shopId,String enableFlag) {
+    public AjaxResult hotelEnable(Long shopId, String enableFlag) {
         Shop shop = new Shop();
         shop.setShopId(shopId);
         shop.setEnableFlag(enableFlag);
         return AjaxResult.success(shopService.updateShop(shop));
     }
 
+    //注销并且关闭店铺(物理删除)
+    @GetMapping("/hotelDelete")
+    @ApiOperation("注销并且关闭店铺")
+    public AjaxResult hotelDelete(Long shopId) {
+        return AjaxResult.success(shopService.deleteShopByShopId(shopId));
+    }
+
     //门店数据上报
     @PostMapping("/pushRecord")
     @ApiOperation("门店数据上报")
@@ -381,11 +377,17 @@ public class ApiIndexController extends ApiAbstractController {
 
     //首页数据
     @UnLogin
-    @PostMapping("/home")
+    @GetMapping("/home")
     @ApiOperation("首页数据")
     public AjaxResult home() {
-
-        return AjaxResult.success();
+        AjaxResult result = new AjaxResult();
+        AboutUs aboutUs = aboutUsService.selectAboutUsByAboutUsId(1L);
+        result.put("aboutUs", aboutUs);
+        List<Content> hot_list = contentService.home("2"); //热门景区
+        List<Content> zn_list = contentService.home("3"); //攻略指南
+        result.put("hot_list", hot_list);
+        result.put("zn_list", zn_list);
+        return AjaxResult.success(result);
     }
 
     //酒店预订
@@ -398,6 +400,9 @@ public class ApiIndexController extends ApiAbstractController {
     @GetMapping("/order")
     @ApiOperation("酒店预订订单")
     public TableDataInfo order(@LoginMember Member member, ShopRoomOrder order) {
+        if (order.getRole() == null) {
+            return getDataTable(new ArrayList<>());
+        }
         startPage();
         order.setMemberId(member.getMemberId());
         List<ShopRoomOrder> list = orderService.selectShopRoomOrder(order);
@@ -409,6 +414,9 @@ public class ApiIndexController extends ApiAbstractController {
     @ApiOperation("商家订单处理")
     public AjaxResult orderDeal(@RequestBody ShopRoomOrder order) {
         order.setCreateTime(null);
+        if (StringUtils.isEmpty(order.getMsg()) && order.getState() == 2) {
+            order.setMsg("入住的时间段酒店客房已满,无法安排入住");
+        }
         int row = orderService.updateShopRoomOrder(order);
         //发送小程序订阅消息
         if (row > 0 && order.getState() == 1) {
@@ -528,7 +536,7 @@ public class ApiIndexController extends ApiAbstractController {
             body.set("template_id", "iEMHyeeuqs-MFa1J4QgT7n0mfnOb-h93oc21b1O3pK8");
             content.set("thing2", new JSONObject().set("value", order.getMin().substring(5, 10) + "至" + order.getMax().substring(5, 10)));
             content.set("thing3", new JSONObject().set("value", order.getShopRoom().getTitle()));
-            content.set("thing5", new JSONObject().set("value", "入住的时间段酒店客房已满,无法安排入住"));
+            content.set("thing5", new JSONObject().set("value", order.getMsg()));
         }
         content.set("thing1", new JSONObject().set("value", order.getShopName()));
         body.set("data", content);

+ 17 - 22
smart-admin/src/main/java/com/huijy/web/controller/management/ContentController.java

@@ -4,6 +4,7 @@ import java.util.List;
 
 import com.huijy.common.core.domain.entity.SysUser;
 import com.huijy.common.utils.SecurityUtils;
+import com.huijy.common.utils.StringUtils;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -31,8 +32,7 @@ import com.huijy.common.core.page.TableDataInfo;
  */
 @RestController
 @RequestMapping("/management/content")
-public class ContentController extends BaseController
-{
+public class ContentController extends BaseController {
     @Autowired
     private IContentService contentService;
 
@@ -41,8 +41,7 @@ public class ContentController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('management:content:list')")
     @GetMapping("/list")
-    public TableDataInfo list(Content content)
-    {
+    public TableDataInfo list(Content content) {
         startPage();
         List<Content> list = contentService.selectContentList(content);
         return getDataTable(list);
@@ -54,8 +53,7 @@ public class ContentController extends BaseController
     @PreAuthorize("@ss.hasPermi('management:content:export')")
     @Log(title = "内容管理", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
-    public AjaxResult export(Content content)
-    {
+    public AjaxResult export(Content content) {
         List<Content> list = contentService.selectContentList(content);
         ExcelUtil<Content> util = new ExcelUtil<Content>(Content.class);
         return util.exportExcel(list, "内容管理数据");
@@ -66,8 +64,7 @@ public class ContentController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('management:content:query')")
     @GetMapping(value = "/{contentId}")
-    public AjaxResult getInfo(@PathVariable("contentId") Long contentId)
-    {
+    public AjaxResult getInfo(@PathVariable("contentId") Long contentId) {
         return AjaxResult.success(contentService.selectContentByContentId(contentId));
     }
 
@@ -77,9 +74,8 @@ public class ContentController extends BaseController
     @PreAuthorize("@ss.hasPermi('management:content:add')")
     @Log(title = "内容管理", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody Content content)
-    {
-
+    public AjaxResult add(@RequestBody Content content) {
+        content.setBriefContent(StringUtils.StripHT(content.getContent()));
         content.setCreateAt(getUserId());
         return toAjax(contentService.insertContent(content));
     }
@@ -90,8 +86,8 @@ public class ContentController extends BaseController
     @PreAuthorize("@ss.hasPermi('management:content:edit')")
     @Log(title = "内容管理", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody Content content)
-    {
+    public AjaxResult edit(@RequestBody Content content) {
+        content.setBriefContent(StringUtils.StripHT(content.getContent()));
         return toAjax(contentService.updateContent(content));
     }
 
@@ -100,33 +96,32 @@ public class ContentController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('management:content:remove')")
     @Log(title = "内容管理", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{contentIds}")
-    public AjaxResult remove(@PathVariable Long[] contentIds)
-    {
+    @DeleteMapping("/{contentIds}")
+    public AjaxResult remove(@PathVariable Long[] contentIds) {
         return toAjax(contentService.deleteContentByContentIds(contentIds));
     }
 
     @PreAuthorize("@ss.hasPermi('management:content:audit')")
     @Log(title = "初审内容", businessType = BusinessType.UPDATE)
     @PostMapping("/audit")
-    public AjaxResult updateAudit(@RequestBody Content content){
-        contentService.updateAudit(content.getContentId(),content.getAuditFlag(),content.getAuditMsg(),getUserId());
+    public AjaxResult updateAudit(@RequestBody Content content) {
+        contentService.updateAudit(content.getContentId(), content.getAuditFlag(), content.getAuditMsg(), getUserId());
         return AjaxResult.success();
     }
 
     @PreAuthorize("@ss.hasPermi('management:content:endAudit')")
     @Log(title = "终审内容", businessType = BusinessType.UPDATE)
     @PostMapping("/endAudit")
-    public AjaxResult updateEndAudit(@RequestBody Content content){
-        contentService.updateAudit(content.getContentId(),content.getAuditFlag(),content.getEndAuditMsg(),getUserId());
+    public AjaxResult updateEndAudit(@RequestBody Content content) {
+        contentService.updateAudit(content.getContentId(), content.getAuditFlag(), content.getEndAuditMsg(), getUserId());
         return AjaxResult.success();
     }
 
     @PreAuthorize("@ss.hasPermi('management:content:release')")
     @Log(title = "发布内容", businessType = BusinessType.UPDATE)
     @PostMapping("/release")
-    public AjaxResult updateRelease(@RequestBody Content content){
-        contentService.updateRelease(content.getContentId(),content.getReleaseFlag(),getUserId());
+    public AjaxResult updateRelease(@RequestBody Content content) {
+        contentService.updateRelease(content.getContentId(), content.getReleaseFlag(), getUserId());
         return AjaxResult.success();
     }
 }

+ 1 - 1
smart-admin/src/main/java/com/huijy/web/controller/monitor/ServerController.java

@@ -36,6 +36,6 @@ public class ServerController {
      */
     @GetMapping(value = "/home")
     public AjaxResult home() {
-        return AjaxResult.success(contentService.home());
+        return AjaxResult.success(contentService.statistics());
     }
 }

+ 96 - 159
smart-common/src/main/java/com/huijy/common/utils/StringUtils.java

@@ -6,6 +6,7 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+
 import org.springframework.util.AntPathMatcher;
 import com.huijy.common.constant.Constants;
 import com.huijy.common.core.text.StrFormatter;
@@ -15,12 +16,15 @@ import com.huijy.common.core.text.StrFormatter;
  *
  * @author huijy
  */
-public class StringUtils extends org.apache.commons.lang3.StringUtils
-{
-    /** 空字符串 */
+public class StringUtils extends org.apache.commons.lang3.StringUtils {
+    /**
+     * 空字符串
+     */
     private static final String NULLSTR = "";
 
-    /** 下划线 */
+    /**
+     * 下划线
+     */
     private static final char SEPARATOR = '_';
 
     /**
@@ -29,8 +33,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
      * @param value defaultValue 要判断的value
      * @return value 返回值
      */
-    public static <T> T nvl(T value, T defaultValue)
-    {
+    public static <T> T nvl(T value, T defaultValue) {
         return value != null ? value : defaultValue;
     }
 
@@ -40,8 +43,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
      * @param coll 要判断的Collection
      * @return true:为空 false:非空
      */
-    public static boolean isEmpty(Collection<?> coll)
-    {
+    public static boolean isEmpty(Collection<?> coll) {
         return isNull(coll) || coll.isEmpty();
     }
 
@@ -51,8 +53,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
      * @param coll 要判断的Collection
      * @return true:非空 false:空
      */
-    public static boolean isNotEmpty(Collection<?> coll)
-    {
+    public static boolean isNotEmpty(Collection<?> coll) {
         return !isEmpty(coll);
     }
 
@@ -60,10 +61,9 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
      * * 判断一个对象数组是否为空
      *
      * @param objects 要判断的对象数组
-     ** @return true:为空 false:非空
+     *                * @return true:为空 false:非空
      */
-    public static boolean isEmpty(Object[] objects)
-    {
+    public static boolean isEmpty(Object[] objects) {
         return isNull(objects) || (objects.length == 0);
     }
 
@@ -73,8 +73,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
      * @param objects 要判断的对象数组
      * @return true:非空 false:空
      */
-    public static boolean isNotEmpty(Object[] objects)
-    {
+    public static boolean isNotEmpty(Object[] objects) {
         return !isEmpty(objects);
     }
 
@@ -84,8 +83,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
      * @param map 要判断的Map
      * @return true:为空 false:非空
      */
-    public static boolean isEmpty(Map<?, ?> map)
-    {
+    public static boolean isEmpty(Map<?, ?> map) {
         return isNull(map) || map.isEmpty();
     }
 
@@ -95,8 +93,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
      * @param map 要判断的Map
      * @return true:非空 false:空
      */
-    public static boolean isNotEmpty(Map<?, ?> map)
-    {
+    public static boolean isNotEmpty(Map<?, ?> map) {
         return !isEmpty(map);
     }
 
@@ -106,8 +103,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
      * @param str String
      * @return true:为空 false:非空
      */
-    public static boolean isEmpty(String str)
-    {
+    public static boolean isEmpty(String str) {
         return isNull(str) || NULLSTR.equals(str.trim());
     }
 
@@ -117,8 +113,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
      * @param str String
      * @return true:非空串 false:空串
      */
-    public static boolean isNotEmpty(String str)
-    {
+    public static boolean isNotEmpty(String str) {
         return !isEmpty(str);
     }
 
@@ -128,8 +123,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
      * @param object Object
      * @return true:为空 false:非空
      */
-    public static boolean isNull(Object object)
-    {
+    public static boolean isNull(Object object) {
         return object == null;
     }
 
@@ -139,8 +133,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
      * @param object Object
      * @return true:非空 false:空
      */
-    public static boolean isNotNull(Object object)
-    {
+    public static boolean isNotNull(Object object) {
         return !isNull(object);
     }
 
@@ -150,44 +143,37 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
      * @param object 对象
      * @return true:是数组 false:不是数组
      */
-    public static boolean isArray(Object object)
-    {
+    public static boolean isArray(Object object) {
         return isNotNull(object) && object.getClass().isArray();
     }
 
     /**
      * 去空格
      */
-    public static String trim(String str)
-    {
+    public static String trim(String str) {
         return (str == null ? "" : str.trim());
     }
 
     /**
      * 截取字符串
      *
-     * @param str 字符串
+     * @param str   字符串
      * @param start 开始
      * @return 结果
      */
-    public static String substring(final String str, int start)
-    {
-        if (str == null)
-        {
+    public static String substring(final String str, int start) {
+        if (str == null) {
             return NULLSTR;
         }
 
-        if (start < 0)
-        {
+        if (start < 0) {
             start = str.length() + start;
         }
 
-        if (start < 0)
-        {
+        if (start < 0) {
             start = 0;
         }
-        if (start > str.length())
-        {
+        if (start > str.length()) {
             return NULLSTR;
         }
 
@@ -197,43 +183,35 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
     /**
      * 截取字符串
      *
-     * @param str 字符串
+     * @param str   字符串
      * @param start 开始
-     * @param end 结束
+     * @param end   结束
      * @return 结果
      */
-    public static String substring(final String str, int start, int end)
-    {
-        if (str == null)
-        {
+    public static String substring(final String str, int start, int end) {
+        if (str == null) {
             return NULLSTR;
         }
 
-        if (end < 0)
-        {
+        if (end < 0) {
             end = str.length() + end;
         }
-        if (start < 0)
-        {
+        if (start < 0) {
             start = str.length() + start;
         }
 
-        if (end > str.length())
-        {
+        if (end > str.length()) {
             end = str.length();
         }
 
-        if (start > end)
-        {
+        if (start > end) {
             return NULLSTR;
         }
 
-        if (start < 0)
-        {
+        if (start < 0) {
             start = 0;
         }
-        if (end < 0)
-        {
+        if (end < 0) {
             end = 0;
         }
 
@@ -250,13 +228,11 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
      * 转义\: format("this is \\\\{} for {}", "a", "b") -> this is \a for b<br>
      *
      * @param template 文本模板,被替换的部分用 {} 表示
-     * @param params 参数值
+     * @param params   参数值
      * @return 格式化后的文本
      */
-    public static String format(String template, Object... params)
-    {
-        if (isEmpty(params) || isEmpty(template))
-        {
+    public static String format(String template, Object... params) {
+        if (isEmpty(params) || isEmpty(template)) {
             return template;
         }
         return StrFormatter.format(template, params);
@@ -268,8 +244,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
      * @param link 链接
      * @return 结果
      */
-    public static boolean ishttp(String link)
-    {
+    public static boolean ishttp(String link) {
         return StringUtils.startsWithAny(link, Constants.HTTP, Constants.HTTPS);
     }
 
@@ -280,42 +255,35 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
      * @param sep 分隔符
      * @return set集合
      */
-    public static final Set<String> str2Set(String str, String sep)
-    {
+    public static final Set<String> str2Set(String str, String sep) {
         return new HashSet<String>(str2List(str, sep, true, false));
     }
 
     /**
      * 字符串转list
      *
-     * @param str 字符串
-     * @param sep 分隔符
+     * @param str         字符串
+     * @param sep         分隔符
      * @param filterBlank 过滤纯空白
-     * @param trim 去掉首尾空白
+     * @param trim        去掉首尾空白
      * @return list集合
      */
-    public static final List<String> str2List(String str, String sep, boolean filterBlank, boolean trim)
-    {
+    public static final List<String> str2List(String str, String sep, boolean filterBlank, boolean trim) {
         List<String> list = new ArrayList<String>();
-        if (StringUtils.isEmpty(str))
-        {
+        if (StringUtils.isEmpty(str)) {
             return list;
         }
 
         // 过滤空白字符串
-        if (filterBlank && StringUtils.isBlank(str))
-        {
+        if (filterBlank && StringUtils.isBlank(str)) {
             return list;
         }
         String[] split = str.split(sep);
-        for (String string : split)
-        {
-            if (filterBlank && StringUtils.isBlank(string))
-            {
+        for (String string : split) {
+            if (filterBlank && StringUtils.isBlank(string)) {
                 continue;
             }
-            if (trim)
-            {
+            if (trim) {
                 string = string.trim();
             }
             list.add(string);
@@ -327,20 +295,16 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
     /**
      * 查找指定字符串是否包含指定字符串列表中的任意一个字符串同时串忽略大小写
      *
-     * @param cs 指定字符串
+     * @param cs                  指定字符串
      * @param searchCharSequences 需要检查的字符串数组
      * @return 是否包含任意一个字符串
      */
-    public static boolean containsAnyIgnoreCase(CharSequence cs, CharSequence... searchCharSequences)
-    {
-        if (isEmpty(cs) || isEmpty(searchCharSequences))
-        {
+    public static boolean containsAnyIgnoreCase(CharSequence cs, CharSequence... searchCharSequences) {
+        if (isEmpty(cs) || isEmpty(searchCharSequences)) {
             return false;
         }
-        for (CharSequence testStr : searchCharSequences)
-        {
-            if (containsIgnoreCase(cs, testStr))
-            {
+        for (CharSequence testStr : searchCharSequences) {
+            if (containsIgnoreCase(cs, testStr)) {
                 return true;
             }
         }
@@ -350,10 +314,8 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
     /**
      * 驼峰转下划线命名
      */
-    public static String toUnderScoreCase(String str)
-    {
-        if (str == null)
-        {
+    public static String toUnderScoreCase(String str) {
+        if (str == null) {
             return null;
         }
         StringBuilder sb = new StringBuilder();
@@ -363,31 +325,23 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
         boolean curreCharIsUpperCase = true;
         // 下一字符是否大写
         boolean nexteCharIsUpperCase = true;
-        for (int i = 0; i < str.length(); i++)
-        {
+        for (int i = 0; i < str.length(); i++) {
             char c = str.charAt(i);
-            if (i > 0)
-            {
+            if (i > 0) {
                 preCharIsUpperCase = Character.isUpperCase(str.charAt(i - 1));
-            }
-            else
-            {
+            } else {
                 preCharIsUpperCase = false;
             }
 
             curreCharIsUpperCase = Character.isUpperCase(c);
 
-            if (i < (str.length() - 1))
-            {
+            if (i < (str.length() - 1)) {
                 nexteCharIsUpperCase = Character.isUpperCase(str.charAt(i + 1));
             }
 
-            if (preCharIsUpperCase && curreCharIsUpperCase && !nexteCharIsUpperCase)
-            {
+            if (preCharIsUpperCase && curreCharIsUpperCase && !nexteCharIsUpperCase) {
                 sb.append(SEPARATOR);
-            }
-            else if ((i != 0 && !preCharIsUpperCase) && curreCharIsUpperCase)
-            {
+            } else if ((i != 0 && !preCharIsUpperCase) && curreCharIsUpperCase) {
                 sb.append(SEPARATOR);
             }
             sb.append(Character.toLowerCase(c));
@@ -399,18 +353,14 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
     /**
      * 是否包含字符串
      *
-     * @param str 验证字符串
+     * @param str  验证字符串
      * @param strs 字符串组
      * @return 包含返回true
      */
-    public static boolean inStringIgnoreCase(String str, String... strs)
-    {
-        if (str != null && strs != null)
-        {
-            for (String s : strs)
-            {
-                if (str.equalsIgnoreCase(trim(s)))
-                {
+    public static boolean inStringIgnoreCase(String str, String... strs) {
+        if (str != null && strs != null) {
+            for (String s : strs) {
+                if (str.equalsIgnoreCase(trim(s))) {
                     return true;
                 }
             }
@@ -424,27 +374,21 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
      * @param name 转换前的下划线大写方式命名的字符串
      * @return 转换后的驼峰式命名的字符串
      */
-    public static String convertToCamelCase(String name)
-    {
+    public static String convertToCamelCase(String name) {
         StringBuilder result = new StringBuilder();
         // 快速检查
-        if (name == null || name.isEmpty())
-        {
+        if (name == null || name.isEmpty()) {
             // 没必要转换
             return "";
-        }
-        else if (!name.contains("_"))
-        {
+        } else if (!name.contains("_")) {
             // 不含下划线,仅将首字母大写
             return name.substring(0, 1).toUpperCase() + name.substring(1);
         }
         // 用下划线将原始字符串分割
         String[] camels = name.split("_");
-        for (String camel : camels)
-        {
+        for (String camel : camels) {
             // 跳过原始字符串中开头、结尾的下换线或双重下划线
-            if (camel.isEmpty())
-            {
+            if (camel.isEmpty()) {
                 continue;
             }
             // 首字母大写
@@ -457,30 +401,22 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
     /**
      * 驼峰式命名法 例如:user_name->userName
      */
-    public static String toCamelCase(String s)
-    {
-        if (s == null)
-        {
+    public static String toCamelCase(String s) {
+        if (s == null) {
             return null;
         }
         s = s.toLowerCase();
         StringBuilder sb = new StringBuilder(s.length());
         boolean upperCase = false;
-        for (int i = 0; i < s.length(); i++)
-        {
+        for (int i = 0; i < s.length(); i++) {
             char c = s.charAt(i);
 
-            if (c == SEPARATOR)
-            {
+            if (c == SEPARATOR) {
                 upperCase = true;
-            }
-            else if (upperCase)
-            {
+            } else if (upperCase) {
                 sb.append(Character.toUpperCase(c));
                 upperCase = false;
-            }
-            else
-            {
+            } else {
                 sb.append(c);
             }
         }
@@ -490,26 +426,29 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
     /**
      * 查找指定字符串是否匹配指定字符串列表中的任意一个字符串
      *
-     * @param str 指定字符串
+     * @param str  指定字符串
      * @param strs 需要检查的字符串数组
      * @return 是否匹配
      */
-    public static boolean matches(String str, List<String> strs)
-    {
-        if (isEmpty(str) || isEmpty(strs))
-        {
+    public static boolean matches(String str, List<String> strs) {
+        if (isEmpty(str) || isEmpty(strs)) {
             return false;
         }
-        for (String pattern : strs)
-        {
-            if (isMatch(pattern, str))
-            {
+        for (String pattern : strs) {
+            if (isMatch(pattern, str)) {
                 return true;
             }
         }
         return false;
     }
 
+    //从html中提取纯文本
+    public static String StripHT(String strHtml) {
+        String txtcontent = strHtml.replaceAll("</?[^>]+>", ""); //剔出<html>的标签
+        txtcontent = txtcontent.replaceAll("<a>\\s*|\t|\r|\n</a>", "");//去除字符串中的空格,回车,换行符,制表符
+        return txtcontent.substring(0, txtcontent.length() > 80 ? 80 : txtcontent.length());
+    }
+
     /**
      * 判断url是否与规则配置:
      * ? 表示单个字符;
@@ -517,18 +456,16 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
      * ** 表示任意层路径;
      *
      * @param pattern 匹配规则
-     * @param url 需要匹配的url
+     * @param url     需要匹配的url
      * @return
      */
-    public static boolean isMatch(String pattern, String url)
-    {
+    public static boolean isMatch(String pattern, String url) {
         AntPathMatcher matcher = new AntPathMatcher();
         return matcher.match(pattern, url);
     }
 
     @SuppressWarnings("unchecked")
-    public static <T> T cast(Object obj)
-    {
+    public static <T> T cast(Object obj) {
         return (T) obj;
     }
 }

+ 134 - 115
smart-system/src/main/java/com/huijy/management/domain/Content.java

@@ -1,6 +1,7 @@
 package com.huijy.management.domain;
 
 import java.util.Date;
+
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.huijy.common.annotation.Excel;
 import com.huijy.common.core.domain.BaseEntity;
@@ -13,245 +14,263 @@ import org.apache.commons.lang3.builder.ToStringStyle;
  * @author luobo
  * @date 2021-09-12
  */
-public class Content extends BaseEntity
-{
+public class Content extends BaseEntity {
     private static final long serialVersionUID = 1L;
 
-    /** 内容管理id */
+    /**
+     * 内容管理id
+     */
     private Long contentId;
 
-    /** 信息类型 */
+    /**
+     * 信息类型
+     */
     @Excel(name = "信息类型")
     private String serviceInfo;
 
-    /** 标题 */
+    /**
+     * 标题
+     */
     @Excel(name = "标题")
     private String title;
 
-    /** 作者 */
+    /**
+     * 作者
+     */
     @Excel(name = "作者")
     private String author;
 
-    /** 展示图片 */
+    /**
+     * 展示图片
+     */
     @Excel(name = "展示图片")
     private String showPictures;
 
-    /** 简介 */
+    /**
+     * 简介
+     */
     private String briefContent;
 
-    /** 详情 */
+    /**
+     * 详情
+     */
     private String content;
 
-    /** 创建人 */
+    /**
+     * 创建人
+     */
     private Long createAt;
 
-    /** 审核状态 0、未审核 1初审 2终审 */
+    /**
+     * 审核状态 0、未审核 1初审 2终审
+     */
     @Excel(name = "审核状态 0、未审核 1初审 2终审")
     private String auditFlag;
 
-    /** 初审人 */
+    /**
+     * 初审人
+     */
     @Excel(name = "初审人")
     private Long auditAt;
 
-    /** 初审时间 */
+    /**
+     * 初审时间
+     */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @Excel(name = "初审时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date auditTime;
 
-    /** 初审核信息 */
+    /**
+     * 初审核信息
+     */
     @Excel(name = "初审核信息")
     private String auditMsg;
 
-    /** 发布标志 */
+    /**
+     * 发布标志
+     */
     @Excel(name = "发布标志")
     private String releaseFlag;
 
-    /** 发布时间 */
+    /**
+     * 发布时间
+     */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @Excel(name = "发布时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date releaseTime;
 
-    /** 发布人 */
+    /**
+     * 发布人
+     */
     @Excel(name = "发布人")
     private Long releaseAt;
 
-    /** 终审人 */
+    /**
+     * 终审人
+     */
     @Excel(name = "终审人")
     private Long endAuditAt;
 
-    /** 终审时间 */
+    /**
+     * 终审时间
+     */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @Excel(name = "终审时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date endAuditTime;
 
-    /** 终核信息 */
+    /**
+     * 终核信息
+     */
     @Excel(name = "终核信息")
     private String endAuditMsg;
 
-    /** 点击量 */
+    /**
+     * 点击量
+     */
     @Excel(name = "点击量")
     private Integer browseNum;
 
-    public void setContentId(Long contentId)
-    {
+    public void setContentId(Long contentId) {
         this.contentId = contentId;
     }
 
-    public Long getContentId()
-    {
+    public Long getContentId() {
         return contentId;
     }
-    public void setServiceInfo(String serviceInfo)
-    {
+
+    public void setServiceInfo(String serviceInfo) {
         this.serviceInfo = serviceInfo;
     }
 
-    public String getServiceInfo()
-    {
+    public String getServiceInfo() {
         return serviceInfo;
     }
-    public void setTitle(String title)
-    {
+
+    public void setTitle(String title) {
         this.title = title;
     }
 
-    public String getTitle()
-    {
+    public String getTitle() {
         return title;
     }
-    public void setAuthor(String author)
-    {
+
+    public void setAuthor(String author) {
         this.author = author;
     }
 
-    public String getAuthor()
-    {
+    public String getAuthor() {
         return author;
     }
-    public void setShowPictures(String showPictures)
-    {
+
+    public void setShowPictures(String showPictures) {
         this.showPictures = showPictures;
     }
 
-    public String getShowPictures()
-    {
+    public String getShowPictures() {
         return showPictures;
     }
-    public void setBriefContent(String briefContent)
-    {
+
+    public void setBriefContent(String briefContent) {
         this.briefContent = briefContent;
     }
 
-    public String getBriefContent()
-    {
+    public String getBriefContent() {
         return briefContent;
     }
-    public void setContent(String content)
-    {
+
+    public void setContent(String content) {
         this.content = content;
     }
 
-    public String getContent()
-    {
+    public String getContent() {
         return content;
     }
-    public void setCreateAt(Long createAt)
-    {
+
+    public void setCreateAt(Long createAt) {
         this.createAt = createAt;
     }
 
-    public Long getCreateAt()
-    {
+    public Long getCreateAt() {
         return createAt;
     }
-    public void setAuditFlag(String auditFlag)
-    {
+
+    public void setAuditFlag(String auditFlag) {
         this.auditFlag = auditFlag;
     }
 
-    public String getAuditFlag()
-    {
+    public String getAuditFlag() {
         return auditFlag;
     }
-    public void setAuditAt(Long auditAt)
-    {
+
+    public void setAuditAt(Long auditAt) {
         this.auditAt = auditAt;
     }
 
-    public Long getAuditAt()
-    {
+    public Long getAuditAt() {
         return auditAt;
     }
-    public void setAuditTime(Date auditTime)
-    {
+
+    public void setAuditTime(Date auditTime) {
         this.auditTime = auditTime;
     }
 
-    public Date getAuditTime()
-    {
+    public Date getAuditTime() {
         return auditTime;
     }
-    public void setAuditMsg(String auditMsg)
-    {
+
+    public void setAuditMsg(String auditMsg) {
         this.auditMsg = auditMsg;
     }
 
-    public String getAuditMsg()
-    {
+    public String getAuditMsg() {
         return auditMsg;
     }
-    public void setReleaseFlag(String releaseFlag)
-    {
+
+    public void setReleaseFlag(String releaseFlag) {
         this.releaseFlag = releaseFlag;
     }
 
-    public String getReleaseFlag()
-    {
+    public String getReleaseFlag() {
         return releaseFlag;
     }
-    public void setReleaseTime(Date releaseTime)
-    {
+
+    public void setReleaseTime(Date releaseTime) {
         this.releaseTime = releaseTime;
     }
 
-    public Date getReleaseTime()
-    {
+    public Date getReleaseTime() {
         return releaseTime;
     }
-    public void setReleaseAt(Long releaseAt)
-    {
+
+    public void setReleaseAt(Long releaseAt) {
         this.releaseAt = releaseAt;
     }
 
-    public Long getReleaseAt()
-    {
+    public Long getReleaseAt() {
         return releaseAt;
     }
-    public void setEndAuditAt(Long endAuditAt)
-    {
+
+    public void setEndAuditAt(Long endAuditAt) {
         this.endAuditAt = endAuditAt;
     }
 
-    public Long getEndAuditAt()
-    {
+    public Long getEndAuditAt() {
         return endAuditAt;
     }
-    public void setEndAuditTime(Date endAuditTime)
-    {
+
+    public void setEndAuditTime(Date endAuditTime) {
         this.endAuditTime = endAuditTime;
     }
 
-    public Date getEndAuditTime()
-    {
+    public Date getEndAuditTime() {
         return endAuditTime;
     }
-    public void setEndAuditMsg(String endAuditMsg)
-    {
+
+    public void setEndAuditMsg(String endAuditMsg) {
         this.endAuditMsg = endAuditMsg;
     }
 
-    public String getEndAuditMsg()
-    {
+    public String getEndAuditMsg() {
         return endAuditMsg;
     }
 
@@ -265,27 +284,27 @@ public class Content extends BaseEntity
 
     @Override
     public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("contentId", getContentId())
-            .append("serviceInfo", getServiceInfo())
-            .append("title", getTitle())
-            .append("author", getAuthor())
-            .append("showPictures", getShowPictures())
-            .append("briefContent", getBriefContent())
-            .append("content", getContent())
-            .append("createTime", getCreateTime())
-            .append("createAt", getCreateAt())
-            .append("auditFlag", getAuditFlag())
-            .append("auditAt", getAuditAt())
-            .append("auditTime", getAuditTime())
-            .append("auditMsg", getAuditMsg())
-            .append("releaseFlag", getReleaseFlag())
-            .append("releaseTime", getReleaseTime())
-            .append("releaseAt", getReleaseAt())
-            .append("endAuditAt", getEndAuditAt())
-            .append("endAuditTime", getEndAuditTime())
-            .append("endAuditMsg", getEndAuditMsg())
-            .append("browseNum", getBrowseNum())
-            .toString();
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("contentId", getContentId())
+                .append("serviceInfo", getServiceInfo())
+                .append("title", getTitle())
+                .append("author", getAuthor())
+                .append("showPictures", getShowPictures())
+                .append("briefContent", getBriefContent())
+                .append("content", getContent())
+                .append("createTime", getCreateTime())
+                .append("createAt", getCreateAt())
+                .append("auditFlag", getAuditFlag())
+                .append("auditAt", getAuditAt())
+                .append("auditTime", getAuditTime())
+                .append("auditMsg", getAuditMsg())
+                .append("releaseFlag", getReleaseFlag())
+                .append("releaseTime", getReleaseTime())
+                .append("releaseAt", getReleaseAt())
+                .append("endAuditAt", getEndAuditAt())
+                .append("endAuditTime", getEndAuditTime())
+                .append("endAuditMsg", getEndAuditMsg())
+                .append("browseNum", getBrowseNum())
+                .toString();
     }
 }

+ 10 - 0
smart-system/src/main/java/com/huijy/management/domain/ShopRoomOrder.java

@@ -73,6 +73,8 @@ public class ShopRoomOrder extends BaseEntity {
     @Excel(name = "天数")
     private Long days;
 
+    private String msg;
+
     private ShopRoom shopRoom;
 
     private String shopName;
@@ -81,6 +83,14 @@ public class ShopRoomOrder extends BaseEntity {
     private String role;
     private String openid;
 
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }
+
     public String getOpenid() {
         return openid;
     }

+ 5 - 3
smart-system/src/main/java/com/huijy/management/mapper/ContentMapper.java

@@ -11,8 +11,7 @@ import com.huijy.management.domain.Content;
  * @author luobo
  * @date 2021-09-12
  */
-public interface ContentMapper
-{
+public interface ContentMapper {
     /**
      * 查询内容管理
      *
@@ -21,6 +20,8 @@ public interface ContentMapper
      */
     public Content selectContentByContentId(Long contentId);
 
+    public List<Content> home(String serviceInfo);
+
     /**
      * 查询内容管理列表
      *
@@ -63,12 +64,13 @@ public interface ContentMapper
 
     /**
      * 更新点击量
+     *
      * @param contentId
      * @return
      */
     public Integer updateBrowseNumById(Long contentId);
 
-    public List<Map<String, Object>> home();
+    public List<Map<String, Object>> statistics();
 
 
 }

+ 6 - 5
smart-system/src/main/java/com/huijy/management/service/IContentService.java

@@ -11,8 +11,7 @@ import com.huijy.management.domain.Content;
  * @author luobo
  * @date 2021-09-12
  */
-public interface IContentService
-{
+public interface IContentService {
     /**
      * 查询内容管理
      *
@@ -29,6 +28,8 @@ public interface IContentService
      */
     public List<Content> selectContentList(Content content);
 
+    public List<Content> home(String serviceInfo);
+
     /**
      * 新增内容管理
      *
@@ -61,9 +62,9 @@ public interface IContentService
      */
     public int deleteContentByContentId(Long contentId);
 
-    Integer updateAudit(Long contentId,String auditFlag,String auditMsg,Long adminId);
+    Integer updateAudit(Long contentId, String auditFlag, String auditMsg, Long adminId);
 
-    Integer updateRelease(Long contentId,String releaseFlag,Long adminId);
+    Integer updateRelease(Long contentId, String releaseFlag, Long adminId);
 
-    public List<Map<String, Object>> home();
+    public List<Map<String, Object>> statistics();
 }

+ 27 - 29
smart-system/src/main/java/com/huijy/management/service/impl/ContentServiceImpl.java

@@ -19,8 +19,7 @@ import com.huijy.management.service.IContentService;
  * @date 2021-09-12
  */
 @Service
-public class ContentServiceImpl implements IContentService
-{
+public class ContentServiceImpl implements IContentService {
     @Autowired
     private ContentMapper contentMapper;
 
@@ -31,8 +30,7 @@ public class ContentServiceImpl implements IContentService
      * @return 内容管理
      */
     @Override
-    public Content selectContentByContentId(Long contentId)
-    {
+    public Content selectContentByContentId(Long contentId) {
         Content content = contentMapper.selectContentByContentId(contentId);
         /**
          * 最调用一次,就加一
@@ -48,11 +46,15 @@ public class ContentServiceImpl implements IContentService
      * @return 内容管理
      */
     @Override
-    public List<Content> selectContentList(Content content)
-    {
+    public List<Content> selectContentList(Content content) {
         return contentMapper.selectContentList(content);
     }
 
+    @Override
+    public List<Content> home(String serviceInfo) {
+        return contentMapper.home(serviceInfo);
+    }
+
     /**
      * 新增内容管理
      *
@@ -60,8 +62,7 @@ public class ContentServiceImpl implements IContentService
      * @return 结果
      */
     @Override
-    public int insertContent(Content content)
-    {
+    public int insertContent(Content content) {
         content.setCreateTime(DateUtils.getNowDate());
         content.setAuditFlag("0");
         content.setReleaseFlag("0");
@@ -76,8 +77,7 @@ public class ContentServiceImpl implements IContentService
      * @return 结果
      */
     @Override
-    public int updateContent(Content content)
-    {
+    public int updateContent(Content content) {
         return contentMapper.updateContent(content);
     }
 
@@ -88,8 +88,7 @@ public class ContentServiceImpl implements IContentService
      * @return 结果
      */
     @Override
-    public int deleteContentByContentIds(Long[] contentIds)
-    {
+    public int deleteContentByContentIds(Long[] contentIds) {
         return contentMapper.deleteContentByContentIds(contentIds);
     }
 
@@ -100,41 +99,40 @@ public class ContentServiceImpl implements IContentService
      * @return 结果
      */
     @Override
-    public int deleteContentByContentId(Long contentId)
-    {
+    public int deleteContentByContentId(Long contentId) {
         return contentMapper.deleteContentByContentId(contentId);
     }
 
-    public Integer updateAudit(Long contentId,String auditFlag,String auditMsg,Long adminId){
+    public Integer updateAudit(Long contentId, String auditFlag, String auditMsg, Long adminId) {
 
         //auditFlag 审核状态 0、未审核 1初审 2终审
 
         Content content = contentMapper.selectContentByContentId(contentId);
-        if (content==null){
+        if (content == null) {
             throw new ServiceException("内容信息为空");
         }
-        if (content.getReleaseFlag().equalsIgnoreCase("1")){
+        if (content.getReleaseFlag().equalsIgnoreCase("1")) {
             throw new ServiceException("内容已发布,不能审核/反审核操作");
         }
-        if (content.getAuditFlag().equalsIgnoreCase("0") && auditFlag.equalsIgnoreCase("2")){
+        if (content.getAuditFlag().equalsIgnoreCase("0") && auditFlag.equalsIgnoreCase("2")) {
 
-                throw new ServiceException("内容未初审,不能终审操作");
+            throw new ServiceException("内容未初审,不能终审操作");
 
         }
-        if (content.getAuditFlag().equalsIgnoreCase("2") && auditFlag.equalsIgnoreCase("1")){
+        if (content.getAuditFlag().equalsIgnoreCase("2") && auditFlag.equalsIgnoreCase("1")) {
             throw new ServiceException("内容已终审,不能初审操作");
         }
         content.setAuditFlag(auditFlag);
-        if(auditFlag.equalsIgnoreCase("1")){
+        if (auditFlag.equalsIgnoreCase("1")) {
             content.setAuditAt(adminId);
             content.setAuditTime(new Date());
             content.setAuditMsg(auditMsg);
-        }else if(auditFlag.equalsIgnoreCase("2")){
+        } else if (auditFlag.equalsIgnoreCase("2")) {
             content.setEndAuditAt(adminId);
             content.setEndAuditTime(new Date());
             content.setEndAuditMsg(auditMsg);
         }
-      return   updateContent(content);
+        return updateContent(content);
 
     }
 
@@ -143,22 +141,22 @@ public class ContentServiceImpl implements IContentService
         //auditFlag 审核状态 0、未审核 1初审 2终审
 
         Content content = contentMapper.selectContentByContentId(contentId);
-        if (content==null){
+        if (content == null) {
             throw new ServiceException("内容信息为空");
         }
-        if (!content.getAuditFlag().equalsIgnoreCase("2")){
+        if (!content.getAuditFlag().equalsIgnoreCase("2")) {
             throw new ServiceException("内容未终审,不能发布核操作");
         }
         content.setReleaseFlag(releaseFlag);
-        if (releaseFlag.equalsIgnoreCase("1")){
+        if (releaseFlag.equalsIgnoreCase("1")) {
             content.setReleaseAt(adminId);
             content.setReleaseTime(new Date());
         }
-        return   updateContent(content);
+        return updateContent(content);
     }
 
     @Override
-    public List<Map<String, Object>> home() {
-        return contentMapper.home();
+    public List<Map<String, Object>> statistics() {
+        return contentMapper.statistics();
     }
 }

+ 5 - 2
smart-system/src/main/resources/mapper/management/ContentMapper.xml

@@ -40,7 +40,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <where>
             <if test="title != null  and title != ''">and title like concat('%', #{title}, '%')</if>
             <if test="serviceInfo != null  and serviceInfo != ''"> and service_info = #{serviceInfo}</if>
-            <if test="serviceInfo != null  and serviceInfo != ''"> and service_info = #{serviceInfo}</if>
             <if test="auditFlag != null  and auditFlag != ''"> and audit_flag = #{auditFlag}</if>
             <if test="releaseFlag != null  and releaseFlag != ''"> and release_flag = #{releaseFlag}</if>
         </where>
@@ -51,6 +50,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where content_id = #{contentId}
     </select>
 
+    <select id="home"  resultMap="ContentResult">
+        select content_id, service_info,title, show_pictures,create_time from t_content where service_info = #{serviceInfo} and release_flag=1 order by create_time desc limit 1
+    </select>
+
     <insert id="insertContent" parameterType="Content" useGeneratedKeys="true" keyProperty="contentId">
         insert into t_content
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -139,7 +142,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </update>
 
     <!--后台UI首页数据统计-->
-    <select id="home" resultType="java.util.Map">
+    <select id="statistics" resultType="java.util.Map">
     SELECT a.date,ifnull(b.count,0) as wx,ifnull(c.count,0) as member,
     (SELECT COUNT(*) FROM t_content WHERE service_info=1 )AS content1,
     (SELECT COUNT(*) FROM t_content WHERE service_info=2 )AS content2,

+ 4 - 0
smart-system/src/main/resources/mapper/management/ShopRoomOrderMapper.xml

@@ -16,6 +16,7 @@
         <result property="max" column="max"/>
         <result property="createTime" column="create_time"/>
         <result property="days" column="days"/>
+        <result property="msg" column="msg"/>
         <result property="shopId" column="shopId"/>
         <result property="shopName" column="shopName"/>
         <result property="bossPhone" column="bossPhone"/>
@@ -73,6 +74,7 @@
             <if test="createTime != null">create_time,</if>
             <if test="days != null">days,</if>
             <if test="openid != null">openid,</if>
+            <if test="msg != null">msg,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="roomId != null">#{roomId},</if>
@@ -86,6 +88,7 @@
             <if test="createTime != null">#{createTime},</if>
             <if test="days != null">#{days},</if>
             <if test="openid != null">#{openid},</if>
+            <if test="msg != null">#{msg},</if>
         </trim>
     </insert>
 
@@ -103,6 +106,7 @@
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="days != null">days = #{days},</if>
             <if test="openid != null">openid = #{openid},</if>
+            <if test="msg != null">msg = #{msg},</if>
         </trim>
         where id = #{id}
     </update>

+ 4 - 4
smart-ui-app/common/http.js

@@ -1,18 +1,17 @@
-const ip = 'http://127.0.0.1:8080';
+//const ip = 'http://127.0.0.1:8080';
 //const ip = 'https://qfnj.gaswkj.com/prod-api';
 //const ip = 'http://192.168.0.100:8080';
-//const ip = 'https://xdmly.qiyiiot.com/prod-api';
+const ip = 'https://xdmly.qiyiiot.com/prod-api';
 /**
  * 全部接口(集中管理)
  */
 const urls = {
 	ip: ip,
-	home: ip + '/app/home/index', //首页数据
+	home: ip + '/api/index/home', //首页数据
 	wxLogin: ip + '/api/login/wxLogin/', //游客微信小程序登录
 	bindWxMobile: ip + '/api/index/bindWxMobile', //绑定会员微信手机号
 	getPageContent: ip + '/api/index/getPageContent', //分页获取主要内容信息
 	getContentInfo: ip + '/api/index/getContentInfo/', //获取主要内容详细信息
-	getAboutUs: ip + '/api/index/getAboutUs/', //获取关于我们的信息
 	pushRecord: ip + '/api/index/pushRecord', //门店数据上报
 	shopApply: ip + '/api/index/shopApply', //商铺开通申请
 	getShopList: ip + '/api/index/getShopList', //获取商铺列表
@@ -26,6 +25,7 @@ const urls = {
 	shopManage: ip + '/api/index/shopManage', //店铺管理
 	hotelBook: ip + '/api/index/hotelBook', //酒店房间预订
 	hotelEnable: ip + '/api/index/hotelEnable', //是否开启酒店预订
+	hotelDelete: ip + '/api/index/hotelDelete', //注销并且关闭店铺
 	order: ip + '/api/index/order', //预订房间订单
 	orderDeal: ip + '/api/index/orderDeal', //商家订单处理
 	orderDelete: ip + '/api/index/orderDelete', //商家订单删除

+ 2 - 1
smart-ui-app/pages.json

@@ -25,7 +25,8 @@
 			"path": "pages/shop/manage",
 			"style": {
 				"navigationBarTitleText": "店铺管理",
-				"enablePullDownRefresh": false
+				"enablePullDownRefresh": true,
+				"backgroundTextStyle": "dark"
 			}
 
 		},

+ 23 - 32
smart-ui-app/pages/index/index2.vue

@@ -41,18 +41,18 @@
 			</view>
 		</view>
 		<view class="it">
-			<view class="title">
+			<view class="v_title">
 				<image src="../../static/lo.png" class="lo" mode="widthFix"></image>
-				<view class="hd">热门景区</view>
+				<view class="hd">最新景区</view>
 				<view class="more" @click="tab('/pages/travel/index')">
 					更多
 					<text class="arrow icon">&#xe62d;</text>
 				</view>
 				<view class="clear"></view>
 			</view>
-			<view class="item">
-				<image src="../../static/a15.jpg" class="bmg"></image>
-				<view class="tit">2021年谢通门“文化旅游节”开幕</view>
+			<view class="item" v-for="(item, index) in hot_list" :key="index" @click="detail(item)">
+				<image :src="ip + item.showPictures" class="bmg"></image>
+				<view class="tit omit">{{ item.title }}</view>
 				<view class="desc omit">
 					谢通门是藏族独具特色的传统节日,至今已有600多年的历史。 “达玛文化旅游节”是谢通门县一年一度的传统节日,是历史民族文化的传承,该活动的举办将实现民族、经贸的交往交
 					流交融,为期五天的“达玛节”,除进行群众文艺演出、物交会外,还将进行赛马、赛牦牛、跑马射箭、抱石头等传统 民族体育活动。
@@ -60,7 +60,7 @@
 			</view>
 		</view>
 		<view class="it">
-			<view class="title">
+			<view class="v_title">
 				<image src="../../static/lo.png" class="lo" mode="widthFix"></image>
 				<view class="hd">攻略指南</view>
 				<view class="more" @click="navigate('/pages/travel/introduction')">
@@ -69,10 +69,10 @@
 				</view>
 				<view class="clear"></view>
 			</view>
-			<view class="item flex">
-				<view class="f" style="overflow: hidden;"><image src="../../static/img2.jpg" class="img"></image></view>
+			<view class="item flex" v-for="(item, index) in zn_list" :key="index" @click="detail(item)">
+				<view class="f"><image :src="ip + item.showPictures" class="img"></image></view>
 				<view class="f" style="padding: 10px;">
-					<view class="tit">日喀则的绝色风光</view>
+					<view class="tit omit">{{ item.title }}</view>
 					<view class="str-summery">日喀则绝美的自然风光,历史悠久的古城古韵、青山绿水、蓝天白云......如此震撼人心的独特景致!</view>
 					<view class="lx">浏览</view>
 				</view>
@@ -88,7 +88,8 @@ export default {
 		return {
 			ip: this.$http.urls.ip,
 			scrollTop: 0,
-			item: { showPictures: [] }
+			hot_list: [],
+			zn_list: []
 		};
 	},
 	onPageScroll(e) {
@@ -101,13 +102,11 @@ export default {
 	methods: {
 		init() {
 			this.$http.request({
-				url: this.$http.urls.getAboutUs,
+				url: this.$http.urls.home,
 				success: res => {
-					this.item = res.data.data.aboutUs;
-					if (this.item.showPictures) {
-						this.item.showPictures = this.item.showPictures.split(',');
-					}
-					uni.setStorageSync('aboutUs', this.item);
+					this.hot_list = res.data.data.hot_list;
+					this.zn_list = res.data.data.zn_list;
+					uni.setStorageSync('aboutUs', res.data.data.aboutUs);
 				}
 			});
 		},
@@ -170,35 +169,22 @@ export default {
 }
 .it {
 	margin-top: 15px;
-	.title {
-		font-size: 20px;
-		margin-bottom: -15px;
-		font-weight: bold;
-		color: #333;
-		.lo {
-			width: 150px;
-		}
-		.hd {
-			position: absolute;
-			left: 20px;
-			margin-top: -35px;
-		}
-	}
 	.item {
-		margin-top: 10px;
 		padding: 10px;
 		.bmg {
 			width: 100%;
 			height: 150px;
+			border-radius: 5px;
 		}
 		.tit {
 			font-size: 17px;
 			font-weight: bold;
+			margin-top: 3px;
 		}
 		.desc {
 			font-size: 13px;
 			color: $dar;
-			padding-top: 3px;
+			padding-top: 4px;
 		}
 		.img {
 			height: 200px;
@@ -229,4 +215,9 @@ export default {
 		}
 	}
 }
+.v_title {
+	.hd {
+		left: 25px;
+	}
+}
 </style>

+ 1 - 1
smart-ui-app/pages/order/my.vue

@@ -62,7 +62,7 @@ export default {
 	data() {
 		return {
 			ip: this.$http.urls.ip,
-			tab: [{ name: '所有预订', state: '' }, { name: '待确认', state: 0 }, { name: '已确认', state: 1 }, { name: '已取消', state: 2 }],
+			tab: [{ name: '所有预订', state: '' }, { name: '待确认', state: 0 }, { name: '成功', state: 1 }, { name: '已退订', state: 2 }],
 			numList: [{ name: '我的信息' }, { name: '订单确认' }, { name: '登记入住' }],
 			current: 0,
 			list: [],

+ 27 - 9
smart-ui-app/pages/order/sale.vue

@@ -8,8 +8,8 @@
 					<text class="icon">&#xe62d;</text>
 					<view class="zhu">
 						<text v-if="item.state == 0" style="color:#67c23a;">待确认</text>
-						<text v-if="item.state == 1" style="color:#67c23a;">预定确认</text>
-						<text v-if="item.state == 2" style="color:orange;">预定取消</text>
+						<text v-if="item.state == 1" style="color:#67c23a;">成功</text>
+						<text v-if="item.state == 2" style="color:orange;">退订</text>
 					</view>
 				</view>
 				<view class="r_item">
@@ -25,7 +25,7 @@
 				</view>
 				<view class="hj">{{ item.createTime }}</view>
 				<view class="clear"></view>
-				<view class="tk" v-if="item.state == 2">您取消了该客户的预定。</view>
+				<view class="tk" v-if="item.state == 2">退订:{{item.msg}}</view>
 			</view>
 			<view class="loading"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
 		</view>
@@ -53,7 +53,15 @@
 				</view>
 				<u-divider style="padding-top: 10px;">订单处理</u-divider>
 				<button class="btn" style="background-color:#67c23a;" @click="op(1)">确认</button>
-				<button class="btn" @click="op(2)">取消</button>
+				<button class="btn" @click="refuse_show = true">退订</button>
+			</view>
+		</u-popup>
+		<!--预订订单信息-->
+		<u-popup v-model="refuse_show" :mask-close-able="false" mode="center" border-radius="14" width="90%" height="auto" :closeable="true">
+			<view class="u-popup">
+				<view class="tttt" style="font-weight: bolder;">退订原因</view>
+				<textarea placeholder="例如:抱歉,入住的时间段酒店客房已满,无法安排入住。" v-model="book.msg"></textarea>
+				<button class="btn" @click="op(2)">确定</button>
 			</view>
 		</u-popup>
 	</view>
@@ -64,13 +72,14 @@ export default {
 	data() {
 		return {
 			ip: this.$http.urls.ip,
-			tab: [{ name: '所有预订', state: '' }, { name: '待确认', state: 0 }, { name: '已确认', state: 1 }, { name: '已取消', state: 2 }],
+			tab: [{ name: '所有预订', state: '' }, { name: '待确认', state: 0 }, { name: '成功', state: 1 }, { name: '已退订', state: 2 }],
 			numList: [{ name: '客户资料' }, { name: '订单确认' }, { name: '登记入住' }],
 			current: 0,
 			list: [],
-			param: { pageNum: 1, state: '', role: 'sale'},
+			param: { pageNum: 1, state: '', role: 'sale' },
 			loadMore: true,
 			popup_show: false,
+			refuse_show: false,
 			book: {}
 		};
 	},
@@ -102,7 +111,7 @@ export default {
 			uni.navigateTo({ url: '/pages/shop/detail?shopId=' + item.shopId });
 		},
 		detail(item) {
-			this.book =JSON.parse(JSON.stringify(item));
+			this.book = JSON.parse(JSON.stringify(item));
 			delete this.book.createTime;
 			this.book.day = item.min + ' 至 ' + item.max;
 			this.popup_show = true;
@@ -120,13 +129,14 @@ export default {
 				content: '是否处理该订单?',
 				success: res => {
 					if (res.confirm) {
-						this.book.state=index;
+						this.book.state = index;
 						this.$http.request({
 							url: this.$http.urls.orderDeal,
-							data:this.book,
+							data: this.book,
 							method: 'POST',
 							success: res => {
 								uni.showToast({ title: '操作成功' });
+								this.refuse_show = false;
 								this.popup_show = false;
 								this.refresh();
 							}
@@ -178,4 +188,12 @@ page {
 		}
 	}
 }
+textarea {
+	border-radius: 5px;
+	padding: 7px;
+	width: 95%;
+	height: 100px;
+	box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.3);
+	margin-bottom: 15px;
+}
 </style>

+ 1 - 0
smart-ui-app/pages/shop/detail.vue

@@ -163,6 +163,7 @@ export default {
 	}
 	.r_item {
 		box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0);
+		border-radius: 0px;
 	}
 	.day {
 		position: absolute;

+ 1 - 0
smart-ui-app/pages/shop/hotel/room.vue

@@ -165,6 +165,7 @@ export default {
 	padding: 0px 10px 70px 10px;
 	.r_item {
 		box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0);
+		border-radius: 0px;
 		.btn {
 			float: right;
 			margin-top: -54px;

+ 19 - 4
smart-ui-app/pages/shop/manage.vue

@@ -46,7 +46,7 @@
 				<u-switch v-model="item.enableFlag" @change="change" active-color="#67c23a" active-value="0" inactive-value="1"></u-switch>
 			</view>
 		</view>
-		<view class="hotel_item" v-if="item.shopType == 2">
+		<view class="hotel_item">
 			<view class="enable">
 				<text>注销并且关闭店铺</text>
 				<text class="del" @click="del()">确定</text>
@@ -66,6 +66,8 @@ export default {
 	},
 	onLoad(e) {
 		this.shopId = e.shopId;
+	},
+	onShow() {
 		this.getData();
 	},
 	methods: {
@@ -113,14 +115,27 @@ export default {
 				success: res => {
 					if (res.confirm) {
 						this.$http.request({
-							url: this.$http.urls.hotelEnable,
-							data: { shopId: this.item.shopId, enableFlag: status },
-							success: res => {}
+							url: this.$http.urls.hotelDelete,
+							data: { shopId: this.item.shopId },
+							success: res => {
+								uni.$emit('shop');
+								uni.showToast({ title: '操作成功' });
+								setTimeout(() => {
+									uni.navigateBack();
+								}, 1000);
+							}
 						});
 					}
 				}
 			});
 		}
+	},
+	//下拉刷新
+	onPullDownRefresh() {
+		setTimeout(() => {
+			uni.stopPullDownRefresh();
+			this.getData();
+		}, 1000);
 	}
 };
 </script>

+ 20 - 17
smart-ui/src/views/management/content/index.vue

@@ -40,21 +40,13 @@
       <el-table-column label="审核状态" align="center" prop="auditFlag" width="110">
         <template slot-scope="scope">
           <el-tag type="danger" effect="dark" v-if="scope.row.auditFlag == 0">未审核</el-tag>
-          <el-tag effect="dark" v-if="scope.row.auditFlag == 1">初审</el-tag>
-          <el-tag type="success" effect="dark" v-if="scope.row.auditFlag == 2">终审</el-tag>
+          <el-tag effect="dark" v-if="scope.row.auditFlag == 1">初审通过</el-tag>
+          <el-tag type="success" effect="dark" v-if="scope.row.auditFlag == 2">终审通过</el-tag>
           <el-tag type="danger" effect="dark" v-if="scope.row.auditFlag == 3">不通过</el-tag>
         </template>
       </el-table-column>
-      <el-table-column label="初审时间" align="center" prop="auditTime" width="180">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.auditTime, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="终审时间" align="center" prop="endAuditTime" width="180">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.endAuditTime, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
+      <el-table-column label="初审时间" align="center" prop="auditTime" width="180"/>
+      <el-table-column label="终审时间" align="center" prop="endAuditTime" width="180" />
       <el-table-column label="发布标志" align="center" prop="releaseFlag" width="100">
         <template slot-scope="scope">
           <el-tag type="danger" effect="dark" v-if="scope.row.releaseFlag == 0">未发布</el-tag>
@@ -104,7 +96,7 @@
             取消发布
           </el-button>
           <el-button
-            v-if="scope.row.auditFlag == 0"
+            v-if="scope.row.auditFlag == 0||scope.row.auditFlag == 3"
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
@@ -123,6 +115,12 @@
 
     <!-- 添加或修改内容管理对话框 -->
     <el-dialog :title="title" :visible.sync="open" :close-on-click-modal="false" width="75%" append-to-body>
+      <el-steps  align-center style="margin-bottom: 20px;">
+        <el-step title="填写内容"></el-step>
+        <el-step title="内容初审"></el-step>
+        <el-step title="内容终审"></el-step>
+        <el-step title="内容发布"></el-step>
+      </el-steps>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
         <el-form-item label="信息类型" prop="serviceInfo">
           <el-select v-model="form.serviceInfo" disabled placeholder="请选择信息类型">
@@ -134,16 +132,22 @@
         <el-form-item label="点击量" prop="browseNum" v-if="serviceInfo == 2 || serviceInfo == 3">
           <el-input-number v-model="form.browseNum" :min="1" :step="10" placeholder="请输入点击量" />
         </el-form-item>
-        <el-form-item label="展示图片" v-if="serviceInfo == 2 || serviceInfo == 3"><imageUpload :limit="1" v-model="form.showPictures" /></el-form-item>
+        <el-form-item label="封面图片" v-if="serviceInfo == 2 || serviceInfo == 3"><imageUpload :limit="1" v-model="form.showPictures" /></el-form-item>
         <el-form-item label="详情" prop="content"><editor v-model="form.content" :min-height="200" /></el-form-item>
       </el-form>
-      <div slot="footer" class="dialog-footer" v-if="form.auditFlag == null || form.auditFlag == 0">
+      <div slot="footer" class="dialog-footer" v-if="form.auditFlag == null || form.auditFlag == 0||form.auditFlag == 3">
         <el-button type="primary" @click="submitForm">确 定</el-button>
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
     <!-- 审核 -->
     <el-dialog :title="auditTitle" :visible.sync="auditOpen" :close-on-click-modal="false" width="50%" append-to-body>
+      <el-steps  align-center style="margin-bottom: 20px;">
+        <el-step title="填写内容"></el-step>
+        <el-step title="内容初审"></el-step>
+        <el-step title="内容终审"></el-step>
+        <el-step title="内容发布"></el-step>
+      </el-steps>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
         <el-form-item label="信息类型" prop="serviceInfo">
           <el-select v-model="form.serviceInfo" disabled placeholder="请选择信息类型">
@@ -167,7 +171,6 @@
         </template>
         <template v-if="flag == 3">
           <el-form-item label="发布状态" prop="releaseFlag">
-            <!-- <el-input v-model="form.auditMsg" placeholder="发布状态" /> -->
             <el-radio-group v-model="form.releaseFlag" disabled>
               <el-radio v-for="dict in releaseFlagOptions" :key="dict.dictValue" :label="dict.dictValue">{{ dict.dictLabel }}</el-radio>
             </el-radio-group>
@@ -364,7 +367,7 @@ export default {
       const contentId = row.contentId || this.ids;
       getContent(contentId).then(response => {
         this.form = response.data;
-        if (this.form.auditFlag == 0) {
+        if (this.form.auditFlag == 0||this.form.auditFlag==3) {
           this.open = true;
           this.title = '修改内容管理';
         } else {