Browse Source

Merge remote-tracking branch 'origin/master'

wangzhe 1 year ago
parent
commit
191bb9de48
21 changed files with 345 additions and 40 deletions
  1. 4 2
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/information/InformationController.java
  2. 74 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/matter/collectConller.java
  3. 13 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/matter/matterConllter.java
  4. 1 3
      sooka-jnb/src/main/java/com/sooka/jnb/information/domain/Information.java
  5. 1 2
      sooka-jnb/src/main/java/com/sooka/jnb/information/mapper/InformationMapper.java
  6. 1 3
      sooka-jnb/src/main/java/com/sooka/jnb/information/service/InformationService.java
  7. 18 19
      sooka-jnb/src/main/java/com/sooka/jnb/information/service/impl/InformationServiceImpl.java
  8. 21 0
      sooka-jnb/src/main/java/com/sooka/jnb/matter/domin/Collect.java
  9. 6 0
      sooka-jnb/src/main/java/com/sooka/jnb/matter/domin/Matter.java
  10. 29 0
      sooka-jnb/src/main/java/com/sooka/jnb/matter/mapper/CollectMapper.java
  11. 10 0
      sooka-jnb/src/main/java/com/sooka/jnb/matter/mapper/MatterMapper.java
  12. 26 0
      sooka-jnb/src/main/java/com/sooka/jnb/matter/service/CollectService.java
  13. 9 0
      sooka-jnb/src/main/java/com/sooka/jnb/matter/service/MatterService.java
  14. 50 0
      sooka-jnb/src/main/java/com/sooka/jnb/matter/service/impl/CollectServicempl.java
  15. 17 0
      sooka-jnb/src/main/java/com/sooka/jnb/matter/service/impl/MatterServicempl.java
  16. 3 2
      sooka-jnb/src/main/resources/mapper/department/DepartmentMapper.xml
  17. 1 0
      sooka-jnb/src/main/resources/mapper/handleAffairs/GridTypeMapper.xml
  18. 1 0
      sooka-jnb/src/main/resources/mapper/handleAffairs/TopicTypeMapper.xml
  19. 6 7
      sooka-jnb/src/main/resources/mapper/information/InformationMapper.xml
  20. 35 0
      sooka-jnb/src/main/resources/mapper/matter/collectMapper.xml
  21. 19 2
      sooka-jnb/src/main/resources/mapper/matter/matterMapper.xml

+ 4 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/information/InformationController.java

@@ -84,9 +84,11 @@ public class InformationController extends BaseController
      */
 //    @PreAuthorize("@ss.hasPermi('jnb:information:query')")
     @GetMapping("/listWxs")
-    public TableDataInfo listWxs(Information information, Integer pageNum,Integer pageSize)
+    public TableDataInfo listWxs(Information information)
     {
-        return informationService.selectInformationListWxs(information,pageNum,pageSize);
+        startPage();
+        List<Information> list = informationService.selectInformationListWxs(information);
+        return getDataTable(list);
     }
 
 

+ 74 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/matter/collectConller.java

@@ -0,0 +1,74 @@
+package com.ruoyi.web.controller.matter;
+
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.sooka.jnb.matter.domin.Collect;
+import com.sooka.jnb.matter.domin.Matter;
+import com.sooka.jnb.matter.service.CollectService;
+
+import com.sooka.jnb.matter.service.MatterService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+@RestController
+@RequestMapping("/system/collect")
+public class collectConller extends BaseController {
+
+    @Autowired
+    private CollectService collectService;
+
+    @Autowired
+    private MatterService matterService;
+
+
+    /**
+     * 是否展示
+     */
+    @GetMapping("list")
+    public TableDataInfo list( Matter matter)
+    {
+        List<Matter> list = matterService.selectSysrecommendVo(matter);
+        return getDataTable(list);
+    }
+
+    /**
+     * 收藏事项
+     */
+    @PostMapping("add")
+    public AjaxResult add(@RequestBody Collect collect)
+    {
+        return toAjax(collectService.insertcollect(collect));
+    }
+
+
+    /**
+     * 获取事项详细信息
+     */
+    @GetMapping(value = "/lists/{id}")
+    public AjaxResult getInfo(@PathVariable("id") String id)
+    {
+        return success(collectService.selectcollect(id));
+    }
+
+    /**
+     * 获取收藏详细信息
+     */
+    @GetMapping(value = "/collectlist/{id}")
+    public TableDataInfo collectlist(@PathVariable("id") String id)
+    {
+        List<Matter> list = matterService.collectlist(id);
+        return getDataTable(list);
+
+    }
+    /**
+     * 取消事项收藏
+     */
+    @DeleteMapping("/delete/{id}")
+    public AjaxResult remove(@PathVariable Long id)
+    {
+        return toAjax(collectService.deletecollect(id));
+    }
+}

