Browse Source

[feat]基础资料

新建基础资料汇率管理数据库表
新增汇率管理实体类
新增汇率管理Controller
新增汇率管理Mapper
新增汇率管理Mapper.XML
新增汇率管理Service接口
新增汇率管理ServiceImpl实现类
新增汇率管理前端列表页面:按照prd展示数据
新增汇率管理前端新增页面:设置开始时间、结束时间、汇率为必填字段
新增汇率管理前端修改页面:设置开始时间、结束时间、汇率为必填字段
修改基础资料汇率管理新增后端接口:插入数据之前进行判断,1:开始时间不能大于结束时间!;2:不同数据之间的开始时间和结束时间不可以存在交叉数据,满足上面条件才可以添加
新增 查询时间交叉集合的后端方法
dev
liuxiaoxu 4 weeks ago
parent
commit
d3ea2ddb97
  1. 151
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/BaseExchangeRateController.java
  2. 89
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/BaseExchangeRate.java
  3. 86
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BaseExchangeRateMapper.java
  4. 75
      ruoyi-admin/src/main/java/com/ruoyi/system/service/IBaseExchangeRateService.java
  5. 143
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseExchangeRateServiceImpl.java
  6. 100
      ruoyi-admin/src/main/resources/mapper/system/BaseExchangeRateMapper.xml
  7. 69
      ruoyi-admin/src/main/resources/templates/system/exchangeRate/add.html
  8. 70
      ruoyi-admin/src/main/resources/templates/system/exchangeRate/edit.html
  9. 101
      ruoyi-admin/src/main/resources/templates/system/exchangeRate/exchangeRate.html

151
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<BaseExchangeRate> 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<BaseExchangeRate> list = baseExchangeRateService.selectBaseExchangeRateList(baseExchangeRate);
ExcelUtil<BaseExchangeRate> util = new ExcelUtil<BaseExchangeRate>(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));
}
}

89
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();
}
}

86
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<BaseExchangeRate> selectBaseExchangeRateList(BaseExchangeRate baseExchangeRate);
/**
* 查询时间交叉
*
* @param baseExchangeRate 基础资料汇率管理
* @return 基础资料汇率管理集合
*/
public List<BaseExchangeRate> 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);
}

75
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<BaseExchangeRate> 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);
}

143
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<BaseExchangeRate> 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<BaseExchangeRate> 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);
}
}

100
ruoyi-admin/src/main/resources/mapper/system/BaseExchangeRateMapper.xml

@ -0,0 +1,100 @@
<?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.BaseExchangeRateMapper">
<resultMap type="BaseExchangeRate" id="BaseExchangeRateResult">
<result property="exchangeRateId" column="exchange_rate_id" />
<result property="exchangeRate" column="exchange_rate" />
<result property="startTime" column="start_time" />
<result property="endTime" column="end_time" />
<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="selectBaseExchangeRateVo">
select exchange_rate_id, exchange_rate, start_time, end_time, create_by, create_time, update_by, update_time, remark from base_exchange_rate
</sql>
<select id="selectBaseExchangeRateList" parameterType="BaseExchangeRate" resultMap="BaseExchangeRateResult">
<include refid="selectBaseExchangeRateVo"/>
<where>
<if test="startTime != null "> and start_time = #{startTime}</if>
<if test="endTime != null "> and end_time = #{endTime}</if>
</where>
</select>
<select id="selectBaseExchangeRateById" parameterType="Long" resultMap="BaseExchangeRateResult">
<include refid="selectBaseExchangeRateVo"/>
where exchange_rate_id = #{exchangeRateId}
</select>
<select id="selectExchangeRateByTimeRange" parameterType="BaseExchangeRate" resultMap="BaseExchangeRateResult">
<include refid="selectBaseExchangeRateVo"/>
WHERE start_time &lt;= #{endTime} AND end_time &gt;= #{startTime}
</select>
<insert id="insertBaseExchangeRate" parameterType="BaseExchangeRate" useGeneratedKeys="true" keyProperty="exchangeRateId">
insert into base_exchange_rate
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="exchangeRate != null">exchange_rate,</if>
<if test="startTime != null">start_time,</if>
<if test="endTime != null">end_time,</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="exchangeRate != null">#{exchangeRate},</if>
<if test="startTime != null">#{startTime},</if>
<if test="endTime != null">#{endTime},</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="updateBaseExchangeRate" parameterType="BaseExchangeRate">
update base_exchange_rate
<trim prefix="SET" suffixOverrides=",">
<if test="exchangeRate != null">exchange_rate = #{exchangeRate},</if>
<if test="startTime != null">start_time = #{startTime},</if>
<if test="endTime != null">end_time = #{endTime},</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 exchange_rate_id = #{exchangeRateId}
</update>
<delete id="deleteBaseExchangeRateById" parameterType="Long">
delete from base_exchange_rate where exchange_rate_id = #{exchangeRateId}
</delete>
<delete id="deleteBaseExchangeRateByIds" parameterType="String">
delete from base_exchange_rate where exchange_rate_id in
<foreach item="exchangeRateId" collection="array" open="(" separator="," close=")">
#{exchangeRateId}
</foreach>
</delete>
<update id="cancelBaseExchangeRateById" parameterType="Long">
update base_exchange_rate set del_flag = '1' where exchange_rate_id = #{exchangeRateId}
</update>
<update id="restoreBaseExchangeRateById" parameterType="Long">
update base_exchange_rate set del_flag = '0' where exchange_rate_id = #{exchangeRateId}
</update>
</mapper>

