lidongyu 1 рік тому
батько
коміт
99c9be0198

+ 101 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/handleAffairs/TopicTypeController.java

@@ -0,0 +1,101 @@
+package com.ruoyi.web.controller.handleAffairs;
+
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.sooka.jnb.handleAffairs.domain.TopicType;
+import com.sooka.jnb.handleAffairs.service.ITopicTypeService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+
+import java.util.List;
+
+import static com.ruoyi.common.utils.PageUtils.startPage;
+
+/**
+ * 主题类型配置Controller
+ *
+ * @author lidongyu
+ * @date 2024-03-01
+ */
+@RestController
+@RequestMapping("/jnb/topicType")
+public class TopicTypeController extends BaseController {
+    @Autowired
+    private ITopicTypeService topicTypeService;
+
+    /**
+     * 查询主题类型配置列表
+     */
+    @PreAuthorize("@ss.hasPermi('jnb:topicType:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TopicType topicType)
+    {
+        startPage();
+        List<TopicType> list = topicTypeService.selectTopicTypeList(topicType);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出主题类型配置列表
+     */
+    @PreAuthorize("@ss.hasPermi('jnb:topicType:export')")
+    @Log(title = "主题类型配置", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, TopicType topicType)
+    {
+        List<TopicType> list = topicTypeService.selectTopicTypeList(topicType);
+        ExcelUtil<TopicType> util = new ExcelUtil<TopicType>(TopicType.class);
+        util.exportExcel(response, list, "主题类型配置数据");
+    }
+
+    /**
+     * 获取主题类型配置详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('jnb:topicType:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(topicTypeService.selectTopicTypeById(id));
+    }
+
+    /**
+     * 新增主题类型配置
+     */
+    @PreAuthorize("@ss.hasPermi('jnb:topicType:add')")
+    @Log(title = "主题类型配置", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@Validated @RequestBody TopicType topicType)
+    {
+        return toAjax(topicTypeService.insertTopicType(topicType));
+    }
+
+    /**
+     * 修改主题类型配置
+     */
+    @PreAuthorize("@ss.hasPermi('jnb:topicType:edit')")
+    @Log(title = "主题类型配置", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@Validated @RequestBody TopicType topicType)
+    {
+        return toAjax(topicTypeService.updateTopicType(topicType));
+    }
+
+    /**
+     * 删除主题类型配置
+     */
+    @PreAuthorize("@ss.hasPermi('jnb:topicType:remove')")
+    @Log(title = "主题类型配置", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(topicTypeService.deleteTopicTypeByIds(ids));
+    }
+}

+ 39 - 0
sooka-jnb/src/main/java/com/sooka/jnb/handleAffairs/domain/TopicType.java

@@ -0,0 +1,39 @@
+package com.sooka.jnb.handleAffairs.domain;
+
+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 javax.validation.constraints.NotBlank;
+
+/**
+ * 主题类型配置对象 jnb_topic_type
+ * 
+ * @author lidongyu
+ * @date 2024-03-01
+ */
+@Data
+public class TopicType extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** id */
+    private Long id;
+
+    /** 部门名称 */
+    @Excel(name = "部门名称")
+    @NotBlank(message = "部门名称不能为空")
+    private String deptName;
+
+    /** 是否首页展示 */
+    @Excel(name = "是否首页展示")
+    private String yesOrNoShow;
+
+    /** 办理对象(字典值:个人or法人) */
+    @Excel(name = "办理对象", readConverterExp = "字=典值:个人or法人",dictType = "object_application")
+    @NotBlank(message = "办理对象不能为空")
+    private String objectOfHandling;
+
+}

+ 63 - 0
sooka-jnb/src/main/java/com/sooka/jnb/handleAffairs/mapper/TopicTypeMapper.java

@@ -0,0 +1,63 @@
+package com.sooka.jnb.handleAffairs.mapper;
+
+
+import com.sooka.jnb.handleAffairs.domain.TopicType;
+
+import java.util.List;
+
+/**
+ * 主题类型配置Mapper接口
+ * 
+ * @author lidongyu
+ * @date 2024-03-01
+ */
+public interface TopicTypeMapper
+{
+    /**
+     * 查询主题类型配置
+     * 
+     * @param id 主题类型配置主键
+     * @return 主题类型配置
+     */
+    public TopicType selectTopicTypeById(Long id);
+
+    /**
+     * 查询主题类型配置列表
+     * 
+     * @param topicType 主题类型配置
+     * @return 主题类型配置集合
+     */
+    public List<TopicType> selectTopicTypeList(TopicType topicType);
+
+    /**
+     * 新增主题类型配置
+     * 
+     * @param topicType 主题类型配置
+     * @return 结果
+     */
+    public int insertTopicType(TopicType topicType);
+
+    /**
+     * 修改主题类型配置
+     * 
+     * @param topicType 主题类型配置
+     * @return 结果
+     */
+    public int updateTopicType(TopicType topicType);
+
+    /**
+     * 删除主题类型配置
+     * 
+     * @param id 主题类型配置主键
+     * @return 结果
+     */
+    public int deleteTopicTypeById(Long id);
+
+    /**
+     * 批量删除主题类型配置
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteTopicTypeByIds(Long[] ids);
+}

+ 63 - 0
sooka-jnb/src/main/java/com/sooka/jnb/handleAffairs/service/ITopicTypeService.java

@@ -0,0 +1,63 @@
+package com.sooka.jnb.handleAffairs.service;
+
+
+import com.sooka.jnb.handleAffairs.domain.TopicType;
+
+import java.util.List;
+
+/**
+ * 主题类型配置Service接口
+ * 
+ * @author lidongyu
+ * @date 2024-03-01
+ */
+public interface ITopicTypeService
+{
+    /**
+     * 查询主题类型配置
+     * 
+     * @param id 主题类型配置主键
+     * @return 主题类型配置
+     */
+    public TopicType selectTopicTypeById(Long id);
+
+    /**
+     * 查询主题类型配置列表
+     * 
+     * @param topicType 主题类型配置
+     * @return 主题类型配置集合
+     */
+    public List<TopicType> selectTopicTypeList(TopicType topicType);
+
+    /**
+     * 新增主题类型配置
+     * 
+     * @param topicType 主题类型配置
+     * @return 结果
+     */
+    public int insertTopicType(TopicType topicType);
+
+    /**
+     * 修改主题类型配置
+     * 
+     * @param topicType 主题类型配置
+     * @return 结果
+     */
+    public int updateTopicType(TopicType topicType);
+
+    /**
+     * 批量删除主题类型配置
+     * 
+     * @param ids 需要删除的主题类型配置主键集合
+     * @return 结果
+     */
+    public int deleteTopicTypeByIds(Long[] ids);
+
+    /**
+     * 删除主题类型配置信息
+     * 
+     * @param id 主题类型配置主键
+     * @return 结果
+     */
+    public int deleteTopicTypeById(Long id);
+}

+ 100 - 0
sooka-jnb/src/main/java/com/sooka/jnb/handleAffairs/service/impl/TopicTypeServiceImpl.java

@@ -0,0 +1,100 @@
+package com.sooka.jnb.handleAffairs.service.impl;
+
+import java.util.List;
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.SecurityUtils;
+import com.sooka.jnb.handleAffairs.domain.TopicType;
+import com.sooka.jnb.handleAffairs.mapper.TopicTypeMapper;
+import com.sooka.jnb.handleAffairs.service.ITopicTypeService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * 主题类型配置Service业务层处理
+ * 
+ * @author lidongyu
+ * @date 2024-03-01
+ */
+@Service
+public class TopicTypeServiceImpl implements ITopicTypeService
+{
+    @Autowired
+    private TopicTypeMapper topicTypeMapper;
+
+    /**
+     * 查询主题类型配置
+     * 
+     * @param id 主题类型配置主键
+     * @return 主题类型配置
+     */
+    @Override
+    public TopicType selectTopicTypeById(Long id)
+    {
+        return topicTypeMapper.selectTopicTypeById(id);
+    }
+
+    /**
+     * 查询主题类型配置列表
+     * 
+     * @param topicType 主题类型配置
+     * @return 主题类型配置
+     */
+    @Override
+    public List<TopicType> selectTopicTypeList(TopicType topicType)
+    {
+        return topicTypeMapper.selectTopicTypeList(topicType);
+    }
+
+    /**
+     * 新增主题类型配置
+     * 
+     * @param topicType 主题类型配置
+     * @return 结果
+     */
+    @Override
+    public int insertTopicType(TopicType topicType)
+    {
+        topicType.setCreateTime(DateUtils.getNowDate());
+        topicType.setCreateBy(SecurityUtils.getUserId().toString());
+        topicType.setDelFlag("0");
+        return topicTypeMapper.insertTopicType(topicType);
+    }
+
+    /**
+     * 修改主题类型配置
+     * 
+     * @param topicType 主题类型配置
+     * @return 结果
+     */
+    @Override
+    public int updateTopicType(TopicType topicType)
+    {
+        topicType.setUpdateTime(DateUtils.getNowDate());
+        topicType.setUpdateBy(SecurityUtils.getUserId().toString());
+        return topicTypeMapper.updateTopicType(topicType);
+    }
+
+    /**
+     * 批量删除主题类型配置
+     * 
+     * @param ids 需要删除的主题类型配置主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTopicTypeByIds(Long[] ids)
+    {
+        return topicTypeMapper.deleteTopicTypeByIds(ids);
+    }
+
+    /**
+     * 删除主题类型配置信息
+     * 
+     * @param id 主题类型配置主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTopicTypeById(Long id)
+    {
+        return topicTypeMapper.deleteTopicTypeById(id);
+    }
+}

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

@@ -0,0 +1,89 @@
+<?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.handleAffairs.mapper.TopicTypeMapper">
+    
+    <resultMap type="TopicType" id="TopicTypeResult">
+        <result property="id"    column="id"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="remark"    column="remark"    />
+        <result property="delFlag"    column="del_flag"    />
+        <result property="version"    column="version"    />
+        <result property="deptName"    column="dept_name"    />
+        <result property="yesOrNoShow"    column="yes_or_no_show"    />
+        <result property="objectOfHandling"    column="object_of_handling"    />
+    </resultMap>
+
+    <sql id="selectTopicTypeVo">
+        select id, create_by, create_time, update_by, update_time, remark, del_flag, version, dept_name, yes_or_no_show, object_of_handling from jnb_topic_type
+    </sql>
+
+    <select id="selectTopicTypeList" parameterType="TopicType" resultMap="TopicTypeResult">
+        <include refid="selectTopicTypeVo"/>
+        <where>
+            and del_flag = 0
+            <if test="deptName != null  and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
+            <if test="yesOrNoShow != null  and yesOrNoShow != ''"> and yes_or_no_show = #{yesOrNoShow}</if>
+            <if test="objectOfHandling != null  and objectOfHandling != ''"> and object_of_handling = #{objectOfHandling}</if>
+        </where>
+    </select>
+    
+    <select id="selectTopicTypeById" parameterType="Long" resultMap="TopicTypeResult">
+        <include refid="selectTopicTypeVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertTopicType" parameterType="TopicType" useGeneratedKeys="true" keyProperty="id">
+        insert into jnb_topic_type
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="delFlag != null">del_flag,</if>
+            <if test="deptName != null">dept_name,</if>
+            <if test="yesOrNoShow != null">yes_or_no_show,</if>
+            <if test="objectOfHandling != null">object_of_handling,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="delFlag != null">#{delFlag},</if>
+            <if test="deptName != null">#{deptName},</if>
+            <if test="yesOrNoShow != null">#{yesOrNoShow},</if>
+            <if test="objectOfHandling != null">#{objectOfHandling},</if>
+         </trim>
+    </insert>
+
+    <update id="updateTopicType" parameterType="TopicType">
+        update jnb_topic_type
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="deptName != null">dept_name = #{deptName},</if>
+            <if test="yesOrNoShow != null">yes_or_no_show = #{yesOrNoShow},</if>
+            <if test="objectOfHandling != null">object_of_handling = #{objectOfHandling},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteTopicTypeById" parameterType="Long">
+        update jnb_topic_type set del_flag = 2 where id = #{id}
+    </delete>
+
+    <delete id="deleteTopicTypeByIds" parameterType="String">
+        update jnb_topic_type set del_flag = 2 where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>