From d3ea2ddb97991fc767d5d434b17d097f457d69ac Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Tue, 29 Oct 2024 10:17:43 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=E5=9F=BA=E7=A1=80=E8=B5=84=E6=96=99=20?= =?UTF-8?q?=E6=96=B0=E5=BB=BA=E5=9F=BA=E7=A1=80=E8=B5=84=E6=96=99=E6=B1=87?= =?UTF-8?q?=E7=8E=87=E7=AE=A1=E7=90=86=E6=95=B0=E6=8D=AE=E5=BA=93=E8=A1=A8?= =?UTF-8?q?=20=E6=96=B0=E5=A2=9E=E6=B1=87=E7=8E=87=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=AE=9E=E4=BD=93=E7=B1=BB=20=E6=96=B0=E5=A2=9E=E6=B1=87?= =?UTF-8?q?=E7=8E=87=E7=AE=A1=E7=90=86Controller=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=B1=87=E7=8E=87=E7=AE=A1=E7=90=86Mapper=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=B1=87=E7=8E=87=E7=AE=A1=E7=90=86Mapper.XML=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E6=B1=87=E7=8E=87=E7=AE=A1=E7=90=86Service=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=20=E6=96=B0=E5=A2=9E=E6=B1=87=E7=8E=87=E7=AE=A1?= =?UTF-8?q?=E7=90=86ServiceImpl=E5=AE=9E=E7=8E=B0=E7=B1=BB=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E6=B1=87=E7=8E=87=E7=AE=A1=E7=90=86=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E9=A1=B5=E9=9D=A2=EF=BC=9A=E6=8C=89=E7=85=A7?= =?UTF-8?q?prd=E5=B1=95=E7=A4=BA=E6=95=B0=E6=8D=AE=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=B1=87=E7=8E=87=E7=AE=A1=E7=90=86=E5=89=8D=E7=AB=AF=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E9=A1=B5=E9=9D=A2=EF=BC=9A=E8=AE=BE=E7=BD=AE=E5=BC=80?= =?UTF-8?q?=E5=A7=8B=E6=97=B6=E9=97=B4=E3=80=81=E7=BB=93=E6=9D=9F=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E3=80=81=E6=B1=87=E7=8E=87=E4=B8=BA=E5=BF=85=E5=A1=AB?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=20=E6=96=B0=E5=A2=9E=E6=B1=87=E7=8E=87?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=89=8D=E7=AB=AF=E4=BF=AE=E6=94=B9=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=EF=BC=9A=E8=AE=BE=E7=BD=AE=E5=BC=80=E5=A7=8B=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E3=80=81=E7=BB=93=E6=9D=9F=E6=97=B6=E9=97=B4=E3=80=81?= =?UTF-8?q?=E6=B1=87=E7=8E=87=E4=B8=BA=E5=BF=85=E5=A1=AB=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=20=E4=BF=AE=E6=94=B9=E5=9F=BA=E7=A1=80=E8=B5=84=E6=96=99?= =?UTF-8?q?=E6=B1=87=E7=8E=87=E7=AE=A1=E7=90=86=E6=96=B0=E5=A2=9E=E5=90=8E?= =?UTF-8?q?=E7=AB=AF=E6=8E=A5=E5=8F=A3=EF=BC=9A=E6=8F=92=E5=85=A5=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E4=B9=8B=E5=89=8D=E8=BF=9B=E8=A1=8C=E5=88=A4=E6=96=AD?= =?UTF-8?q?=EF=BC=8C1=EF=BC=9A=E5=BC=80=E5=A7=8B=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E5=A4=A7=E4=BA=8E=E7=BB=93=E6=9D=9F=E6=97=B6?= =?UTF-8?q?=E9=97=B4=EF=BC=81=EF=BC=9B2=EF=BC=9A=E4=B8=8D=E5=90=8C?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E4=B9=8B=E9=97=B4=E7=9A=84=E5=BC=80=E5=A7=8B?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E5=92=8C=E7=BB=93=E6=9D=9F=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E4=B8=8D=E5=8F=AF=E4=BB=A5=E5=AD=98=E5=9C=A8=E4=BA=A4=E5=8F=89?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=EF=BC=8C=E6=BB=A1=E8=B6=B3=E4=B8=8A=E9=9D=A2?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E6=89=8D=E5=8F=AF=E4=BB=A5=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=20=E6=96=B0=E5=A2=9E=20=E6=9F=A5=E8=AF=A2=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E4=BA=A4=E5=8F=89=E9=9B=86=E5=90=88=E7=9A=84=E5=90=8E=E7=AB=AF?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BaseExchangeRateController.java | 151 ++++++++++++++++++ .../ruoyi/system/domain/BaseExchangeRate.java | 89 +++++++++++ .../system/mapper/BaseExchangeRateMapper.java | 86 ++++++++++ .../service/IBaseExchangeRateService.java | 75 +++++++++ .../impl/BaseExchangeRateServiceImpl.java | 143 +++++++++++++++++ .../mapper/system/BaseExchangeRateMapper.xml | 100 ++++++++++++ .../templates/system/exchangeRate/add.html | 69 ++++++++ .../templates/system/exchangeRate/edit.html | 70 ++++++++ .../system/exchangeRate/exchangeRate.html | 101 ++++++++++++ 9 files changed, 884 insertions(+) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/system/controller/BaseExchangeRateController.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/system/domain/BaseExchangeRate.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BaseExchangeRateMapper.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/system/service/IBaseExchangeRateService.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseExchangeRateServiceImpl.java create mode 100644 ruoyi-admin/src/main/resources/mapper/system/BaseExchangeRateMapper.xml create mode 100644 ruoyi-admin/src/main/resources/templates/system/exchangeRate/add.html create mode 100644 ruoyi-admin/src/main/resources/templates/system/exchangeRate/edit.html create mode 100644 ruoyi-admin/src/main/resources/templates/system/exchangeRate/exchangeRate.html diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BaseExchangeRateController.java b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BaseExchangeRateController.java new file mode 100644 index 00000000..a6ce83ad --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BaseExchangeRateController.java @@ -0,0 +1,151 @@ +package com.ruoyi.system.controller; + +import java.util.List; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.system.domain.BaseExchangeRate; +import com.ruoyi.system.service.IBaseExchangeRateService; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 基础资料汇率管理Controller + * + * @author 刘晓旭 + * @date 2024-10-29 + */ +@Controller +@RequestMapping("/system/exchangeRate") +public class BaseExchangeRateController extends BaseController +{ + private String prefix = "system/exchangeRate"; + + @Autowired + private IBaseExchangeRateService baseExchangeRateService; + + @RequiresPermissions("system:exchangeRate:view") + @GetMapping() + public String exchangeRate() + { + return prefix + "/exchangeRate"; + } + + /** + * 查询基础资料汇率管理列表 + */ + @RequiresPermissions("system:exchangeRate:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(BaseExchangeRate baseExchangeRate) + { + startPage(); + List list = baseExchangeRateService.selectBaseExchangeRateList(baseExchangeRate); + return getDataTable(list); + } + + /** + * 导出基础资料汇率管理列表 + */ + @RequiresPermissions("system:exchangeRate:export") + @Log(title = "基础资料汇率管理", businessType = BusinessType.EXPORT) + @PostMapping("/export") + @ResponseBody + public AjaxResult export(BaseExchangeRate baseExchangeRate) + { + List list = baseExchangeRateService.selectBaseExchangeRateList(baseExchangeRate); + ExcelUtil util = new ExcelUtil(BaseExchangeRate.class); + return util.exportExcel(list, "基础资料汇率管理数据"); + } + + /** + * 新增基础资料汇率管理 + */ + @GetMapping("/add") + public String add() + { + return prefix + "/add"; + } + + /** + * 新增保存基础资料汇率管理 + */ + @RequiresPermissions("system:exchangeRate:add") + @Log(title = "基础资料汇率管理", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(BaseExchangeRate baseExchangeRate) + { + return toAjax(baseExchangeRateService.insertBaseExchangeRate(baseExchangeRate)); + } + + /** + * 修改基础资料汇率管理 + */ + @GetMapping("/edit/{exchangeRateId}") + public String edit(@PathVariable("exchangeRateId") Long exchangeRateId, ModelMap mmap) + { + BaseExchangeRate baseExchangeRate = baseExchangeRateService.selectBaseExchangeRateById(exchangeRateId); + mmap.put("baseExchangeRate", baseExchangeRate); + return prefix + "/edit"; + } + + /** + * 修改保存基础资料汇率管理 + */ + @RequiresPermissions("system:exchangeRate:edit") + @Log(title = "基础资料汇率管理", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(BaseExchangeRate baseExchangeRate) + { + return toAjax(baseExchangeRateService.updateBaseExchangeRate(baseExchangeRate)); + } + + /** + * 删除基础资料汇率管理 + */ + @RequiresPermissions("system:exchangeRate:remove") + @Log(title = "基础资料汇率管理", businessType = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + return toAjax(baseExchangeRateService.deleteBaseExchangeRateByIds(ids)); + } + + /** + * 作废基础资料汇率管理 + */ + @RequiresPermissions("system:exchangeRate:cancel") + @Log(title = "基础资料汇率管理", businessType = BusinessType.CANCEL) + @GetMapping( "/cancel/{id}") + @ResponseBody + public AjaxResult cancel(@PathVariable("id") Long id){ + return toAjax(baseExchangeRateService.cancelBaseExchangeRateById(id)); + } + + /** + * 恢复基础资料汇率管理 + */ + @RequiresPermissions("system:exchangeRate:restore") + @Log(title = "基础资料汇率管理", businessType = BusinessType.RESTORE) + @GetMapping( "/restore/{id}") + @ResponseBody + public AjaxResult restore(@PathVariable("id")Long id) + { + return toAjax(baseExchangeRateService.restoreBaseExchangeRateById(id)); + } + + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/BaseExchangeRate.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/BaseExchangeRate.java new file mode 100644 index 00000000..adbaff08 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/BaseExchangeRate.java @@ -0,0 +1,89 @@ +package com.ruoyi.system.domain; + +import java.math.BigDecimal; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +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; + +/** + * 基础资料汇率管理对象 base_exchange_rate + * + * @author 刘晓旭 + * @date 2024-10-29 + */ +public class BaseExchangeRate extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 汇率ID */ + private Long exchangeRateId; + + /** 汇率 */ + @Excel(name = "汇率") + private BigDecimal exchangeRate; + + /** 开始时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date startTime; + + /** 结束时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date endTime; + + public void setExchangeRateId(Long exchangeRateId) + { + this.exchangeRateId = exchangeRateId; + } + + public Long getExchangeRateId() + { + return exchangeRateId; + } + public void setExchangeRate(BigDecimal exchangeRate) + { + this.exchangeRate = exchangeRate; + } + + public BigDecimal getExchangeRate() + { + return exchangeRate; + } + public void setStartTime(Date startTime) + { + this.startTime = startTime; + } + + public Date getStartTime() + { + return startTime; + } + public void setEndTime(Date endTime) + { + this.endTime = endTime; + } + + public Date getEndTime() + { + return endTime; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("exchangeRateId", getExchangeRateId()) + .append("exchangeRate", getExchangeRate()) + .append("startTime", getStartTime()) + .append("endTime", getEndTime()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BaseExchangeRateMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BaseExchangeRateMapper.java new file mode 100644 index 00000000..1a369057 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BaseExchangeRateMapper.java @@ -0,0 +1,86 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import com.ruoyi.system.domain.BaseExchangeRate; + +/** + * 基础资料汇率管理Mapper接口 + * + * @author 刘晓旭 + * @date 2024-10-29 + */ +public interface BaseExchangeRateMapper +{ + /** + * 查询基础资料汇率管理 + * + * @param exchangeRateId 基础资料汇率管理ID + * @return 基础资料汇率管理 + */ + public BaseExchangeRate selectBaseExchangeRateById(Long exchangeRateId); + + /** + * 查询基础资料汇率管理列表 + * + * @param baseExchangeRate 基础资料汇率管理 + * @return 基础资料汇率管理集合 + */ + public List selectBaseExchangeRateList(BaseExchangeRate baseExchangeRate); + + + /** + * 查询时间交叉 + * + * @param baseExchangeRate 基础资料汇率管理 + * @return 基础资料汇率管理集合 + */ + public List selectExchangeRateByTimeRange(BaseExchangeRate baseExchangeRate); + + /** + * 新增基础资料汇率管理 + * + * @param baseExchangeRate 基础资料汇率管理 + * @return 结果 + */ + public int insertBaseExchangeRate(BaseExchangeRate baseExchangeRate); + + /** + * 修改基础资料汇率管理 + * + * @param baseExchangeRate 基础资料汇率管理 + * @return 结果 + */ + public int updateBaseExchangeRate(BaseExchangeRate baseExchangeRate); + + /** + * 删除基础资料汇率管理 + * + * @param exchangeRateId 基础资料汇率管理ID + * @return 结果 + */ + public int deleteBaseExchangeRateById(Long exchangeRateId); + + /** + * 批量删除基础资料汇率管理 + * + * @param exchangeRateIds 需要删除的数据ID + * @return 结果 + */ + public int deleteBaseExchangeRateByIds(String[] exchangeRateIds); + + /** + * 作废基础资料汇率管理 + * + * @param exchangeRateId 基础资料汇率管理ID + * @return 结果 + */ + public int cancelBaseExchangeRateById(Long exchangeRateId); + + /** + * 恢复基础资料汇率管理 + * + * @param exchangeRateId 基础资料汇率管理ID + * @return 结果 + */ + public int restoreBaseExchangeRateById(Long exchangeRateId); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/IBaseExchangeRateService.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/IBaseExchangeRateService.java new file mode 100644 index 00000000..4974fd33 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/IBaseExchangeRateService.java @@ -0,0 +1,75 @@ +package com.ruoyi.system.service; + +import java.util.List; +import com.ruoyi.system.domain.BaseExchangeRate; + +/** + * 基础资料汇率管理Service接口 + * + * @author 刘晓旭 + * @date 2024-10-29 + */ +public interface IBaseExchangeRateService +{ + /** + * 查询基础资料汇率管理 + * + * @param exchangeRateId 基础资料汇率管理ID + * @return 基础资料汇率管理 + */ + public BaseExchangeRate selectBaseExchangeRateById(Long exchangeRateId); + + /** + * 查询基础资料汇率管理列表 + * + * @param baseExchangeRate 基础资料汇率管理 + * @return 基础资料汇率管理集合 + */ + public List selectBaseExchangeRateList(BaseExchangeRate baseExchangeRate); + + /** + * 新增基础资料汇率管理 + * + * @param baseExchangeRate 基础资料汇率管理 + * @return 结果 + */ + public int insertBaseExchangeRate(BaseExchangeRate baseExchangeRate); + + /** + * 修改基础资料汇率管理 + * + * @param baseExchangeRate 基础资料汇率管理 + * @return 结果 + */ + public int updateBaseExchangeRate(BaseExchangeRate baseExchangeRate); + + /** + * 批量删除基础资料汇率管理 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteBaseExchangeRateByIds(String ids); + + /** + * 删除基础资料汇率管理信息 + * + * @param exchangeRateId 基础资料汇率管理ID + * @return 结果 + */ + public int deleteBaseExchangeRateById(Long exchangeRateId); + + /** + * 作废基础资料汇率管理 + * @param exchangeRateId 基础资料汇率管理ID + * @return + */ + int cancelBaseExchangeRateById(Long exchangeRateId); + + /** + * 恢复基础资料汇率管理 + * @param exchangeRateId 基础资料汇率管理ID + * @return + */ + int restoreBaseExchangeRateById(Long exchangeRateId); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseExchangeRateServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseExchangeRateServiceImpl.java new file mode 100644 index 00000000..7dd0dacd --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseExchangeRateServiceImpl.java @@ -0,0 +1,143 @@ +package com.ruoyi.system.service.impl; + +import java.util.Date; +import java.util.List; + +import com.ruoyi.common.exception.BusinessException; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.ShiroUtils; +import com.ruoyi.system.service.ISysDiffLogService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.system.mapper.BaseExchangeRateMapper; +import com.ruoyi.system.domain.BaseExchangeRate; +import com.ruoyi.system.service.IBaseExchangeRateService; +import com.ruoyi.common.core.text.Convert; +import org.springframework.util.CollectionUtils; + +/** + * 基础资料汇率管理Service业务层处理 + * + * @author 刘晓旭 + * @date 2024-10-29 + */ +@Service +public class BaseExchangeRateServiceImpl implements IBaseExchangeRateService +{ + @Autowired + private BaseExchangeRateMapper baseExchangeRateMapper; + + + /** + * 查询基础资料汇率管理 + * + * @param exchangeRateId 基础资料汇率管理ID + * @return 基础资料汇率管理 + */ + @Override + public BaseExchangeRate selectBaseExchangeRateById(Long exchangeRateId) + { + return baseExchangeRateMapper.selectBaseExchangeRateById(exchangeRateId); + } + + /** + * 查询基础资料汇率管理列表 + * + * @param baseExchangeRate 基础资料汇率管理 + * @return 基础资料汇率管理 + */ + @Override + public List selectBaseExchangeRateList(BaseExchangeRate baseExchangeRate) + { + return baseExchangeRateMapper.selectBaseExchangeRateList(baseExchangeRate); + } + + /** + * 新增基础资料汇率管理 + * + * @param baseExchangeRate 基础资料汇率管理 + * @return 结果 + */ + @Override + public int insertBaseExchangeRate(BaseExchangeRate baseExchangeRate) + { + String loginName = ShiroUtils.getLoginName(); + baseExchangeRate.setCreateBy(loginName); + baseExchangeRate.setCreateTime(DateUtils.getNowDate()); + + Date startTime = baseExchangeRate.getStartTime(); + Date endTime = baseExchangeRate.getEndTime(); + if (startTime.after(endTime)){ + throw new BusinessException("新增汇率失败!开始时间不能大于结束时间!"); + } + + List exchangeRates = baseExchangeRateMapper.selectExchangeRateByTimeRange(baseExchangeRate); + if (!CollectionUtils.isEmpty(exchangeRates)){ + throw new BusinessException("新增汇率失败!该时间段内已存在汇率数据!"); + } + return baseExchangeRateMapper.insertBaseExchangeRate(baseExchangeRate); + } + + /** + * 修改基础资料汇率管理 + * + * @param baseExchangeRate 基础资料汇率管理 + * @return 结果 + */ + @Override + public int updateBaseExchangeRate(BaseExchangeRate baseExchangeRate) + { + String loginName = ShiroUtils.getLoginName(); + baseExchangeRate.setUpdateBy(loginName); + baseExchangeRate.setUpdateTime(DateUtils.getNowDate()); + return baseExchangeRateMapper.updateBaseExchangeRate(baseExchangeRate); + } + + /** + * 删除基础资料汇率管理对象 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + @Override + public int deleteBaseExchangeRateByIds(String ids) + { + return baseExchangeRateMapper.deleteBaseExchangeRateByIds(Convert.toStrArray(ids)); + } + + /** + * 删除基础资料汇率管理信息 + * + * @param exchangeRateId 基础资料汇率管理ID + * @return 结果 + */ + @Override + public int deleteBaseExchangeRateById(Long exchangeRateId) + { + return baseExchangeRateMapper.deleteBaseExchangeRateById(exchangeRateId); + } + + /** + * 作废基础资料汇率管理 + * + * @param exchangeRateId 基础资料汇率管理ID + * @return 结果 + */ + @Override + public int cancelBaseExchangeRateById(Long exchangeRateId) + { + return baseExchangeRateMapper.cancelBaseExchangeRateById(exchangeRateId); + } + + /** + * 恢复基础资料汇率管理信息 + * + * @param exchangeRateId 基础资料汇率管理ID + * @return 结果 + */ + @Override + public int restoreBaseExchangeRateById(Long exchangeRateId) + { + return baseExchangeRateMapper.restoreBaseExchangeRateById(exchangeRateId); + } +} diff --git a/ruoyi-admin/src/main/resources/mapper/system/BaseExchangeRateMapper.xml b/ruoyi-admin/src/main/resources/mapper/system/BaseExchangeRateMapper.xml new file mode 100644 index 00000000..2147e1cf --- /dev/null +++ b/ruoyi-admin/src/main/resources/mapper/system/BaseExchangeRateMapper.xml @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + select exchange_rate_id, exchange_rate, start_time, end_time, create_by, create_time, update_by, update_time, remark from base_exchange_rate + + + + + + + + + + + insert into base_exchange_rate + + exchange_rate, + start_time, + end_time, + create_by, + create_time, + update_by, + update_time, + remark, + + + #{exchangeRate}, + #{startTime}, + #{endTime}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{remark}, + + + + + update base_exchange_rate + + exchange_rate = #{exchangeRate}, + start_time = #{startTime}, + end_time = #{endTime}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + + where exchange_rate_id = #{exchangeRateId} + + + + delete from base_exchange_rate where exchange_rate_id = #{exchangeRateId} + + + + delete from base_exchange_rate where exchange_rate_id in + + #{exchangeRateId} + + + + + update base_exchange_rate set del_flag = '1' where exchange_rate_id = #{exchangeRateId} + + + + update base_exchange_rate set del_flag = '0' where exchange_rate_id = #{exchangeRateId} + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/exchangeRate/add.html b/ruoyi-admin/src/main/resources/templates/system/exchangeRate/add.html new file mode 100644 index 00000000..7aae6e7f --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/exchangeRate/add.html @@ -0,0 +1,69 @@ + + + + + + + +
+
+
+ +
+
+ + +
+
+
+
+ +
+
+ + +
+
+
+
+ +
+ +
+
+ + + + + + +
+
+ + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/exchangeRate/edit.html b/ruoyi-admin/src/main/resources/templates/system/exchangeRate/edit.html new file mode 100644 index 00000000..be6b1f4e --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/exchangeRate/edit.html @@ -0,0 +1,70 @@ + + + + + + + +
+
+ +
+ +
+
+ + +
+
+
+
+ +
+
+ + +
+
+
+
+ +
+ +
+
+ + + + + + +
+
+ + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/exchangeRate/exchangeRate.html b/ruoyi-admin/src/main/resources/templates/system/exchangeRate/exchangeRate.html new file mode 100644 index 00000000..2a122a2b --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/exchangeRate/exchangeRate.html @@ -0,0 +1,101 @@ + + + + + + +
+
+
+
+
+ +
+
+
+ + +
+
+
+
+
+ + + + \ No newline at end of file