69
ruoyi-admin/src/main/resources/templates/system/exchangeRate/add.html

@ -0,0 +1,69 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增基础资料汇率管理')" />
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-exchangeRate-add">
<div class="form-group">
<label class="col-sm-3 control-label is-required">开始时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="startTime" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">结束时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="endTime" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">汇率:</label>
<div class="col-sm-8">
<input name="exchangeRate" class="form-control" type="text" required>
</div>
</div>
<!-- <div class="form-group"> -->
<!-- <label class="col-sm-3 control-label">备注信息:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <input name="remark" class="form-control" type="text">-->
<!-- </div>-->
<!-- </div>-->
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "system/exchangeRate"
$("#form-exchangeRate-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-exchangeRate-add').serialize());
}
}
$("input[name='startTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='endTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
</script>
</body>
</html>

70
ruoyi-admin/src/main/resources/templates/system/exchangeRate/edit.html

@ -0,0 +1,70 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改基础资料汇率管理')" />
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-exchangeRate-edit" th:object="${baseExchangeRate}">
<input name="exchangeRateId" th:field="*{exchangeRateId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label is-required">开始时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="startTime" th:value="${#dates.format(baseExchangeRate.startTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">结束时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="endTime" th:value="${#dates.format(baseExchangeRate.endTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">汇率:</label>
<div class="col-sm-8">
<input name="exchangeRate" th:field="*{exchangeRate}" class="form-control" type="text" required>
</div>
</div>
<!-- <div class="form-group"> -->
<!-- <label class="col-sm-3 control-label">备注信息:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <input name="remark" th:field="*{remark}" class="form-control" type="text">-->
<!-- </div>-->
<!-- </div>-->
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "system/exchangeRate";
$("#form-exchangeRate-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-exchangeRate-edit').serialize());
}
}
$("input[name='startTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='endTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
</script>
</body>
</html>

101
ruoyi-admin/src/main/resources/templates/system/exchangeRate/exchangeRate.html

@ -0,0 +1,101 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('基础资料汇率管理列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
<label>开始时间:</label>
<input type="text" class="time-input" placeholder="请选择开始时间" name="startTime"/>
</li>
<li>
<label>结束时间:</label>
<input type="text" class="time-input" placeholder="请选择结束时间" name="endTime"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:exchangeRate:add">
<i class="fa fa-plus"></i> 添加
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('system:exchangeRate:edit')}]];
var removeFlag = [[${@permission.hasPermi('system:exchangeRate:remove')}]];
var prefix = ctx + "system/exchangeRate";
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
modalName: "汇率管理",
columns: [
{
title: '汇率ID',
field: 'exchangeRateId',
visible: false
},
{
title: '开始时间',
field: 'startTime',
align: 'center',
},
{
title: '结束时间',
field: 'endTime',
align: 'center',
},
{
title: '汇率',
field: 'exchangeRate',
align: 'center',
formatter: function(value, row, index) {
if (typeof value === 'number'){
return value.toFixed(2);
}else{
return value;
}
}
},
{
title: '上次更新时间',
field: 'updateTime',
align: 'center',
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.exchangeRateId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.exchangeRateId + '\')"><i class="fa fa-remove"></i>删除</a> ');
return actions.join('');
}
}]
};
$.table.init(options);
});
</script>
</body>
</html>
Loading…
Cancel
Save