浏览代码

接待人员

LIVE_YE 1 年之前
父节点
当前提交
031bb2b228

+ 104 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/reception/ReceptionPersonnelController.java

@@ -0,0 +1,104 @@
+package com.ruoyi.web.controller.reception;
+
+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.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.system.domain.ReceptionPersonnel;
+import com.ruoyi.system.service.IReceptionPersonnelService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 接待人员信息Controller
+ * 
+ * @author ruoyi
+ * @date 2023-11-02
+ */
+@RestController
+@RequestMapping("/system/personnel")
+public class ReceptionPersonnelController extends BaseController
+{
+    @Autowired
+    private IReceptionPersonnelService receptionPersonnelService;
+
+    /**
+     * 查询接待人员信息列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:personnel:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(ReceptionPersonnel receptionPersonnel)
+    {
+        startPage();
+        List<ReceptionPersonnel> list = receptionPersonnelService.selectReceptionPersonnelList(receptionPersonnel);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出接待人员信息列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:personnel:export')")
+    @Log(title = "接待人员信息", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, ReceptionPersonnel receptionPersonnel)
+    {
+        List<ReceptionPersonnel> list = receptionPersonnelService.selectReceptionPersonnelList(receptionPersonnel);
+        ExcelUtil<ReceptionPersonnel> util = new ExcelUtil<ReceptionPersonnel>(ReceptionPersonnel.class);
+        util.exportExcel(response, list, "接待人员信息数据");
+    }
+
+    /**
+     * 获取接待人员信息详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:personnel:query')")
+    @GetMapping(value = "/{receptionId}")
+    public AjaxResult getInfo(@PathVariable("receptionId") Long receptionId)
+    {
+        return success(receptionPersonnelService.selectReceptionPersonnelByReceptionId(receptionId));
+    }
+
+    /**
+     * 新增接待人员信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:personnel:add')")
+    @Log(title = "接待人员信息", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody ReceptionPersonnel receptionPersonnel)
+    {
+        return toAjax(receptionPersonnelService.insertReceptionPersonnel(receptionPersonnel));
+    }
+
+    /**
+     * 修改接待人员信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:personnel:edit')")
+    @Log(title = "接待人员信息", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody ReceptionPersonnel receptionPersonnel)
+    {
+        return toAjax(receptionPersonnelService.updateReceptionPersonnel(receptionPersonnel));
+    }
+
+    /**
+     * 删除接待人员信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:personnel:remove')")
+    @Log(title = "接待人员信息", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{receptionIds}")
+    public AjaxResult remove(@PathVariable Long[] receptionIds)
+    {
+        return toAjax(receptionPersonnelService.deleteReceptionPersonnelByReceptionIds(receptionIds));
+    }
+}

+ 112 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/ReceptionPersonnel.java

@@ -0,0 +1,112 @@
+package com.ruoyi.system.domain;
+
+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;
+
+/**
+ * 接待人员信息对象 reception_personnel
+ * 
+ * @author ruoyi
+ * @date 2023-11-02
+ */
+public class ReceptionPersonnel extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 用户ID */
+    private Long receptionId;
+
+    /** 接待人员姓名 */
+    @Excel(name = "接待人员姓名")
+    private String receptionName;
+
+    /** 手机号码 */
+    @Excel(name = "手机号码")
+    private String phonenumber;
+
+    /** 接待人员简介 */
+    @Excel(name = "接待人员简介")
+    private String introduction;
+
+    /** 头像地址 */
+    @Excel(name = "头像地址")
+    private String avatar;
+
+    /** 状态(0正常 1停用) */
+    @Excel(name = "状态", readConverterExp = "0=正常,1=停用")
+    private String status;
+
+    public void setReceptionId(Long receptionId) 
+    {
+        this.receptionId = receptionId;
+    }
+
+    public Long getReceptionId() 
+    {
+        return receptionId;
+    }
+    public void setReceptionName(String receptionName) 
+    {
+        this.receptionName = receptionName;
+    }
+
+    public String getReceptionName() 
+    {
+        return receptionName;
+    }
+    public void setPhonenumber(String phonenumber) 
+    {
+        this.phonenumber = phonenumber;
+    }
+
+    public String getPhonenumber() 
+    {
+        return phonenumber;
+    }
+    public void setIntroduction(String introduction) 
+    {
+        this.introduction = introduction;
+    }
+
+    public String getIntroduction() 
+    {
+        return introduction;
+    }
+    public void setAvatar(String avatar) 
+    {
+        this.avatar = avatar;
+    }
+
+    public String getAvatar() 
+    {
+        return avatar;
+    }
+    public void setStatus(String status) 
+    {
+        this.status = status;
+    }
+
+    public String getStatus() 
+    {
+        return status;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("receptionId", getReceptionId())
+            .append("receptionName", getReceptionName())
+            .append("phonenumber", getPhonenumber())
+            .append("introduction", getIntroduction())
+            .append("avatar", getAvatar())
+            .append("status", getStatus())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .append("remark", getRemark())
+            .toString();
+    }
+}

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/ReceptionPersonnelMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.system.mapper;
+
+import java.util.List;
+import com.ruoyi.system.domain.ReceptionPersonnel;
+
+/**
+ * 接待人员信息Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2023-11-02
+ */
+public interface ReceptionPersonnelMapper 
+{
+    /**
+     * 查询接待人员信息
+     * 
+     * @param receptionId 接待人员信息主键
+     * @return 接待人员信息
+     */
+    public ReceptionPersonnel selectReceptionPersonnelByReceptionId(Long receptionId);
+
+    /**
+     * 查询接待人员信息列表
+     * 
+     * @param receptionPersonnel 接待人员信息
+     * @return 接待人员信息集合
+     */
+    public List<ReceptionPersonnel> selectReceptionPersonnelList(ReceptionPersonnel receptionPersonnel);
+
+    /**
+     * 新增接待人员信息
+     * 
+     * @param receptionPersonnel 接待人员信息
+     * @return 结果
+     */
+    public int insertReceptionPersonnel(ReceptionPersonnel receptionPersonnel);
+
+    /**
+     * 修改接待人员信息
+     * 
+     * @param receptionPersonnel 接待人员信息
+     * @return 结果
+     */
+    public int updateReceptionPersonnel(ReceptionPersonnel receptionPersonnel);
+
+    /**
+     * 删除接待人员信息
+     * 
+     * @param receptionId 接待人员信息主键
+     * @return 结果
+     */
+    public int deleteReceptionPersonnelByReceptionId(Long receptionId);
+
+    /**
+     * 批量删除接待人员信息
+     * 
+     * @param receptionIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteReceptionPersonnelByReceptionIds(Long[] receptionIds);
+}

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/IReceptionPersonnelService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.system.service;
+
+import java.util.List;
+import com.ruoyi.system.domain.ReceptionPersonnel;
+
+/**
+ * 接待人员信息Service接口
+ * 
+ * @author ruoyi
+ * @date 2023-11-02
+ */
+public interface IReceptionPersonnelService 
+{
+    /**
+     * 查询接待人员信息
+     * 
+     * @param receptionId 接待人员信息主键
+     * @return 接待人员信息
+     */
+    public ReceptionPersonnel selectReceptionPersonnelByReceptionId(Long receptionId);
+
+    /**
+     * 查询接待人员信息列表
+     * 
+     * @param receptionPersonnel 接待人员信息
+     * @return 接待人员信息集合
+     */
+    public List<ReceptionPersonnel> selectReceptionPersonnelList(ReceptionPersonnel receptionPersonnel);
+
+    /**
+     * 新增接待人员信息
+     * 
+     * @param receptionPersonnel 接待人员信息
+     * @return 结果
+     */
+    public int insertReceptionPersonnel(ReceptionPersonnel receptionPersonnel);
+
+    /**
+     * 修改接待人员信息
+     * 
+     * @param receptionPersonnel 接待人员信息
+     * @return 结果
+     */
+    public int updateReceptionPersonnel(ReceptionPersonnel receptionPersonnel);
+
+    /**
+     * 批量删除接待人员信息
+     * 
+     * @param receptionIds 需要删除的接待人员信息主键集合
+     * @return 结果
+     */
+    public int deleteReceptionPersonnelByReceptionIds(Long[] receptionIds);
+
+    /**
+     * 删除接待人员信息信息
+     * 
+     * @param receptionId 接待人员信息主键
+     * @return 结果
+     */
+    public int deleteReceptionPersonnelByReceptionId(Long receptionId);
+}

+ 96 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ReceptionPersonnelServiceImpl.java

@@ -0,0 +1,96 @@
+package com.ruoyi.system.service.impl;
+
+import java.util.List;
+import com.ruoyi.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.system.mapper.ReceptionPersonnelMapper;
+import com.ruoyi.system.domain.ReceptionPersonnel;
+import com.ruoyi.system.service.IReceptionPersonnelService;
+
+/**
+ * 接待人员信息Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2023-11-02
+ */
+@Service
+public class ReceptionPersonnelServiceImpl implements IReceptionPersonnelService 
+{
+    @Autowired
+    private ReceptionPersonnelMapper receptionPersonnelMapper;
+
+    /**
+     * 查询接待人员信息
+     * 
+     * @param receptionId 接待人员信息主键
+     * @return 接待人员信息
+     */
+    @Override
+    public ReceptionPersonnel selectReceptionPersonnelByReceptionId(Long receptionId)
+    {
+        return receptionPersonnelMapper.selectReceptionPersonnelByReceptionId(receptionId);
+    }
+
+    /**
+     * 查询接待人员信息列表
+     * 
+     * @param receptionPersonnel 接待人员信息
+     * @return 接待人员信息
+     */
+    @Override
+    public List<ReceptionPersonnel> selectReceptionPersonnelList(ReceptionPersonnel receptionPersonnel)
+    {
+        return receptionPersonnelMapper.selectReceptionPersonnelList(receptionPersonnel);
+    }
+
+    /**
+     * 新增接待人员信息
+     * 
+     * @param receptionPersonnel 接待人员信息
+     * @return 结果
+     */
+    @Override
+    public int insertReceptionPersonnel(ReceptionPersonnel receptionPersonnel)
+    {
+        receptionPersonnel.setCreateTime(DateUtils.getNowDate());
+        return receptionPersonnelMapper.insertReceptionPersonnel(receptionPersonnel);
+    }
+
+    /**
+     * 修改接待人员信息
+     * 
+     * @param receptionPersonnel 接待人员信息
+     * @return 结果
+     */
+    @Override
+    public int updateReceptionPersonnel(ReceptionPersonnel receptionPersonnel)
+    {
+        receptionPersonnel.setUpdateTime(DateUtils.getNowDate());
+        return receptionPersonnelMapper.updateReceptionPersonnel(receptionPersonnel);
+    }
+
+    /**
+     * 批量删除接待人员信息
+     * 
+     * @param receptionIds 需要删除的接待人员信息主键
+     * @return 结果
+     */
+    @Override
+    public int deleteReceptionPersonnelByReceptionIds(Long[] receptionIds)
+    {
+        return receptionPersonnelMapper.deleteReceptionPersonnelByReceptionIds(receptionIds);
+    }
+
+    /**
+     * 删除接待人员信息信息
+     * 
+     * @param receptionId 接待人员信息主键
+     * @return 结果
+     */
+    @Override
+    public int deleteReceptionPersonnelByReceptionId(Long receptionId)
+    {
+        return receptionPersonnelMapper.deleteReceptionPersonnelByReceptionId(receptionId);
+    }
+}

+ 96 - 0
ruoyi-system/src/main/resources/mapper/system/ReceptionPersonnelMapper.xml

@@ -0,0 +1,96 @@
+<?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.ruoyi.system.mapper.ReceptionPersonnelMapper">
+    
+    <resultMap type="ReceptionPersonnel" id="ReceptionPersonnelResult">
+        <result property="receptionId"    column="reception_id"    />
+        <result property="receptionName"    column="reception_name"    />
+        <result property="phonenumber"    column="phonenumber"    />
+        <result property="introduction"    column="introduction"    />
+        <result property="avatar"    column="avatar"    />
+        <result property="status"    column="status"    />
+        <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="selectReceptionPersonnelVo">
+        select reception_id, reception_name, phonenumber, introduction, avatar, status, create_by, create_time, update_by, update_time, remark from reception_personnel
+    </sql>
+
+    <select id="selectReceptionPersonnelList" parameterType="ReceptionPersonnel" resultMap="ReceptionPersonnelResult">
+        <include refid="selectReceptionPersonnelVo"/>
+        <where>  
+            <if test="receptionName != null  and receptionName != ''"> and reception_name like concat('%', #{receptionName}, '%')</if>
+            <if test="phonenumber != null  and phonenumber != ''"> and phonenumber = #{phonenumber}</if>
+            <if test="introduction != null  and introduction != ''"> and introduction = #{introduction}</if>
+            <if test="avatar != null  and avatar != ''"> and avatar = #{avatar}</if>
+            <if test="status != null  and status != ''"> and status = #{status}</if>
+        </where>
+    </select>
+    
+    <select id="selectReceptionPersonnelByReceptionId" parameterType="Long" resultMap="ReceptionPersonnelResult">
+        <include refid="selectReceptionPersonnelVo"/>
+        where reception_id = #{receptionId}
+    </select>
+        
+    <insert id="insertReceptionPersonnel" parameterType="ReceptionPersonnel" useGeneratedKeys="true" keyProperty="receptionId">
+        insert into reception_personnel
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="receptionName != null and receptionName != ''">reception_name,</if>
+            <if test="phonenumber != null">phonenumber,</if>
+            <if test="introduction != null">introduction,</if>
+            <if test="avatar != null">avatar,</if>
+            <if test="status != null">status,</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="receptionName != null and receptionName != ''">#{receptionName},</if>
+            <if test="phonenumber != null">#{phonenumber},</if>
+            <if test="introduction != null">#{introduction},</if>
+            <if test="avatar != null">#{avatar},</if>
+            <if test="status != null">#{status},</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="updateReceptionPersonnel" parameterType="ReceptionPersonnel">
+        update reception_personnel
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="receptionName != null and receptionName != ''">reception_name = #{receptionName},</if>
+            <if test="phonenumber != null">phonenumber = #{phonenumber},</if>
+            <if test="introduction != null">introduction = #{introduction},</if>
+            <if test="avatar != null">avatar = #{avatar},</if>
+            <if test="status != null">status = #{status},</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>
+        where reception_id = #{receptionId}
+    </update>
+
+    <delete id="deleteReceptionPersonnelByReceptionId" parameterType="Long">
+        delete from reception_personnel where reception_id = #{receptionId}
+    </delete>
+
+    <delete id="deleteReceptionPersonnelByReceptionIds" parameterType="String">
+        delete from reception_personnel where reception_id in 
+        <foreach item="receptionId" collection="array" open="(" separator="," close=")">
+            #{receptionId}
+        </foreach>
+    </delete>
+</mapper>