+ 13 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/matter/matterConllter.java

@@ -5,6 +5,8 @@ import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.page.TableDataInfo;
 
 import com.sooka.jnb.department.domin.Department;
+import com.sooka.jnb.department.service.DepartmentService;
+import com.sooka.jnb.matter.domin.Collect;
 import com.sooka.jnb.matter.domin.Matter;
 import com.sooka.jnb.matter.service.MatterService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -24,6 +26,8 @@ public class matterConllter extends BaseController {
     @Autowired
     private MatterService matterService;
 
+    @Autowired
+    private DepartmentService departmentService;
         /**
          * 查询事项列表
          */
@@ -42,6 +46,15 @@ public class matterConllter extends BaseController {
     {
         return success(matterService.selectSysMatterVo(matter));
     }
+
+    /**
+     * 查询事项列表
+     */
+    @GetMapping("/listdept")
+    public AjaxResult listdept(Department department)
+    {
+        return success(departmentService.selectSysDeptVo(department));
+    }
         /**
          * 获取事项详细信息
          */

+ 1 - 3
sooka-jnb/src/main/java/com/sooka/jnb/information/domain/Information.java

@@ -1,11 +1,9 @@
 package com.sooka.jnb.information.domain;
 
 import com.baomidou.mybatisplus.annotation.TableField;
-import lombok.Data;
-import org.apache.commons.lang3.builder.ToStringBuilder;
-import org.apache.commons.lang3.builder.ToStringStyle;
 import com.ruoyi.common.annotation.Excel;
 import com.ruoyi.common.core.domain.BaseEntity;
+import lombok.Data;
 
 import javax.validation.constraints.NotBlank;
 import java.util.List;

+ 1 - 2
sooka-jnb/src/main/java/com/sooka/jnb/information/mapper/InformationMapper.java

@@ -1,6 +1,5 @@
 package com.sooka.jnb.information.mapper;
 
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.sooka.jnb.information.domain.Information;
 import org.apache.ibatis.annotations.Param;
 
@@ -67,7 +66,7 @@ public interface InformationMapper
      * @param information 按照时间,点赞,浏览 排序
      * @return 结果
      */
-    List<Information> selectInformationListWxs(@Param("obj") Information information, @Param("pageNum") Integer pageNum, @Param("pageSize") Integer pageSize);
+    List<Information> selectInformationListWxs(@Param("obj") Information information);
 
     /**
      * 置顶,政策推荐 3个

+ 1 - 3
sooka-jnb/src/main/java/com/sooka/jnb/information/service/InformationService.java

@@ -1,7 +1,5 @@
 package com.sooka.jnb.information.service;
 
-import com.github.pagehelper.Page;
-import com.ruoyi.common.core.page.TableDataInfo;
 import com.sooka.jnb.information.domain.Information;
 import com.sooka.jnb.information.domain.InformationUni;
 
@@ -74,7 +72,7 @@ public interface InformationService
      */
     public int deleteInformationByIds(Long[] ids,Integer type);
 
-    TableDataInfo selectInformationListWxs(Information information, Integer pageNum, Integer pageSize);
+    List<Information> selectInformationListWxs(Information information);
 
     int likeById(Information information);
     int watchById(Information information);

+ 18 - 19
sooka-jnb/src/main/java/com/sooka/jnb/information/service/impl/InformationServiceImpl.java

@@ -1,12 +1,5 @@
 package com.sooka.jnb.information.service.impl;
 
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.stream.Collectors;
-
-import com.github.pagehelper.Page;
-import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.SecurityUtils;
 import com.sooka.jnb.highServer.domain.JnbHighServerImg;
@@ -21,6 +14,11 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.ObjectUtils;
 
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Collectors;
+
 /**
  * 高频服务Service业务层处理
  * 
@@ -69,21 +67,22 @@ public class InformationServiceImpl implements InformationService
         }).collect(Collectors.toList());
     }
     @Override
-    public TableDataInfo selectInformationListWxs(Information information, Integer pageNum, Integer pageSize)
+    public List<Information> selectInformationListWxs(Information information)
     {
-//        List<Information> result = informationMapper.selectInformationListWxs(information,pageNum, pageSize);
-        System.out.println(information.getIsTop());
-        List<Information> toolForAbsenteeism = informationMapper.selectInformationListWxs(information,pageNum, pageSize);
-        TableDataInfo tableDataInfo = new TableDataInfo();
-        tableDataInfo.setRows(toolForAbsenteeism.stream() .skip((long) (pageNum - 1) * pageSize)
-                .limit(pageSize)
-                .collect(Collectors.toList()));
-        tableDataInfo.setTotal(toolForAbsenteeism.size());
-        tableDataInfo.setCode(200);
-        tableDataInfo.setMsg("查询成功");
-        return tableDataInfo;
+        List<Information> list = informationMapper.selectInformationListWxs(information);
+        for (Information information1 : list) {
+            if (information1.getImgUrlList()!=null){
+                String[] split = information1.getImgUrlList().split(",");
+                information1.setUrls(Arrays.asList(split));
+            }
+            else {
+                information1.setUrls(new ArrayList<>(0));
+            }
+        }
+        return list;
     }
 
+
     @Override
     public int likeById(Information information) {
        return informationMapper.updateInformationLike(information);

+ 21 - 0
sooka-jnb/src/main/java/com/sooka/jnb/matter/domin/Collect.java

@@ -0,0 +1,21 @@
+package com.sooka.jnb.matter.domin;
+
+import com.ruoyi.common.core.domain.BaseEntity;
+import lombok.Data;
+
+
+@Data
+
+
+public class Collect  extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+
+    //id
+    private Integer id;
+    //用户id
+    private  String  userId;
+    //事项id
+    private  String  matterId;
+
+}

+ 6 - 0
sooka-jnb/src/main/java/com/sooka/jnb/matter/domin/Matter.java

@@ -26,6 +26,12 @@ public class Matter extends BaseEntity {
         private  String examine;
         //内容
         private  String content;
+
+        //内容
+        private  String userId;
+
+        //内容
+        private  String matterId;
     }
 
 

+ 29 - 0
sooka-jnb/src/main/java/com/sooka/jnb/matter/mapper/CollectMapper.java

@@ -0,0 +1,29 @@
+package com.sooka.jnb.matter.mapper;
+
+import com.sooka.jnb.matter.domin.Collect;
+import com.sooka.jnb.matter.domin.Matter;
+
+import java.util.List;
+
+public interface CollectMapper {
+    /**
+     * 收藏事项
+     */
+    int insertcollect(Collect collect);
+
+
+    /**
+     * 获取收藏事项详细信息
+     */
+    Collect selectcollect(String id);
+
+    /**
+     * 获取事项详细信息
+     */
+    List<Matter> collectlist(String id);
+
+    /**
+     * 取消事项收藏
+     */
+    int deletecollect(Long id);
+}

+ 10 - 0
sooka-jnb/src/main/java/com/sooka/jnb/matter/mapper/MatterMapper.java

@@ -23,6 +23,11 @@ public interface MatterMapper {
         List<Matter> selectSysMatterVo(Matter matter);
 
         /**
+         * 查询推荐事项列表
+         */
+        List<Matter> selectSysrecommendVo(Matter matter);
+
+        /**
          * 新增事项
          */
         int insertSysMatter(Matter matter);
@@ -38,6 +43,11 @@ public interface MatterMapper {
         int examine(Matter matter);
 
         /**
+         * 获取事项详细信息
+         */
+        List<Matter> collectlist(String id);
+
+        /**
          * 删除事项
          */
         int deleteSysMatterByDeptId(Long id);

+ 26 - 0
sooka-jnb/src/main/java/com/sooka/jnb/matter/service/CollectService.java

@@ -0,0 +1,26 @@
+package com.sooka.jnb.matter.service;
+
+import com.sooka.jnb.matter.domin.Collect;
+import com.sooka.jnb.matter.domin.Matter;
+
+import java.util.List;
+
+
+public interface CollectService {
+
+    /**
+     * 收藏事项
+     */
+    int insertcollect(Collect collect);
+
+    /**
+     * 获取收藏事项详细信息
+     */
+    Collect selectcollect(String id);
+
+
+    /**
+     * 取消事项收藏
+     */
+    int deletecollect(Long id);
+}

+ 9 - 0
sooka-jnb/src/main/java/com/sooka/jnb/matter/service/MatterService.java

@@ -19,6 +19,15 @@ public interface MatterService
      List<Matter> selectSysMatterVo(Matter matter);
 
     /**
+     * 查询推荐事项列表
+     */
+    List<Matter> selectSysrecommendVo(Matter matter);
+    /**
+     * 获取收藏详细信息
+     */
+    List<Matter> collectlist(String id);
+
+    /**
      * 新增事项
      */
     int insertSysMatter(Matter matter);

+ 50 - 0
sooka-jnb/src/main/java/com/sooka/jnb/matter/service/impl/CollectServicempl.java

@@ -0,0 +1,50 @@
+package com.sooka.jnb.matter.service.impl;
+
+
+import com.sooka.jnb.matter.domin.Collect;
+
+import com.sooka.jnb.matter.domin.Matter;
+import com.sooka.jnb.matter.mapper.CollectMapper;
+import com.sooka.jnb.matter.mapper.MatterMapper;
+import com.sooka.jnb.matter.service.CollectService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+@Service
+public class CollectServicempl  implements CollectService {
+
+    @Resource
+    private CollectMapper collectMapper;
+
+    @Resource
+    private MatterMapper matterMapper;
+    /**
+     * 收藏事项
+     */
+    @Override
+    public int insertcollect(Collect collect) {
+        return collectMapper.insertcollect( collect);
+    }
+
+    /**
+     * 获取收藏事项详细信息
+     */
+    @Override
+    public Collect selectcollect(String id)
+    {
+        return collectMapper.selectcollect(id);
+    }
+
+
+    /**
+     * 取消事项收藏
+     */
+    @Override
+    public int deletecollect(Long id)
+    {
+        return collectMapper.deletecollect(id);
+    }
+
+}

+ 17 - 0
sooka-jnb/src/main/java/com/sooka/jnb/matter/service/impl/MatterServicempl.java

@@ -36,6 +36,23 @@ public class MatterServicempl implements MatterService
     }
 
     /**
+     * 查询推荐事项列表
+     */
+    @Override
+    public List<Matter> selectSysrecommendVo(Matter matter)
+    {
+        return matterMapper.selectSysrecommendVo(matter);
+    }
+    /**
+     * 获取事项详细信息
+     */
+    @Override
+    public List<Matter> collectlist(String id)
+    {
+        return matterMapper.collectlist(id);
+    }
+
+    /**
      * 新增事项
      */
     @Override

+ 3 - 2
sooka-jnb/src/main/resources/mapper/department/DepartmentMapper.xml

@@ -9,16 +9,17 @@
         <result property="name"    column="name"    />
         <result property="shows"    column="shows"    />
         <result property="application"    column="application"    />
+
     </resultMap>
 
     <select id="selectSysDeptVo"  resultMap="DepartmentResult">
         select  id,name, shows, application from jnb_department_configuration
         <where>
             <if test="name != null and name !=''">
-                AND name LIKE '%' #{name} '%'
+                AND name LIKE  concat('%', #{name}, '%')
             </if>
             <if test="application != null and application !=''">
-                AND application LIKE '%' #{application} '%'
+                AND application LIKE  concat('%', #{application}, '%')
             </if>
         </where>
     </select>

+ 1 - 0
sooka-jnb/src/main/resources/mapper/handleAffairs/GridTypeMapper.xml

@@ -30,6 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
             <if test="yesOrNoShow != null  and yesOrNoShow != ''"> and yes_or_no_show = #{yesOrNoShow}</if>
         </where>
+        order by create_time DESC
     </select>
     
     <select id="selectGridTypeById" parameterType="Long" resultMap="GridTypeResult">

+ 1 - 0
sooka-jnb/src/main/resources/mapper/handleAffairs/TopicTypeMapper.xml

@@ -30,6 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="yesOrNoShow != null  and yesOrNoShow != ''"> and yes_or_no_show = #{yesOrNoShow}</if>
             <if test="objectOfHandling != null  and objectOfHandling != ''"> and object_of_handling like concat('%',#{objectOfHandling},'%')</if>
         </where>
+        order by create_time DESC
     </select>
     
     <select id="selectTopicTypeById" parameterType="Long" resultMap="TopicTypeResult">

+ 6 - 7
sooka-jnb/src/main/resources/mapper/information/InformationMapper.xml

@@ -81,9 +81,7 @@
         <result property="updateBy" column="update_by"/>
         <result property="updateTime" column="update_time"/>
         <result property="delFlag" column="del_flag"/>
-        <collection property="urls" ofType="java.lang.String">
-            <result column="url" property="url"/>
-        </collection>
+        <result property="imgUrlList" column="imgUrlList"/>
     </resultMap>
 
     <select id="selectInformationListWxs"  resultMap="InformationResult1">
@@ -101,14 +99,15 @@
         a.is_top,
         a.like_num,
         a.watch_num,
-        i.img_url AS url
+        group_concat(i.img_url) AS imgUrlList
         FROM jnb_high_server AS a
         LEFT JOIN jnb_high_server_img AS i ON a.id = i.server_id AND i.del_flag = 0 AND i.type = #{obj.type}
         where a.del_flag = 0
-            <if test="obj.titleName != null  and obj.titleName != ''">and a.title_name like concat('%', #{obj.titleName}, '%')</if>
-            <if test="obj.type != null and obj.type != ''">and a.type = #{obj.type}</if>
+        <if test="obj.titleName != null  and obj.titleName != ''">and a.title_name like concat('%', #{obj.titleName}, '%')</if>
+        <if test="obj.type != null and obj.type != ''">and a.type = #{obj.type}</if>
         <if test="obj.isTop!=null">and a.is_top = #{obj.isTop}</if>
-            <if test="obj.isGovernment != null and obj.isGovernment != ''">and a.is_government = #{obj.isGovernment}</if>
+        <if test="obj.isGovernment != null and obj.isGovernment != ''">and a.is_government = #{obj.isGovernment}</if>
+        group by a.id
         <choose>
             <when test="obj.flag == 'like'">
                 ORDER BY a.like_num DESC

+ 35 - 0
sooka-jnb/src/main/resources/mapper/matter/collectMapper.xml

@@ -0,0 +1,35 @@
+<?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.sooka.jnb.matter.mapper.CollectMapper">
+
+    <resultMap type="com.sooka.jnb.matter.domin.Collect" id="CollectResult">
+        <result property="id"    column="id"    />
+        <result property="userId"    column="user_id"    />
+        <result property="matterId"    column="matter_id"    />
+    </resultMap>
+
+    <insert id="insertcollect">
+       INSERT INTO
+           jnb_list_user_favorites (user_id, matter_id)
+        VALUE (#{userId},#{matterId} )
+    </insert>
+
+
+    <select id="selectcollect"  resultMap="CollectResult">
+       select  user_id, matter_id  from jnb_list_user_favorites
+        where user_id = #{id}
+    </select>
+
+    <select id="collectlist"  resultMap="CollectResult">
+		SELECT * FROM jnb_list_of_matters
+        WHERE id IN (
+        SELECT matter_id FROM jnb_list_user_favorites
+        WHERE user_id = #{id})
+    </select>
+
+    <delete id="deletecollect" parameterType="Long">
+        delete from jnb_list_user_favorites where matter_id = #{id}
+    </delete>
+</mapper>

+ 19 - 2
sooka-jnb/src/main/resources/mapper/matter/matterMapper.xml

@@ -21,11 +21,15 @@
     <select id="selectSysMatterVo"  resultMap="MatterResult">
         select  id,title, type, department,operation,address,phone,picture,examine ,content from jnb_list_of_matters
         <where>
+
             <if test="title != null and title !=''">
-                AND title LIKE '%' #{title} '%'
+                AND title LIKE   concat('%', #{title}, '%')
             </if>
             <if test="examine != null and examine !=''">
-                AND examine LIKE '%' #{examine} '%'
+                AND examine LIKE   concat('%', #{examine}, '%')
+            </if>
+            <if test="department != null and department !=''">
+                AND department = #{department}
             </if>
             <if test="type != null and type !=''">
                 AND type = #{type}
@@ -33,6 +37,12 @@
         </where>
     </select>
 
+    <select id="selectSysrecommendVo"  resultMap="MatterResult">
+        select  id,title, type, department,operation,address,phone,picture,examine ,content from jnb_list_of_matters
+        where operation=0
+    </select>
+
+
     <select id="selectSysMatterById"  resultMap="MatterResult">
        select  id ,title, type, department,operation,address,phone,picture,examine,content from jnb_list_of_matters
         where id = #{id}
@@ -59,6 +69,13 @@
         where id = #{id}
     </update>
 
+    <select id="collectlist"  resultMap="MatterResult">
+		SELECT * FROM jnb_list_of_matters
+        WHERE id IN (
+        SELECT matter_id FROM jnb_list_user_favorites
+        WHERE user_id = #{id})
+    </select>
+
     <update id="examine" parameterType="SysDept">
         update jnb_list_of_matters
         <trim prefix="SET" suffixOverrides=",">