소스 검색

意见反馈相关接口编写

wangmiaomiao 11 달 전
부모
커밋
2830b9d673

+ 106 - 0
slibra-admin/src/main/java/com/slibra/web/controller/business/TXinyiFeedbackController.java

@@ -0,0 +1,106 @@
+package com.slibra.web.controller.business;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.slibra.common.annotation.Log;
+import com.slibra.common.core.controller.BaseController;
+import com.slibra.common.core.domain.AjaxResult;
+import com.slibra.common.enums.BusinessType;
+import com.slibra.business.domain.TXinyiFeedback;
+import com.slibra.business.service.ITXinyiFeedbackService;
+import com.slibra.common.utils.poi.ExcelUtil;
+import com.slibra.common.core.page.TableDataInfo;
+
+/**
+ * 信义意见反馈Controller
+ * 
+ * @author slibra
+ * @date 2024-05-27
+ */
+@RestController
+@RequestMapping("/business/feedback")
+public class TXinyiFeedbackController extends BaseController
+{
+    @Autowired
+    private ITXinyiFeedbackService tXinyiFeedbackService;
+
+    /**
+     * 查询信义意见反馈列表
+     */
+    @PreAuthorize("@ss.hasPermi('business:feedback:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TXinyiFeedback tXinyiFeedback)
+    {
+        startPage();
+        List<TXinyiFeedback> list = tXinyiFeedbackService.selectTXinyiFeedbackList(tXinyiFeedback);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出信义意见反馈列表
+     */
+    @PreAuthorize("@ss.hasPermi('business:feedback:export')")
+    @Log(title = "信义意见反馈", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, TXinyiFeedback tXinyiFeedback)
+    {
+        List<TXinyiFeedback> list = tXinyiFeedbackService.selectTXinyiFeedbackList(tXinyiFeedback);
+        ExcelUtil<TXinyiFeedback> util = new ExcelUtil<TXinyiFeedback>(TXinyiFeedback.class);
+        util.exportExcel(response, list, "信义意见反馈数据");
+    }
+
+    /**
+     * 获取信义意见反馈详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('business:feedback:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(tXinyiFeedbackService.selectTXinyiFeedbackById(id));
+    }
+
+    /**
+     * 新增信义意见反馈
+     */
+    @PreAuthorize("@ss.hasPermi('business:feedback:add')")
+    @Log(title = "信义意见反馈", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TXinyiFeedback tXinyiFeedback)
+    {
+        tXinyiFeedback.setCreateBy(getUsername());
+        return toAjax(tXinyiFeedbackService.insertTXinyiFeedback(tXinyiFeedback));
+    }
+
+    /**
+     * 修改信义意见反馈
+     */
+    @PreAuthorize("@ss.hasPermi('business:feedback:edit')")
+    @Log(title = "信义意见反馈", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TXinyiFeedback tXinyiFeedback)
+    {
+        tXinyiFeedback.setUpdateBy(getUsername());
+        return toAjax(tXinyiFeedbackService.updateTXinyiFeedback(tXinyiFeedback));
+    }
+
+    /**
+     * 删除信义意见反馈
+     */
+    @PreAuthorize("@ss.hasPermi('business:feedback:remove')")
+    @Log(title = "信义意见反馈", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(tXinyiFeedbackService.deleteTXinyiFeedbackByIds(ids));
+    }
+}

+ 97 - 0
slibra-system/src/main/java/com/slibra/business/domain/TXinyiFeedback.java

@@ -0,0 +1,97 @@
+package com.slibra.business.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.slibra.common.annotation.Excel;
+import com.slibra.common.core.domain.BaseEntity;
+
+/**
+ * 信义意见反馈对象 t_xinyi_feedback
+ * 
+ * @author slibra
+ * @date 2024-05-27
+ */
+public class TXinyiFeedback extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 主键 */
+    private Long id;
+
+    /** 问题描述 */
+    @Excel(name = "问题描述")
+    private String description;
+
+    /** 联系方式(联系人手机号) */
+    @Excel(name = "联系方式", readConverterExp = "联=系人手机号")
+    private String phone;
+
+    /** 删除标志(0代表存在 2代表删除) */
+    private Long delFlag;
+
+    /** 乐观锁 */
+    @Excel(name = "乐观锁")
+    private Long revision;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setDescription(String description) 
+    {
+        this.description = description;
+    }
+
+    public String getDescription() 
+    {
+        return description;
+    }
+    public void setPhone(String phone) 
+    {
+        this.phone = phone;
+    }
+
+    public String getPhone() 
+    {
+        return phone;
+    }
+    public void setDelFlag(Long delFlag) 
+    {
+        this.delFlag = delFlag;
+    }
+
+    public Long getDelFlag() 
+    {
+        return delFlag;
+    }
+    public void setRevision(Long revision) 
+    {
+        this.revision = revision;
+    }
+
+    public Long getRevision() 
+    {
+        return revision;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("description", getDescription())
+            .append("phone", getPhone())
+            .append("delFlag", getDelFlag())
+            .append("revision", getRevision())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .append("remark", getRemark())
+            .toString();
+    }
+}

+ 61 - 0
slibra-system/src/main/java/com/slibra/business/mapper/TXinyiFeedbackMapper.java

@@ -0,0 +1,61 @@
+package com.slibra.business.mapper;
+
+import java.util.List;
+import com.slibra.business.domain.TXinyiFeedback;
+
+/**
+ * 信义意见反馈Mapper接口
+ * 
+ * @author slibra
+ * @date 2024-05-27
+ */
+public interface TXinyiFeedbackMapper 
+{
+    /**
+     * 查询信义意见反馈
+     * 
+     * @param id 信义意见反馈主键
+     * @return 信义意见反馈
+     */
+    public TXinyiFeedback selectTXinyiFeedbackById(Long id);
+
+    /**
+     * 查询信义意见反馈列表
+     * 
+     * @param tXinyiFeedback 信义意见反馈
+     * @return 信义意见反馈集合
+     */
+    public List<TXinyiFeedback> selectTXinyiFeedbackList(TXinyiFeedback tXinyiFeedback);
+
+    /**
+     * 新增信义意见反馈
+     * 
+     * @param tXinyiFeedback 信义意见反馈
+     * @return 结果
+     */
+    public int insertTXinyiFeedback(TXinyiFeedback tXinyiFeedback);
+
+    /**
+     * 修改信义意见反馈
+     * 
+     * @param tXinyiFeedback 信义意见反馈
+     * @return 结果
+     */
+    public int updateTXinyiFeedback(TXinyiFeedback tXinyiFeedback);
+
+    /**
+     * 删除信义意见反馈
+     * 
+     * @param id 信义意见反馈主键
+     * @return 结果
+     */
+    public int deleteTXinyiFeedbackById(Long id);
+
+    /**
+     * 批量删除信义意见反馈
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteTXinyiFeedbackByIds(Long[] ids);
+}

+ 61 - 0
slibra-system/src/main/java/com/slibra/business/service/ITXinyiFeedbackService.java

@@ -0,0 +1,61 @@
+package com.slibra.business.service;
+
+import java.util.List;
+import com.slibra.business.domain.TXinyiFeedback;
+
+/**
+ * 信义意见反馈Service接口
+ * 
+ * @author slibra
+ * @date 2024-05-27
+ */
+public interface ITXinyiFeedbackService 
+{
+    /**
+     * 查询信义意见反馈
+     * 
+     * @param id 信义意见反馈主键
+     * @return 信义意见反馈
+     */
+    public TXinyiFeedback selectTXinyiFeedbackById(Long id);
+
+    /**
+     * 查询信义意见反馈列表
+     * 
+     * @param tXinyiFeedback 信义意见反馈
+     * @return 信义意见反馈集合
+     */
+    public List<TXinyiFeedback> selectTXinyiFeedbackList(TXinyiFeedback tXinyiFeedback);
+
+    /**
+     * 新增信义意见反馈
+     * 
+     * @param tXinyiFeedback 信义意见反馈
+     * @return 结果
+     */
+    public int insertTXinyiFeedback(TXinyiFeedback tXinyiFeedback);
+
+    /**
+     * 修改信义意见反馈
+     * 
+     * @param tXinyiFeedback 信义意见反馈
+     * @return 结果
+     */
+    public int updateTXinyiFeedback(TXinyiFeedback tXinyiFeedback);
+
+    /**
+     * 批量删除信义意见反馈
+     * 
+     * @param ids 需要删除的信义意见反馈主键集合
+     * @return 结果
+     */
+    public int deleteTXinyiFeedbackByIds(Long[] ids);
+
+    /**
+     * 删除信义意见反馈信息
+     * 
+     * @param id 信义意见反馈主键
+     * @return 结果
+     */
+    public int deleteTXinyiFeedbackById(Long id);
+}

+ 96 - 0
slibra-system/src/main/java/com/slibra/business/service/impl/TXinyiFeedbackServiceImpl.java

@@ -0,0 +1,96 @@
+package com.slibra.business.service.impl;
+
+import java.util.List;
+import com.slibra.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.slibra.business.mapper.TXinyiFeedbackMapper;
+import com.slibra.business.domain.TXinyiFeedback;
+import com.slibra.business.service.ITXinyiFeedbackService;
+
+/**
+ * 信义意见反馈Service业务层处理
+ * 
+ * @author slibra
+ * @date 2024-05-27
+ */
+@Service
+public class TXinyiFeedbackServiceImpl implements ITXinyiFeedbackService 
+{
+    @Autowired
+    private TXinyiFeedbackMapper tXinyiFeedbackMapper;
+
+    /**
+     * 查询信义意见反馈
+     * 
+     * @param id 信义意见反馈主键
+     * @return 信义意见反馈
+     */
+    @Override
+    public TXinyiFeedback selectTXinyiFeedbackById(Long id)
+    {
+        return tXinyiFeedbackMapper.selectTXinyiFeedbackById(id);
+    }
+
+    /**
+     * 查询信义意见反馈列表
+     * 
+     * @param tXinyiFeedback 信义意见反馈
+     * @return 信义意见反馈
+     */
+    @Override
+    public List<TXinyiFeedback> selectTXinyiFeedbackList(TXinyiFeedback tXinyiFeedback)
+    {
+        return tXinyiFeedbackMapper.selectTXinyiFeedbackList(tXinyiFeedback);
+    }
+
+    /**
+     * 新增信义意见反馈
+     * 
+     * @param tXinyiFeedback 信义意见反馈
+     * @return 结果
+     */
+    @Override
+    public int insertTXinyiFeedback(TXinyiFeedback tXinyiFeedback)
+    {
+        tXinyiFeedback.setCreateTime(DateUtils.getNowDate());
+        return tXinyiFeedbackMapper.insertTXinyiFeedback(tXinyiFeedback);
+    }
+
+    /**
+     * 修改信义意见反馈
+     * 
+     * @param tXinyiFeedback 信义意见反馈
+     * @return 结果
+     */
+    @Override
+    public int updateTXinyiFeedback(TXinyiFeedback tXinyiFeedback)
+    {
+        tXinyiFeedback.setUpdateTime(DateUtils.getNowDate());
+        return tXinyiFeedbackMapper.updateTXinyiFeedback(tXinyiFeedback);
+    }
+
+    /**
+     * 批量删除信义意见反馈
+     * 
+     * @param ids 需要删除的信义意见反馈主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTXinyiFeedbackByIds(Long[] ids)
+    {
+        return tXinyiFeedbackMapper.deleteTXinyiFeedbackByIds(ids);
+    }
+
+    /**
+     * 删除信义意见反馈信息
+     * 
+     * @param id 信义意见反馈主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTXinyiFeedbackById(Long id)
+    {
+        return tXinyiFeedbackMapper.deleteTXinyiFeedbackById(id);
+    }
+}

+ 95 - 0
slibra-system/src/main/resources/mapper/business/TXinyiFeedbackMapper.xml

@@ -0,0 +1,95 @@
+<?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.slibra.business.mapper.TXinyiFeedbackMapper">
+    
+    <resultMap type="TXinyiFeedback" id="TXinyiFeedbackResult">
+        <result property="id"    column="id"    />
+        <result property="description"    column="description"    />
+        <result property="phone"    column="phone"    />
+        <result property="delFlag"    column="del_flag"    />
+        <result property="revision"    column="revision"    />
+        <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"    />
+    </resultMap>
+
+    <sql id="selectTXinyiFeedbackVo">
+        select id, description, phone, del_flag, revision, create_by, create_time, update_by, update_time, remark from t_xinyi_feedback
+    </sql>
+
+    <select id="selectTXinyiFeedbackList" parameterType="TXinyiFeedback" resultMap="TXinyiFeedbackResult">
+        <include refid="selectTXinyiFeedbackVo"/>
+        <where>
+            1 = 1
+            <if test="description != null  and description != ''"> and description = #{description}</if>
+            <if test="phone != null  and phone != ''"> and phone = #{phone}</if>
+            <if test="revision != null "> and revision = #{revision}</if>
+        </where>
+        and del_flag = 0 order by id desc
+    </select>
+    
+    <select id="selectTXinyiFeedbackById" parameterType="Long" resultMap="TXinyiFeedbackResult">
+        <include refid="selectTXinyiFeedbackVo"/>
+        where id = #{id} and del_flag = 0
+    </select>
+        
+    <insert id="insertTXinyiFeedback" parameterType="TXinyiFeedback" useGeneratedKeys="true" keyProperty="id">
+        insert into t_xinyi_feedback
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="description != null">description,</if>
+            <if test="phone != null">phone,</if>
+            <if test="delFlag != null">del_flag,</if>
+            <if test="revision != null">revision,</if>
+            <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="remark != null">remark,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="description != null">#{description},</if>
+            <if test="phone != null">#{phone},</if>
+            <if test="delFlag != null">#{delFlag},</if>
+            <if test="revision != null">#{revision},</if>
+            <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="remark != null">#{remark},</if>
+         </trim>
+    </insert>
+
+    <update id="updateTXinyiFeedback" parameterType="TXinyiFeedback">
+        update t_xinyi_feedback
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="description != null">description = #{description},</if>
+            <if test="phone != null">phone = #{phone},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="revision != null">revision = #{revision},</if>
+            <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="remark != null">remark = #{remark},</if>
+        </trim>
+        ,revision = revision + 1
+        where id = #{id}
+    </update>
+
+    
+
+    <delete id="deleteTXinyiFeedbackById" parameterType="Long">
+        update t_xinyi_feedback set del_flag = 2,revision = revision + 1 where del_flag = 0 and id = #{id}
+    </delete>
+
+    <delete id="deleteTXinyiFeedbackByIds" parameterType="String">
+        update t_xinyi_feedback set del_flag = 2,revision = revision + 1 where del_flag = 0 and id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>