diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controller/controller/FeeController.java b/ruoyi-system/src/main/java/com/ruoyi/system/controller/controller/FeeController.java new file mode 100644 index 0000000..b7e890c --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controller/controller/FeeController.java @@ -0,0 +1,104 @@ +package com.ruoyi.system.controller.controller; + +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.Fee; +import com.ruoyi.system.service.IFeeService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * FeeController + * + * @author ruoyi + * @date 2024-11-30 + */ +@RestController +@RequestMapping("/system/Fee") +public class FeeController extends BaseController +{ + @Autowired + private IFeeService feeService; + + /** + * 查询Fee列表 + */ + @PreAuthorize("@ss.hasPermi('system:Fee:list')") + @GetMapping("/list") + public TableDataInfo list(Fee fee) + { + startPage(); + List list = feeService.selectFeeList(fee); + return getDataTable(list); + } + + /** + * 导出Fee列表 + */ + @PreAuthorize("@ss.hasPermi('system:Fee:export')") + @Log(title = "Fee", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, Fee fee) + { + List list = feeService.selectFeeList(fee); + ExcelUtil util = new ExcelUtil(Fee.class); + util.exportExcel(response, list, "Fee数据"); + } + + /** + * 获取Fee详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:Fee:query')") + @GetMapping(value = "/{sort}") + public AjaxResult getInfo(@PathVariable("sort") String sort) + { + return success(feeService.selectFeeBySort(sort)); + } + + /** + * 新增Fee + */ + @PreAuthorize("@ss.hasPermi('system:Fee:add')") + @Log(title = "Fee", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody Fee fee) + { + return toAjax(feeService.insertFee(fee)); + } + + /** + * 修改Fee + */ + @PreAuthorize("@ss.hasPermi('system:Fee:edit')") + @Log(title = "Fee", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody Fee fee) + { + return toAjax(feeService.updateFee(fee)); + } + + /** + * 删除Fee + */ + @PreAuthorize("@ss.hasPermi('system:Fee:remove')") + @Log(title = "Fee", businessType = BusinessType.DELETE) + @DeleteMapping("/{sorts}") + public AjaxResult remove(@PathVariable String[] sorts) + { + return toAjax(feeService.deleteFeeBySorts(sorts)); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/Fee.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/Fee.java new file mode 100644 index 0000000..a2318c1 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/Fee.java @@ -0,0 +1,66 @@ +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; + +/** + * Fee对象 Fee + * + * @author ruoyi + * @date 2024-11-30 + */ +public class Fee extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String sort; + + /** $column.columnComment */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Long fee; + + /** $column.columnComment */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private Long number; + + public void setSort(String sort) + { + this.sort = sort; + } + + public String getSort() + { + return sort; + } + public void setFee(Long fee) + { + this.fee = fee; + } + + public Long getFee() + { + return fee; + } + public void setNumber(Long number) + { + this.number = number; + } + + public Long getNumber() + { + return number; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("sort", getSort()) + .append("fee", getFee()) + .append("number", getNumber()) + .toString(); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/FeeMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/FeeMapper.java new file mode 100644 index 0000000..0210b13 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/FeeMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import com.ruoyi.system.domain.Fee; + +/** + * FeeMapper接口 + * + * @author ruoyi + * @date 2024-11-30 + */ +public interface FeeMapper +{ + /** + * 查询Fee + * + * @param sort Fee主键 + * @return Fee + */ + public Fee selectFeeBySort(String sort); + + /** + * 查询Fee列表 + * + * @param fee Fee + * @return Fee集合 + */ + public List selectFeeList(Fee fee); + + /** + * 新增Fee + * + * @param fee Fee + * @return 结果 + */ + public int insertFee(Fee fee); + + /** + * 修改Fee + * + * @param fee Fee + * @return 结果 + */ + public int updateFee(Fee fee); + + /** + * 删除Fee + * + * @param sort Fee主键 + * @return 结果 + */ + public int deleteFeeBySort(String sort); + + /** + * 批量删除Fee + * + * @param sorts 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteFeeBySorts(String[] sorts); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/IFeeService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/IFeeService.java new file mode 100644 index 0000000..6b3de14 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/IFeeService.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.service; + +import java.util.List; +import com.ruoyi.system.domain.Fee; + +/** + * FeeService接口 + * + * @author ruoyi + * @date 2024-11-30 + */ +public interface IFeeService +{ + /** + * 查询Fee + * + * @param sort Fee主键 + * @return Fee + */ + public Fee selectFeeBySort(String sort); + + /** + * 查询Fee列表 + * + * @param fee Fee + * @return Fee集合 + */ + public List selectFeeList(Fee fee); + + /** + * 新增Fee + * + * @param fee Fee + * @return 结果 + */ + public int insertFee(Fee fee); + + /** + * 修改Fee + * + * @param fee Fee + * @return 结果 + */ + public int updateFee(Fee fee); + + /** + * 批量删除Fee + * + * @param sorts 需要删除的Fee主键集合 + * @return 结果 + */ + public int deleteFeeBySorts(String[] sorts); + + /** + * 删除Fee信息 + * + * @param sort Fee主键 + * @return 结果 + */ + public int deleteFeeBySort(String sort); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/FeeServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/FeeServiceImpl.java new file mode 100644 index 0000000..6c74765 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/FeeServiceImpl.java @@ -0,0 +1,93 @@ +package com.ruoyi.system.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.system.mapper.FeeMapper; +import com.ruoyi.system.domain.Fee; +import com.ruoyi.system.service.IFeeService; + +/** + * FeeService业务层处理 + * + * @author ruoyi + * @date 2024-11-30 + */ +@Service +public class FeeServiceImpl implements IFeeService +{ + @Autowired + private FeeMapper feeMapper; + + /** + * 查询Fee + * + * @param sort Fee主键 + * @return Fee + */ + @Override + public Fee selectFeeBySort(String sort) + { + return feeMapper.selectFeeBySort(sort); + } + + /** + * 查询Fee列表 + * + * @param fee Fee + * @return Fee + */ + @Override + public List selectFeeList(Fee fee) + { + return feeMapper.selectFeeList(fee); + } + + /** + * 新增Fee + * + * @param fee Fee + * @return 结果 + */ + @Override + public int insertFee(Fee fee) + { + return feeMapper.insertFee(fee); + } + + /** + * 修改Fee + * + * @param fee Fee + * @return 结果 + */ + @Override + public int updateFee(Fee fee) + { + return feeMapper.updateFee(fee); + } + + /** + * 批量删除Fee + * + * @param sorts 需要删除的Fee主键 + * @return 结果 + */ + @Override + public int deleteFeeBySorts(String[] sorts) + { + return feeMapper.deleteFeeBySorts(sorts); + } + + /** + * 删除Fee信息 + * + * @param sort Fee主键 + * @return 结果 + */ + @Override + public int deleteFeeBySort(String sort) + { + return feeMapper.deleteFeeBySort(sort); + } +} diff --git a/ruoyi-system/src/main/resources/mapper/system/FeeMapper.xml b/ruoyi-system/src/main/resources/mapper/system/FeeMapper.xml new file mode 100644 index 0000000..86c51d7 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/FeeMapper.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + select sort, fee, number from Fee + + + + + + + + insert into Fee + + sort, + fee, + number, + + + #{sort}, + #{fee}, + #{number}, + + + + + update Fee + + fee = #{fee}, + number = #{number}, + + where sort = #{sort} + + + + delete from Fee where sort = #{sort} + + + + delete from Fee where sort in + + #{sort} + + + \ No newline at end of file