Browse Source

物业管家

LIVE_YE 4 months ago
parent
commit
5ada8ac53d

+ 105 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/butler/ButlerSettingsController.java

@@ -0,0 +1,105 @@
+package com.ruoyi.web.controller.butler;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.system.domain.butler.ButlerSettings;
+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.service.IButlerSettingsService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 物业管家设置Controller
+ *
+ * @author boman
+ * @date 2025-03-07
+ */
+@RestController
+@RequestMapping("/wuYe/settings")
+public class ButlerSettingsController extends BaseController
+{
+    @Autowired
+    private IButlerSettingsService butlerSettingsService;
+
+/**
+ * 查询物业管家设置列表
+ */
+@PreAuthorize("@ss.hasPermi('wuYe:settings:list')")
+@GetMapping("/list")
+    public TableDataInfo list(ButlerSettings butlerSettings)
+    {
+        startPage();
+        List<ButlerSettings> list = butlerSettingsService.selectButlerSettingsList(butlerSettings);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出物业管家设置列表
+     */
+    @PreAuthorize("@ss.hasPermi('wuYe:settings:export')")
+    @Log(title = "物业管家设置", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, ButlerSettings butlerSettings)
+    {
+        List<ButlerSettings> list = butlerSettingsService.selectButlerSettingsList(butlerSettings);
+        ExcelUtil<ButlerSettings> util = new ExcelUtil<ButlerSettings>(ButlerSettings.class);
+        util.exportExcel(response, list, "物业管家设置数据");
+    }
+
+    /**
+     * 获取物业管家设置详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('wuYe:settings:query')")
+    @GetMapping(value = "/{settingsId}")
+    public AjaxResult getInfo(@PathVariable("settingsId") Long settingsId)
+    {
+        return success(butlerSettingsService.selectButlerSettingsBySettingsId(settingsId));
+    }
+
+    /**
+     * 新增物业管家设置
+     */
+    @PreAuthorize("@ss.hasPermi('wuYe:settings:add')")
+    @Log(title = "物业管家设置", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody ButlerSettings butlerSettings)
+    {
+        return toAjax(butlerSettingsService.insertButlerSettings(butlerSettings));
+    }
+
+    /**
+     * 修改物业管家设置
+     */
+    @PreAuthorize("@ss.hasPermi('wuYe:settings:edit')")
+    @Log(title = "物业管家设置", businessType = BusinessType.UPDATE)
+    @PostMapping("/put")
+    public AjaxResult edit(@RequestBody ButlerSettings butlerSettings)
+    {
+        return toAjax(butlerSettingsService.updateButlerSettings(butlerSettings));
+    }
+
+    /**
+     * 删除物业管家设置
+     */
+    @PreAuthorize("@ss.hasPermi('wuYe:settings:remove')")
+    @Log(title = "物业管家设置", businessType = BusinessType.DELETE)
+    @GetMapping("/delete/{settingsIds}")
+    public AjaxResult remove(@PathVariable Long[] settingsIds)
+    {
+        return toAjax(butlerSettingsService.deleteButlerSettingsBySettingsIds(settingsIds));
+    }
+}

+ 84 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/butler/ButlerSettings.java

@@ -0,0 +1,84 @@
+package com.ruoyi.system.domain.butler;
+
+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;
+
+/**
+ * 物业管家设置对象 butler_settings
+ * 
+ * @author boman
+ * @date 2025-03-07
+ */
+public class ButlerSettings extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** ID */
+    private Long settingsId;
+
+    /** 标题 */
+    @Excel(name = "标题")
+    private String title;
+
+    /** 内容 */
+    @Excel(name = "内容")
+    private String content;
+
+    /** 是否删除:Y(删除)、N(不删除) */
+    @Excel(name = "是否删除:Y", readConverterExp = "删=除")
+    private String isDel;
+
+    public void setSettingsId(Long settingsId) 
+    {
+        this.settingsId = settingsId;
+    }
+
+    public Long getSettingsId() 
+    {
+        return settingsId;
+    }
+    public void setTitle(String title) 
+    {
+        this.title = title;
+    }
+
+    public String getTitle() 
+    {
+        return title;
+    }
+    public void setContent(String content) 
+    {
+        this.content = content;
+    }
+
+    public String getContent() 
+    {
+        return content;
+    }
+    public void setIsDel(String isDel) 
+    {
+        this.isDel = isDel;
+    }
+
+    public String getIsDel() 
+    {
+        return isDel;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("settingsId", getSettingsId())
+            .append("title", getTitle())
+            .append("content", getContent())
+            .append("isDel", getIsDel())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .append("remark", getRemark())
+            .toString();
+    }
+}

