提交 026f543c authored 作者: zgy's avatar zgy

完成汇率管理

上级 dbef6fb9
......@@ -6,7 +6,7 @@ import com.platform.entity.TbCfExchangeEntity;
* 汇率管理Dao
*
* @author lipengjun
* @date 2019-12-10 11:15:53
* @date 2019-12-10 12:21:26
*/
public interface TbCfExchangeDao extends BaseDao<TbCfExchangeEntity> {
......
package com.platform.entity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
......@@ -8,7 +9,7 @@ import java.util.Date;
* 表名 tb_cf_exchange
*
* @author lipengjun
* @date 2019-12-10 11:15:53
* @date 2019-12-10 15:29:22
*/
public class TbCfExchangeEntity implements Serializable {
private static final long serialVersionUID = 1L;
......@@ -17,6 +18,10 @@ public class TbCfExchangeEntity implements Serializable {
* ID
*/
private String id;
/**
* 转换类型
*/
private String type;
/**
* 货币
*/
......@@ -25,6 +30,10 @@ public class TbCfExchangeEntity implements Serializable {
* 兑换货币
*/
private String exchangeCurrency;
/**
* 汇率
*/
private BigDecimal exchangeRate;
/**
* 删除标志 0:正常 1:已删除
*/
......@@ -51,6 +60,19 @@ public class TbCfExchangeEntity implements Serializable {
public String getId() {
return id;
}
/**
* 设置:转换类型
*/
public void setType(String type) {
this.type = type;
}
/**
* 获取:转换类型
*/
public String getType() {
return type;
}
/**
* 设置:货币
*/
......@@ -77,6 +99,19 @@ public class TbCfExchangeEntity implements Serializable {
public String getExchangeCurrency() {
return exchangeCurrency;
}
/**
* 设置:汇率
*/
public void setExchangeRate(BigDecimal exchangeRate) {
this.exchangeRate = exchangeRate;
}
/**
* 获取:汇率
*/
public BigDecimal getExchangeRate() {
return exchangeRate;
}
/**
* 设置:删除标志 0:正常 1:已删除
*/
......
......@@ -7,6 +7,7 @@ import com.platform.utils.IdUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
import java.util.Map;
......@@ -39,11 +40,15 @@ public class TbCfExchangeServiceImpl implements TbCfExchangeService {
@Override
public int save(TbCfExchangeEntity tbCfExchange) {
tbCfExchange.setId(IdUtil.createIdbyUUID());
tbCfExchange.setDelFlag(0);
tbCfExchange.setCreateTime(new Date());
tbCfExchange.setUpdateTime(new Date());
return tbCfExchangeDao.save(tbCfExchange);
}
@Override
public int update(TbCfExchangeEntity tbCfExchange) {
tbCfExchange.setUpdateTime(new Date());
return tbCfExchangeDao.update(tbCfExchange);
}
......
......@@ -5,18 +5,22 @@
<resultMap type="com.platform.entity.TbCfExchangeEntity" id="tbCfExchangeMap">
<result property="id" column="id"/>
<result property="type" column="type"/>
<result property="currency" column="currency"/>
<result property="exchangeCurrency" column="exchange_currency"/>
<result property="exchangeRate" column="exchange_rate"/>
<result property="delFlag" column="del_flag"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<select id="queryObject" resultType="com.platform.entity.TbCfExchangeEntity">
<select id="queryObject" resultType="com.platform.entity.TbCfExchangeEntity">
select
`id`,
`type`,
`currency`,
`exchange_currency`,
`exchange_rate`,
`del_flag`,
`create_time`,
`update_time`
......@@ -24,78 +28,86 @@
where id = #{id}
</select>
<select id="queryList" resultType="com.platform.entity.TbCfExchangeEntity">
select
`id`,
`currency`,
`exchange_currency`,
`del_flag`,
`create_time`,
`update_time`
from tb_cf_exchange
WHERE 1=1
<if test="name != null and name.trim() != ''">
AND name LIKE concat('%',#{name},'%')
</if>
<select id="queryList" resultType="com.platform.entity.TbCfExchangeEntity">
select
`id`,
`type`,
`currency`,
`exchange_currency`,
`exchange_rate`,
`del_flag`,
`create_time`,
`update_time`
from tb_cf_exchange
WHERE 1=1
<if test="name != null and name.trim() != ''">
AND name LIKE concat('%',#{name},'%')
</if>
<choose>
<when test="sidx != null and sidx.trim() != ''">
order by ${sidx} ${order}
</when>
<otherwise>
<otherwise>
order by id desc
</otherwise>
</otherwise>
</choose>
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
</select>
<select id="queryTotal" resultType="int">
select count(*) from tb_cf_exchange
WHERE 1=1
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
</select>
<select id="queryTotal" resultType="int">
select count(*) from tb_cf_exchange
WHERE 1=1
<if test="name != null and name.trim() != ''">
AND name LIKE concat('%',#{name},'%')
</if>
</select>
<insert id="save" parameterType="com.platform.entity.TbCfExchangeEntity">
</select>
<insert id="save" parameterType="com.platform.entity.TbCfExchangeEntity">
insert into tb_cf_exchange(
`id`,
`type`,
`currency`,
`exchange_currency`,
`exchange_rate`,
`del_flag`,
`create_time`,
`update_time`)
values(
#{id},
#{type},
#{currency},
#{exchangeCurrency},
#{exchangeRate},
#{delFlag},
#{createTime},
#{updateTime})
</insert>
<update id="update" parameterType="com.platform.entity.TbCfExchangeEntity">
update tb_cf_exchange
<set>
<if test="currency != null">`currency` = #{currency}, </if>
<if test="exchangeCurrency != null">`exchange_currency` = #{exchangeCurrency}, </if>
<if test="delFlag != null">`del_flag` = #{delFlag}, </if>
<if test="createTime != null">`create_time` = #{createTime}, </if>
<if test="updateTime != null">`update_time` = #{updateTime}</if>
</set>
where id = #{id}
</update>
<delete id="delete">
<update id="update" parameterType="com.platform.entity.TbCfExchangeEntity">
update tb_cf_exchange
<set>
<if test="type != null">`type` = #{type},</if>
<if test="currency != null">`currency` = #{currency},</if>
<if test="exchangeCurrency != null">`exchange_currency` = #{exchangeCurrency},</if>
<if test="exchangeRate != null">`exchange_rate` = #{exchangeRate},</if>
<if test="delFlag != null">`del_flag` = #{delFlag},</if>
<if test="createTime != null">`create_time` = #{createTime},</if>
<if test="updateTime != null">`update_time` = #{updateTime}</if>
</set>
where id = #{id}
</update>
<delete id="delete">
delete from tb_cf_exchange where id = #{value}
</delete>
<delete id="deleteBatch">
delete from tb_cf_exchange where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deleteBatch">
delete from tb_cf_exchange where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
......@@ -6,7 +6,7 @@
</head>
<body>
<div id="rrapp" v-cloak style="height: calc(100% - 15px);">
<div v-show="showList" style="height: 100%;">
<div v-show="showList" style="height: 100%;">
<Row :gutter="16">
<div class="search-group">
<i-col span="4">
......@@ -27,34 +27,36 @@
#end
</div>
</Row>
<table id="jqGrid"></table>
<table id="jqGrid"></table>
</div>
<Card v-show="!showList">
<p slot="title">{{title}}</p>
<i-form ref="formValidate" :model="tbCfExchange" :rules="ruleValidate" :label-width="80">
<i-form ref="formValidate" :model="tbCfExchange" :rules="ruleValidate" :label-width="80">
<Form-item label="转换类型" prop="type">
<i-input v-model="tbCfExchange.type" placeholder="转换类型"/>
</Form-item>
<Form-item label="货币" prop="currency">
<i-input v-model="tbCfExchange.currency" placeholder="货币"/>
</Form-item>
<Form-item label="兑换货币" prop="exchangeCurrency">
<i-input v-model="tbCfExchange.exchangeCurrency" placeholder="兑换货币"/>
</Form-item>
<Form-item label="删除标志 0:正常 1:已删除" prop="delFlag">
<i-input v-model="tbCfExchange.delFlag" placeholder="删除标志 0:正常 1:已删除"/>
<Form-item label="汇率" prop="exchangeRate">
<i-input v-model="tbCfExchange.exchangeRate" placeholder="汇率"/>
</Form-item>
<Form-item label="创建时间" prop="createTime">
<i-input v-model="tbCfExchange.createTime" placeholder="创建时间"/>
<Form-item label="状态" prop="delFlag">
<i-input v-model="tbCfExchange.delFlag" placeholder="状态"/>
</Form-item>
<Form-item label="更新时间" prop="updateTime">
<i-input v-model="tbCfExchange.updateTime" placeholder="更新时间"/>
</Form-item>
<Form-item>
<i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
<i-button type="warning" @click="reload" style="margin-left: 8px"/>返回</i-button>
<i-button type="warning" @click="reload" style="margin-left: 8px"/>
返回</i-button>
<i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
</Form-item>
</i-form>
</Card>
</Card>
</div>
<script src="${rc.contextPath}/js/sys/tbcfexchange.js?_${date.systemTime}"></script>
......
......@@ -3,11 +3,13 @@ $(function () {
url: '../tbcfexchange/list',
colModel: [
{label: 'id', name: 'id', index: 'id', key: true, hidden: true},
{label: '转换类型', name: 'type', index: 'type', width: 80},
{label: '货币', name: 'currency', index: 'currency', width: 80},
{label: '兑换货币', name: 'exchangeCurrency', index: 'exchange_currency', width: 80},
{label: '删除标志 0:正常 1:已删除', name: 'delFlag', index: 'del_flag', width: 80},
{label: '创建时间', name: 'createTime', index: 'create_time', width: 80},
{label: '更新时间', name: 'updateTime', index: 'update_time', width: 80}]
{label: '汇率', name: 'exchangeRate', index: 'exchange_rate', width: 80},
{label: '状态', name: 'delFlag', index: 'del_flag', width: 80},
{label: '创建时间', name: 'createTime', index: 'create_time', width: 80}
]
});
});
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论