소스 검색

物业费设置

LIVE_YE 3 달 전
부모
커밋
9dd641cf47

+ 105 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/houseInfo/PropertySettingsController.java

@@ -0,0 +1,105 @@
+package com.ruoyi.web.controller.houseInfo;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.system.domain.houseInfo.PropertySettings;
+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.IPropertySettingsService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 物业费设置Controller
+ *
+ * @author boman
+ * @date 2025-03-11
+ */
+@RestController
+@RequestMapping("/wuYe/fee/settings")
+public class PropertySettingsController extends BaseController
+{
+    @Autowired
+    private IPropertySettingsService propertySettingsService;
+
+/**
+ * 查询物业费设置列表
+ */
+@PreAuthorize("@ss.hasPermi('wuYe:fee:settings:list')")
+@GetMapping("/list")
+    public TableDataInfo list(PropertySettings propertySettings)
+    {
+        startPage();
+        List<PropertySettings> list = propertySettingsService.selectPropertySettingsList(propertySettings);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出物业费设置列表
+     */
+    @PreAuthorize("@ss.hasPermi('wuYe:fee:settings:export')")
+    @Log(title = "物业费设置", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, PropertySettings propertySettings)
+    {
+        List<PropertySettings> list = propertySettingsService.selectPropertySettingsList(propertySettings);
+        ExcelUtil<PropertySettings> util = new ExcelUtil<PropertySettings>(PropertySettings.class);
+        util.exportExcel(response, list, "物业费设置数据");
+    }
+
+    /**
+     * 获取物业费设置详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('wuYe:fee:settings:query')")
+    @GetMapping(value = "/{settingsId}")
+    public AjaxResult getInfo(@PathVariable("settingsId") Long settingsId)
+    {
+        return success(propertySettingsService.selectPropertySettingsBySettingsId(settingsId));
+    }
+
+    /**
+     * 新增物业费设置
+     */
+    @PreAuthorize("@ss.hasPermi('wuYe:fee:settings:add')")
+    @Log(title = "物业费设置", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody PropertySettings propertySettings)
+    {
+        return toAjax(propertySettingsService.insertPropertySettings(propertySettings));
+    }
+
+    /**
+     * 修改物业费设置
+     */
+    @PreAuthorize("@ss.hasPermi('wuYe:fee:settings:edit')")
+    @Log(title = "物业费设置", businessType = BusinessType.UPDATE)
+    @PostMapping("/put")
+    public AjaxResult edit(@RequestBody PropertySettings propertySettings)
+    {
+        return toAjax(propertySettingsService.updatePropertySettings(propertySettings));
+    }
+
+    /**
+     * 删除物业费设置
+     */
+    @PreAuthorize("@ss.hasPermi('wuYe:fee:settings:remove')")
+    @Log(title = "物业费设置", businessType = BusinessType.DELETE)
+    @GetMapping("/delete/{settingsId}")
+    public AjaxResult remove(@PathVariable Long settingsId)
+    {
+        return toAjax(propertySettingsService.deletePropertySettingsBySettingsId(settingsId));
+    }
+}

+ 99 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/houseInfo/PropertySettings.java

@@ -0,0 +1,99 @@
+package com.ruoyi.system.domain.houseInfo;
+
+import java.math.BigDecimal;
+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;
+
+/**
+ * 物业费设置对象 property_settings
+ * 
+ * @author boman
+ * @date 2025-03-11
+ */
+public class PropertySettings extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 物业费信息主键 */
+    private Long settingsId;
+
+    /** 应缴物业费用 */
+    @Excel(name = "应缴物业费用")
+    private BigDecimal tenementExpense;
+
+    /** 应缴车位费用 */
+    @Excel(name = "应缴车位费用")
+    private BigDecimal parkingExpense;
+
+    /** 应缴能耗费用 */
+    @Excel(name = "应缴能耗费用")
+    private BigDecimal energyExpense;
+
+    /** 是否删除,Y表示删除,N表示有效 */
+    @Excel(name = "是否删除,Y表示删除,N表示有效")
+    private String isDel;
+
+    public void setSettingsId(Long settingsId) 
+    {
+        this.settingsId = settingsId;
+    }
+
+    public Long getSettingsId() 
+    {
+        return settingsId;
+    }
+    public void setTenementExpense(BigDecimal tenementExpense) 
+    {
+        this.tenementExpense = tenementExpense;
+    }
+
+    public BigDecimal getTenementExpense() 
+    {
+        return tenementExpense;
+    }
+    public void setParkingExpense(BigDecimal parkingExpense) 
+    {
+        this.parkingExpense = parkingExpense;
+    }
+
+    public BigDecimal getParkingExpense() 
+    {
+        return parkingExpense;
+    }
+    public void setEnergyExpense(BigDecimal energyExpense) 
+    {
+        this.energyExpense = energyExpense;
+    }
+
+    public BigDecimal getEnergyExpense() 
+    {
+        return energyExpense;
+    }
+    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("tenementExpense", getTenementExpense())
+            .append("parkingExpense", getParkingExpense())
+            .append("energyExpense", getEnergyExpense())
+            .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/PropertySettingsMapper.java

@@ -0,0 +1,62 @@
+package com.ruoyi.system.mapper;
+
+import com.ruoyi.system.domain.houseInfo.PropertySettings;
+
+import java.util.List;
+
+/**
+ * 物业费设置Mapper接口
+ * 
+ * @author boman
+ * @date 2025-03-11
+ */
+public interface PropertySettingsMapper 
+{
+    /**
+     * 查询物业费设置
+     * 
+     * @param settingsId 物业费设置主键
+     * @return 物业费设置
+     */
+    public PropertySettings selectPropertySettingsBySettingsId(Long settingsId);
+
+    /**
+     * 查询物业费设置列表
+     * 
+     * @param propertySettings 物业费设置
+     * @return 物业费设置集合
+     */
+    public List<PropertySettings> selectPropertySettingsList(PropertySettings propertySettings);
+
+    /**
+     * 新增物业费设置
+     * 
+     * @param propertySettings 物业费设置
+     * @return 结果
+     */
+    public int insertPropertySettings(PropertySettings propertySettings);
+
+    /**
+     * 修改物业费设置
+     * 
+     * @param propertySettings 物业费设置
+     * @return 结果
+     */
+    public int updatePropertySettings(PropertySettings propertySettings);
+
+    /**
+     * 删除物业费设置
+     * 
+     * @param settingsId 物业费设置主键
+     * @return 结果
+     */
+    public int deletePropertySettingsBySettingsId(Long settingsId);
+
+    /**
+     * 批量删除物业费设置
+     * 
+     * @param settingsIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deletePropertySettingsBySettingsIds(Long[] settingsIds);
+}

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

@@ -0,0 +1,62 @@
+package com.ruoyi.system.service;
+
+import com.ruoyi.system.domain.houseInfo.PropertySettings;
+
+import java.util.List;
+
+/**
+ * 物业费设置Service接口
+ * 
+ * @author boman
+ * @date 2025-03-11
+ */
+public interface IPropertySettingsService 
+{
+    /**
+     * 查询物业费设置
+     * 
+     * @param settingsId 物业费设置主键
+     * @return 物业费设置
+     */
+    public PropertySettings selectPropertySettingsBySettingsId(Long settingsId);
+
+    /**
+     * 查询物业费设置列表
+     * 
+     * @param propertySettings 物业费设置
+     * @return 物业费设置集合
+     */
+    public List<PropertySettings> selectPropertySettingsList(PropertySettings propertySettings);
+
+    /**
+     * 新增物业费设置
+     * 
+     * @param propertySettings 物业费设置
+     * @return 结果
+     */
+    public int insertPropertySettings(PropertySettings propertySettings);
+
+    /**
+     * 修改物业费设置
+     * 
+     * @param propertySettings 物业费设置
+     * @return 结果
+     */
+    public int updatePropertySettings(PropertySettings propertySettings);
+
+    /**
+     * 批量删除物业费设置
+     * 
+     * @param settingsIds 需要删除的物业费设置主键集合
+     * @return 结果
+     */
+    public int deletePropertySettingsBySettingsIds(Long[] settingsIds);
+
+    /**
+     * 删除物业费设置信息
+     * 
+     * @param settingsId 物业费设置主键
+     * @return 结果
+     */
+    public int deletePropertySettingsBySettingsId(Long settingsId);
+}

+ 96 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PropertySettingsServiceImpl.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.houseInfo.PropertySettings;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.system.mapper.PropertySettingsMapper;
+import com.ruoyi.system.service.IPropertySettingsService;
+
+/**
+ * 物业费设置Service业务层处理
+ * 
+ * @author boman
+ * @date 2025-03-11
+ */
+@Service
+public class PropertySettingsServiceImpl implements IPropertySettingsService 
+{
+    @Autowired
+    private PropertySettingsMapper propertySettingsMapper;
+
+    /**
+     * 查询物业费设置
+     * 
+     * @param settingsId 物业费设置主键
+     * @return 物业费设置
+     */
+    @Override
+    public PropertySettings selectPropertySettingsBySettingsId(Long settingsId)
+    {
+        return propertySettingsMapper.selectPropertySettingsBySettingsId(settingsId);
+    }
+
+    /**
+     * 查询物业费设置列表
+     * 
+     * @param propertySettings 物业费设置
+     * @return 物业费设置
+     */
+    @Override
+    public List<PropertySettings> selectPropertySettingsList(PropertySettings propertySettings)
+    {
+        return propertySettingsMapper.selectPropertySettingsList(propertySettings);
+    }
+
+    /**
+     * 新增物业费设置
+     * 
+     * @param propertySettings 物业费设置
+     * @return 结果
+     */
+    @Override
+    public int insertPropertySettings(PropertySettings propertySettings)
+    {
+        propertySettings.setCreateTime(DateUtils.getNowDate());
+        return propertySettingsMapper.insertPropertySettings(propertySettings);
+    }
+
+    /**
+     * 修改物业费设置
+     * 
+     * @param propertySettings 物业费设置
+     * @return 结果
+     */
+    @Override
+    public int updatePropertySettings(PropertySettings propertySettings)
+    {
+        propertySettings.setUpdateTime(DateUtils.getNowDate());
+        return propertySettingsMapper.updatePropertySettings(propertySettings);
+    }
+
+    /**
+     * 批量删除物业费设置
+     * 
+     * @param settingsIds 需要删除的物业费设置主键
+     * @return 结果
+     */
+    @Override
+    public int deletePropertySettingsBySettingsIds(Long[] settingsIds)
+    {
+        return propertySettingsMapper.deletePropertySettingsBySettingsIds(settingsIds);
+    }
+
+    /**
+     * 删除物业费设置信息
+     * 
+     * @param settingsId 物业费设置主键
+     * @return 结果
+     */
+    @Override
+    public int deletePropertySettingsBySettingsId(Long settingsId)
+    {
+        return propertySettingsMapper.deletePropertySettingsBySettingsId(settingsId);
+    }
+}

+ 91 - 0
ruoyi-system/src/main/resources/mapper/system/PropertySettingsMapper.xml

@@ -0,0 +1,91 @@
+<?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.PropertySettingsMapper">
+    
+    <resultMap type="PropertySettings" id="PropertySettingsResult">
+        <result property="settingsId"    column="settings_id"    />
+        <result property="tenementExpense"    column="tenement_expense"    />
+        <result property="parkingExpense"    column="parking_expense"    />
+        <result property="energyExpense"    column="energy_expense"    />
+        <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="selectPropertySettingsVo">
+        select settings_id, tenement_expense, parking_expense, energy_expense, is_del, create_by, create_time, update_by, update_time, remark from property_settings
+    </sql>
+
+    <select id="selectPropertySettingsList" parameterType="PropertySettings" resultMap="PropertySettingsResult">
+        <include refid="selectPropertySettingsVo"/>
+        <where>  
+            <if test="tenementExpense != null "> and tenement_expense = #{tenementExpense}</if>
+            <if test="parkingExpense != null "> and parking_expense = #{parkingExpense}</if>
+            <if test="energyExpense != null "> and energy_expense = #{energyExpense}</if>
+            <if test="isDel != null  and isDel != ''"> and is_del = #{isDel}</if>
+        </where>
+    </select>
+    
+    <select id="selectPropertySettingsBySettingsId" parameterType="Long" resultMap="PropertySettingsResult">
+        <include refid="selectPropertySettingsVo"/>
+        where settings_id = #{settingsId}
+    </select>
+
+    <insert id="insertPropertySettings" parameterType="PropertySettings" useGeneratedKeys="true" keyProperty="settingsId">
+        insert into property_settings
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="tenementExpense != null">tenement_expense,</if>
+            <if test="parkingExpense != null">parking_expense,</if>
+            <if test="energyExpense != null">energy_expense,</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="tenementExpense != null">#{tenementExpense},</if>
+            <if test="parkingExpense != null">#{parkingExpense},</if>
+            <if test="energyExpense != null">#{energyExpense},</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="updatePropertySettings" parameterType="PropertySettings">
+        update property_settings
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="tenementExpense != null">tenement_expense = #{tenementExpense},</if>
+            <if test="parkingExpense != null">parking_expense = #{parkingExpense},</if>
+            <if test="energyExpense != null">energy_expense = #{energyExpense},</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="deletePropertySettingsBySettingsId" parameterType="Long">
+        update property_settings set is_del = "Y" where settings_id = #{settingsId}
+    </delete>
+
+    <delete id="deletePropertySettingsBySettingsIds" parameterType="String">
+        delete from property_settings where settings_id in 
+        <foreach item="settingsId" collection="array" open="(" separator="," close=")">
+            #{settingsId}
+        </foreach>
+    </delete>
+</mapper>