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

完成汇率管理

上级 dbef6fb9
...@@ -6,7 +6,7 @@ import com.platform.entity.TbCfExchangeEntity; ...@@ -6,7 +6,7 @@ import com.platform.entity.TbCfExchangeEntity;
* 汇率管理Dao * 汇率管理Dao
* *
* @author lipengjun * @author lipengjun
* @date 2019-12-10 11:15:53 * @date 2019-12-10 12:21:26
*/ */
public interface TbCfExchangeDao extends BaseDao<TbCfExchangeEntity> { public interface TbCfExchangeDao extends BaseDao<TbCfExchangeEntity> {
......
package com.platform.entity; package com.platform.entity;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
/** /**
...@@ -8,7 +9,7 @@ import java.util.Date; ...@@ -8,7 +9,7 @@ import java.util.Date;
* 表名 tb_cf_exchange * 表名 tb_cf_exchange
* *
* @author lipengjun * @author lipengjun
* @date 2019-12-10 11:15:53 * @date 2019-12-10 15:29:22
*/ */
public class TbCfExchangeEntity implements Serializable { public class TbCfExchangeEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -17,6 +18,10 @@ public class TbCfExchangeEntity implements Serializable { ...@@ -17,6 +18,10 @@ public class TbCfExchangeEntity implements Serializable {
* ID * ID
*/ */
private String id; private String id;
/**
* 转换类型
*/
private String type;
/** /**
* 货币 * 货币
*/ */
...@@ -25,6 +30,10 @@ public class TbCfExchangeEntity implements Serializable { ...@@ -25,6 +30,10 @@ public class TbCfExchangeEntity implements Serializable {
* 兑换货币 * 兑换货币
*/ */
private String exchangeCurrency; private String exchangeCurrency;
/**
* 汇率
*/
private BigDecimal exchangeRate;
/** /**
* 删除标志 0:正常 1:已删除 * 删除标志 0:正常 1:已删除
*/ */
...@@ -51,6 +60,19 @@ public class TbCfExchangeEntity implements Serializable { ...@@ -51,6 +60,19 @@ public class TbCfExchangeEntity implements Serializable {
public String getId() { public String getId() {
return id; return id;
} }
/**
* 设置:转换类型
*/
public void setType(String type) {
this.type = type;
}
/**
* 获取:转换类型
*/
public String getType() {
return type;
}
/** /**
* 设置:货币 * 设置:货币
*/ */
...@@ -77,6 +99,19 @@ public class TbCfExchangeEntity implements Serializable { ...@@ -77,6 +99,19 @@ public class TbCfExchangeEntity implements Serializable {
public String getExchangeCurrency() { public String getExchangeCurrency() {
return exchangeCurrency; return exchangeCurrency;
} }
/**
* 设置:汇率
*/
public void setExchangeRate(BigDecimal exchangeRate) {
this.exchangeRate = exchangeRate;
}
/**
* 获取:汇率
*/
public BigDecimal getExchangeRate() {
return exchangeRate;
}
/** /**
* 设置:删除标志 0:正常 1:已删除 * 设置:删除标志 0:正常 1:已删除
*/ */
......
...@@ -7,6 +7,7 @@ import com.platform.utils.IdUtil; ...@@ -7,6 +7,7 @@ import com.platform.utils.IdUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -39,11 +40,15 @@ public class TbCfExchangeServiceImpl implements TbCfExchangeService { ...@@ -39,11 +40,15 @@ public class TbCfExchangeServiceImpl implements TbCfExchangeService {
@Override @Override
public int save(TbCfExchangeEntity tbCfExchange) { public int save(TbCfExchangeEntity tbCfExchange) {
tbCfExchange.setId(IdUtil.createIdbyUUID()); tbCfExchange.setId(IdUtil.createIdbyUUID());
tbCfExchange.setDelFlag(0);
tbCfExchange.setCreateTime(new Date());
tbCfExchange.setUpdateTime(new Date());
return tbCfExchangeDao.save(tbCfExchange); return tbCfExchangeDao.save(tbCfExchange);
} }
@Override @Override
public int update(TbCfExchangeEntity tbCfExchange) { public int update(TbCfExchangeEntity tbCfExchange) {
tbCfExchange.setUpdateTime(new Date());
return tbCfExchangeDao.update(tbCfExchange); return tbCfExchangeDao.update(tbCfExchange);
} }
......
...@@ -5,8 +5,10 @@ ...@@ -5,8 +5,10 @@
<resultMap type="com.platform.entity.TbCfExchangeEntity" id="tbCfExchangeMap"> <resultMap type="com.platform.entity.TbCfExchangeEntity" id="tbCfExchangeMap">
<result property="id" column="id"/> <result property="id" column="id"/>
<result property="type" column="type"/>
<result property="currency" column="currency"/> <result property="currency" column="currency"/>
<result property="exchangeCurrency" column="exchange_currency"/> <result property="exchangeCurrency" column="exchange_currency"/>
<result property="exchangeRate" column="exchange_rate"/>
<result property="delFlag" column="del_flag"/> <result property="delFlag" column="del_flag"/>
<result property="createTime" column="create_time"/> <result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/> <result property="updateTime" column="update_time"/>
...@@ -15,8 +17,10 @@ ...@@ -15,8 +17,10 @@
<select id="queryObject" resultType="com.platform.entity.TbCfExchangeEntity"> <select id="queryObject" resultType="com.platform.entity.TbCfExchangeEntity">
select select
`id`, `id`,
`type`,
`currency`, `currency`,
`exchange_currency`, `exchange_currency`,
`exchange_rate`,
`del_flag`, `del_flag`,
`create_time`, `create_time`,
`update_time` `update_time`
...@@ -27,8 +31,10 @@ ...@@ -27,8 +31,10 @@
<select id="queryList" resultType="com.platform.entity.TbCfExchangeEntity"> <select id="queryList" resultType="com.platform.entity.TbCfExchangeEntity">
select select
`id`, `id`,
`type`,
`currency`, `currency`,
`exchange_currency`, `exchange_currency`,
`exchange_rate`,
`del_flag`, `del_flag`,
`create_time`, `create_time`,
`update_time` `update_time`
...@@ -61,15 +67,19 @@ ...@@ -61,15 +67,19 @@
<insert id="save" parameterType="com.platform.entity.TbCfExchangeEntity"> <insert id="save" parameterType="com.platform.entity.TbCfExchangeEntity">
insert into tb_cf_exchange( insert into tb_cf_exchange(
`id`, `id`,
`type`,
`currency`, `currency`,
`exchange_currency`, `exchange_currency`,
`exchange_rate`,
`del_flag`, `del_flag`,
`create_time`, `create_time`,
`update_time`) `update_time`)
values( values(
#{id}, #{id},
#{type},
#{currency}, #{currency},
#{exchangeCurrency}, #{exchangeCurrency},
#{exchangeRate},
#{delFlag}, #{delFlag},
#{createTime}, #{createTime},
#{updateTime}) #{updateTime})
...@@ -78,10 +88,12 @@ ...@@ -78,10 +88,12 @@
<update id="update" parameterType="com.platform.entity.TbCfExchangeEntity"> <update id="update" parameterType="com.platform.entity.TbCfExchangeEntity">
update tb_cf_exchange update tb_cf_exchange
<set> <set>
<if test="currency != null">`currency` = #{currency}, </if> <if test="type != null">`type` = #{type},</if>
<if test="exchangeCurrency != null">`exchange_currency` = #{exchangeCurrency}, </if> <if test="currency != null">`currency` = #{currency},</if>
<if test="delFlag != null">`del_flag` = #{delFlag}, </if> <if test="exchangeCurrency != null">`exchange_currency` = #{exchangeCurrency},</if>
<if test="createTime != null">`create_time` = #{createTime}, </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> <if test="updateTime != null">`update_time` = #{updateTime}</if>
</set> </set>
where id = #{id} where id = #{id}
......
...@@ -33,24 +33,26 @@ ...@@ -33,24 +33,26 @@
<Card v-show="!showList"> <Card v-show="!showList">
<p slot="title">{{title}}</p> <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"> <Form-item label="货币" prop="currency">
<i-input v-model="tbCfExchange.currency" placeholder="货币"/> <i-input v-model="tbCfExchange.currency" placeholder="货币"/>
</Form-item> </Form-item>
<Form-item label="兑换货币" prop="exchangeCurrency"> <Form-item label="兑换货币" prop="exchangeCurrency">
<i-input v-model="tbCfExchange.exchangeCurrency" placeholder="兑换货币"/> <i-input v-model="tbCfExchange.exchangeCurrency" placeholder="兑换货币"/>
</Form-item> </Form-item>
<Form-item label="删除标志 0:正常 1:已删除" prop="delFlag"> <Form-item label="汇率" prop="exchangeRate">
<i-input v-model="tbCfExchange.delFlag" placeholder="删除标志 0:正常 1:已删除"/> <i-input v-model="tbCfExchange.exchangeRate" placeholder="汇率"/>
</Form-item> </Form-item>
<Form-item label="创建时间" prop="createTime"> <Form-item label="状态" prop="delFlag">
<i-input v-model="tbCfExchange.createTime" placeholder="创建时间"/> <i-input v-model="tbCfExchange.delFlag" placeholder="状态"/>
</Form-item> </Form-item>
<Form-item label="更新时间" prop="updateTime">
<i-input v-model="tbCfExchange.updateTime" placeholder="更新时间"/>
</Form-item> </Form-item>
<Form-item> <Form-item>
<i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button> <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> <i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
</Form-item> </Form-item>
</i-form> </i-form>
......
...@@ -3,11 +3,13 @@ $(function () { ...@@ -3,11 +3,13 @@ $(function () {
url: '../tbcfexchange/list', url: '../tbcfexchange/list',
colModel: [ colModel: [
{label: 'id', name: 'id', index: 'id', key: true, hidden: true}, {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: 'currency', index: 'currency', width: 80},
{label: '兑换货币', name: 'exchangeCurrency', index: 'exchange_currency', width: 80}, {label: '兑换货币', name: 'exchangeCurrency', index: 'exchange_currency', width: 80},
{label: '删除标志 0:正常 1:已删除', name: 'delFlag', index: 'del_flag', width: 80}, {label: '汇率', name: 'exchangeRate', index: 'exchange_rate', width: 80},
{label: '创建时间', name: 'createTime', index: 'create_time', width: 80}, {label: '状态', name: 'delFlag', index: 'del_flag', width: 80},
{label: '更新时间', name: 'updateTime', index: 'update_time', width: 80}] {label: '创建时间', name: 'createTime', index: 'create_time', width: 80}
]
}); });
}); });
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论