+ 62 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/ButlerSettingsMapper.java

@@ -0,0 +1,62 @@
+package com.ruoyi.system.mapper;
+
+import com.ruoyi.system.domain.butler.ButlerSettings;
+
+import java.util.List;
+
+/**
+ * 物业管家设置Mapper接口
+ * 
+ * @author boman
+ * @date 2025-03-07
+ */
+public interface ButlerSettingsMapper 
+{
+    /**
+     * 查询物业管家设置
+     * 
+     * @param settingsId 物业管家设置主键
+     * @return 物业管家设置
+     */
+    public ButlerSettings selectButlerSettingsBySettingsId(Long settingsId);
+
+    /**
+     * 查询物业管家设置列表
+     * 
+     * @param butlerSettings 物业管家设置
+     * @return 物业管家设置集合
+     */
+    public List<ButlerSettings> selectButlerSettingsList(ButlerSettings butlerSettings);
+
+    /**
+     * 新增物业管家设置
+     * 
+     * @param butlerSettings 物业管家设置
+     * @return 结果
+     */
+    public int insertButlerSettings(ButlerSettings butlerSettings);
+
+    /**
+     * 修改物业管家设置
+     * 
+     * @param butlerSettings 物业管家设置
+     * @return 结果
+     */
+    public int updateButlerSettings(ButlerSettings butlerSettings);
+
+    /**
+     * 删除物业管家设置
+     * 
+     * @param settingsId 物业管家设置主键
+     * @return 结果
+     */
+    public int deleteButlerSettingsBySettingsId(Long settingsId);
+
+    /**
+     * 批量删除物业管家设置
+     * 
+     * @param settingsIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteButlerSettingsBySettingsIds(Long[] settingsIds);
+}

+ 62 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/IButlerSettingsService.java

@@ -0,0 +1,62 @@
+package com.ruoyi.system.service;
+
+import com.ruoyi.system.domain.butler.ButlerSettings;
+
+import java.util.List;
+
+/**
+ * 物业管家设置Service接口
+ * 
+ * @author boman
+ * @date 2025-03-07
+ */
+public interface IButlerSettingsService 
+{
+    /**
+     * 查询物业管家设置
+     * 
+     * @param settingsId 物业管家设置主键
+     * @return 物业管家设置
+     */
+    public ButlerSettings selectButlerSettingsBySettingsId(Long settingsId);
+
+    /**
+     * 查询物业管家设置列表
+     * 
+     * @param butlerSettings 物业管家设置
+     * @return 物业管家设置集合
+     */
+    public List<ButlerSettings> selectButlerSettingsList(ButlerSettings butlerSettings);
+
+    /**
+     * 新增物业管家设置
+     * 
+     * @param butlerSettings 物业管家设置
+     * @return 结果
+     */
+    public int insertButlerSettings(ButlerSettings butlerSettings);
+
+    /**
+     * 修改物业管家设置
+     * 
+     * @param butlerSettings 物业管家设置
+     * @return 结果
+     */
+    public int updateButlerSettings(ButlerSettings butlerSettings);
+
+    /**
+     * 批量删除物业管家设置
+     * 
+     * @param settingsIds 需要删除的物业管家设置主键集合
+     * @return 结果
+     */
+    public int deleteButlerSettingsBySettingsIds(Long[] settingsIds);
+
+    /**
+     * 删除物业管家设置信息
+     * 
+     * @param settingsId 物业管家设置主键
+     * @return 结果
+     */
+    public int deleteButlerSettingsBySettingsId(Long settingsId);
+}

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

@@ -0,0 +1,96 @@
+package com.ruoyi.system.service.impl;
+
+import java.util.List;
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.system.domain.butler.ButlerSettings;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.system.mapper.ButlerSettingsMapper;
+import com.ruoyi.system.service.IButlerSettingsService;
+
+/**
+ * 物业管家设置Service业务层处理
+ * 
+ * @author boman
+ * @date 2025-03-07
+ */
+@Service
+public class ButlerSettingsServiceImpl implements IButlerSettingsService 
+{
+    @Autowired
+    private ButlerSettingsMapper butlerSettingsMapper;
+
+    /**
+     * 查询物业管家设置
+     * 
+     * @param settingsId 物业管家设置主键
+     * @return 物业管家设置
+     */
+    @Override
+    public ButlerSettings selectButlerSettingsBySettingsId(Long settingsId)
+    {
+        return butlerSettingsMapper.selectButlerSettingsBySettingsId(settingsId);
+    }
+
+    /**
+     * 查询物业管家设置列表
+     * 
+     * @param butlerSettings 物业管家设置
+     * @return 物业管家设置
+     */
+    @Override
+    public List<ButlerSettings> selectButlerSettingsList(ButlerSettings butlerSettings)
+    {
+        return butlerSettingsMapper.selectButlerSettingsList(butlerSettings);
+    }
+
+    /**
+     * 新增物业管家设置
+     * 
+     * @param butlerSettings 物业管家设置
+     * @return 结果
+     */
+    @Override
+    public int insertButlerSettings(ButlerSettings butlerSettings)
+    {
+        butlerSettings.setCreateTime(DateUtils.getNowDate());
+        return butlerSettingsMapper.insertButlerSettings(butlerSettings);
+    }
+
+    /**
+     * 修改物业管家设置
+     * 
+     * @param butlerSettings 物业管家设置
+     * @return 结果
+     */
+    @Override
+    public int updateButlerSettings(ButlerSettings butlerSettings)
+    {
+        butlerSettings.setUpdateTime(DateUtils.getNowDate());
+        return butlerSettingsMapper.updateButlerSettings(butlerSettings);
+    }
+
+    /**
+     * 批量删除物业管家设置
+     * 
+     * @param settingsIds 需要删除的物业管家设置主键
+     * @return 结果
+     */
+    @Override
+    public int deleteButlerSettingsBySettingsIds(Long[] settingsIds)
+    {
+        return butlerSettingsMapper.deleteButlerSettingsBySettingsIds(settingsIds);
+    }
+
+    /**
+     * 删除物业管家设置信息
+     * 
+     * @param settingsId 物业管家设置主键
+     * @return 结果
+     */
+    @Override
+    public int deleteButlerSettingsBySettingsId(Long settingsId)
+    {
+        return butlerSettingsMapper.deleteButlerSettingsBySettingsId(settingsId);
+    }
+}

+ 86 - 0
ruoyi-system/src/main/resources/mapper/system/ButlerSettingsMapper.xml

@@ -0,0 +1,86 @@
+<?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.ButlerSettingsMapper">
+    
+    <resultMap type="ButlerSettings" id="ButlerSettingsResult">
+        <result property="settingsId"    column="settings_id"    />
+        <result property="title"    column="title"    />
+        <result property="content"    column="content"    />
+        <result property="isDel"    column="is_del"    />
+        <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="selectButlerSettingsVo">
+        select settings_id, title, content, is_del, create_by, create_time, update_by, update_time, remark from butler_settings
+    </sql>
+
+    <select id="selectButlerSettingsList" parameterType="ButlerSettings" resultMap="ButlerSettingsResult">
+        <include refid="selectButlerSettingsVo"/>
+        <where>  
+            <if test="title != null  and title != ''"> and title = #{title}</if>
+            <if test="content != null  and content != ''"> and content = #{content}</if>
+            <if test="isDel != null  and isDel != ''"> and is_del = #{isDel}</if>
+        </where>
+    </select>
+    
+    <select id="selectButlerSettingsBySettingsId" parameterType="Long" resultMap="ButlerSettingsResult">
+        <include refid="selectButlerSettingsVo"/>
+        where settings_id = #{settingsId}
+    </select>
+
+    <insert id="insertButlerSettings" parameterType="ButlerSettings" useGeneratedKeys="true" keyProperty="settingsId">
+        insert into butler_settings
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="title != null">title,</if>
+            <if test="content != null">content,</if>
+            <if test="isDel != null">is_del,</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="title != null">#{title},</if>
+            <if test="content != null">#{content},</if>
+            <if test="isDel != null">#{isDel},</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="updateButlerSettings" parameterType="ButlerSettings">
+        update butler_settings
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="title != null">title = #{title},</if>
+            <if test="content != null">content = #{content},</if>
+            <if test="isDel != null">is_del = #{isDel},</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 settings_id = #{settingsId}
+    </update>
+
+    <delete id="deleteButlerSettingsBySettingsId" parameterType="Long">
+        delete from butler_settings where settings_id = #{settingsId}
+    </delete>
+
+    <delete id="deleteButlerSettingsBySettingsIds" parameterType="String">
+        delete from butler_settings where settings_id in 
+        <foreach item="settingsId" collection="array" open="(" separator="," close=")">
+            #{settingsId}
+        </foreach>
+    </delete>
+</mapper>