4 files modified
4 files added
| | |
| | | package com.xcong.excoin.modules.trademanage.controller; |
| | | |
| | | import com.xcong.excoin.common.annotation.ControllerEndpoint; |
| | | import com.xcong.excoin.common.controller.BaseController; |
| | | import com.xcong.excoin.common.entity.FebsResponse; |
| | | import com.xcong.excoin.common.entity.QueryRequest; |
| | | import com.xcong.excoin.modules.systemSetting.entity.PlatformTradeSettingEntity; |
| | | import com.xcong.excoin.modules.trademanage.dto.BzzNewPriceDto; |
| | | import com.xcong.excoin.modules.trademanage.entity.ContractHoldOrderEntity; |
| | | import com.xcong.excoin.modules.trademanage.entity.OrderCoinsDealEntity; |
| | | import com.xcong.excoin.modules.trademanage.service.OrderCoinDealService; |
| | |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.Valid; |
| | | import java.util.Map; |
| | | |
| | | @Validated |
| | |
| | | Map<String, Object> data = getDataTable(orderCoinDealService.findOrderCoinsDealListInPage(contractHoldOrderEntity, request)); |
| | | return new FebsResponse().success().data(data); |
| | | } |
| | | |
| | | /** |
| | | * BZZ最新价 |
| | | */ |
| | | @GetMapping("bzzNewPrice") |
| | | public FebsResponse bzzNewPrice(QueryRequest request) { |
| | | Map<String, Object> data = getDataTable(orderCoinDealService.bzzNewPrice(request)); |
| | | return new FebsResponse().success().data(data); |
| | | } |
| | | |
| | | /** |
| | | *BZZ最新价---确认 |
| | | * @return |
| | | */ |
| | | @PostMapping("bzzNewPriceUpdate") |
| | | @ControllerEndpoint(operation = "交易设置---确认", exceptionMessage = "设置失败") |
| | | public FebsResponse bzzNewPriceUpdate(@Valid BzzNewPriceDto bzzNewPriceDto) { |
| | | return orderCoinDealService.bzzNewPriceUpdate(bzzNewPriceDto); |
| | | } |
| | | } |
| | |
| | |
|
| | | import com.xcong.excoin.common.entity.FebsConstant;
|
| | | import com.xcong.excoin.common.utils.FebsUtil;
|
| | | import com.xcong.excoin.common.utils.RedisUtils;
|
| | | import com.xcong.excoin.modules.systemSetting.entity.PlatformBannerEntity;
|
| | | import com.xcong.excoin.modules.trademanage.vo.BzzNewPriceVo;
|
| | | import org.apache.shiro.authz.annotation.RequiresPermissions;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.ui.Model;
|
| | | import org.springframework.web.bind.annotation.GetMapping;
|
| | | import org.springframework.web.bind.annotation.PathVariable;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | /**
|
| | | * @author wzy
|
| | |
| | | @RequestMapping(FebsConstant.VIEW_PREFIX + "modules/trademanage")
|
| | | public class ViewController {
|
| | |
|
| | | /**
|
| | | @Resource
|
| | | private RedisUtils redisUtils;
|
| | | /**
|
| | | * BZZ最新价
|
| | | */
|
| | | @GetMapping("bzzNewPrice")
|
| | | @RequiresPermissions("bzzNewPrice:view")
|
| | | public String bzzNewPrice() {
|
| | | return FebsUtil.view("modules/trademanage/bzzNewPrice");
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * BZZ最新价---修改
|
| | | */
|
| | | @GetMapping("bzzNewPriceUpdate")
|
| | | @RequiresPermissions("platformBannerUpdate:update")
|
| | | public String platformBannerUpdate(Model model) {
|
| | |
|
| | | String newPrice = redisUtils.getString("bzz_order_new_price");
|
| | | BzzNewPriceVo bzzNewPriceVo = new BzzNewPriceVo();
|
| | | bzzNewPriceVo.setNewprice(newPrice);
|
| | | bzzNewPriceVo.setId(1L);
|
| | | model.addAttribute("member", bzzNewPriceVo);
|
| | | return FebsUtil.view("modules/trademanage/bzzNewPriceUpdate");
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * 当前持仓
|
| | | */
|
| | | @GetMapping("contractHoldOrder")
|
New file |
| | |
| | | package com.xcong.excoin.modules.trademanage.dto; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class BzzNewPriceDto { |
| | | |
| | | private String newprice; |
| | | |
| | | private long id; |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.xcong.excoin.common.entity.FebsResponse; |
| | | import com.xcong.excoin.common.entity.QueryRequest; |
| | | import com.xcong.excoin.modules.member.entity.MemberAccountMoneyChangeEntity; |
| | | import com.xcong.excoin.modules.member.entity.MemberEntity; |
| | | import com.xcong.excoin.modules.trademanage.dto.BzzNewPriceDto; |
| | | import com.xcong.excoin.modules.trademanage.entity.AgentReturnEntity; |
| | | import com.xcong.excoin.modules.trademanage.entity.ContractHoldOrderEntity; |
| | | import com.xcong.excoin.modules.trademanage.entity.ContractOrderEntity; |
| | | import com.xcong.excoin.modules.trademanage.entity.OrderCoinsDealEntity; |
| | | import com.xcong.excoin.modules.trademanage.vo.BzzNewPriceVo; |
| | | import com.xcong.excoin.modules.trademanage.vo.MemberAccountInfoVo; |
| | | |
| | | /** |
| | |
| | | |
| | | IPage<OrderCoinsDealEntity> findOrderCoinsDealListInPage(OrderCoinsDealEntity contractHoldOrderEntity, QueryRequest request); |
| | | |
| | | IPage<BzzNewPriceVo> bzzNewPrice(QueryRequest request); |
| | | |
| | | FebsResponse bzzNewPriceUpdate(BzzNewPriceDto bzzNewPriceDto); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.xcong.excoin.common.entity.FebsResponse; |
| | | import com.xcong.excoin.common.entity.QueryRequest; |
| | | import com.xcong.excoin.common.utils.CoinTypeConvert; |
| | | import com.xcong.excoin.common.utils.RedisUtils; |
| | |
| | | import com.xcong.excoin.modules.member.mapper.MemberAccountMoneyChangeMapper; |
| | | import com.xcong.excoin.modules.member.mapper.MemberAuthenticationMapper; |
| | | import com.xcong.excoin.modules.member.mapper.MemberMapper; |
| | | import com.xcong.excoin.modules.trademanage.dto.BzzNewPriceDto; |
| | | import com.xcong.excoin.modules.trademanage.entity.*; |
| | | import com.xcong.excoin.modules.trademanage.mapper.*; |
| | | import com.xcong.excoin.modules.trademanage.service.OrderCoinDealService; |
| | | import com.xcong.excoin.modules.trademanage.service.TradeManageService; |
| | | import com.xcong.excoin.modules.trademanage.vo.BzzNewPriceVo; |
| | | import com.xcong.excoin.modules.trademanage.vo.MemberAccountInfoVo; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | |
| | | |
| | | private final OrderCoinDealMapper orderCoinDealMapper; |
| | | private final RedisUtils redisUtils; |
| | | @Override |
| | | public IPage<OrderCoinsDealEntity> findOrderCoinsDealListInPage(OrderCoinsDealEntity contractHoldOrderEntity, QueryRequest request) { |
| | | Page<OrderCoinsDealEntity> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | |
| | | //List<OrderCoinsDealEntity> records = findMemberAccountInfoListInPage.getRecords(); |
| | | return findMemberAccountInfoListInPage; |
| | | } |
| | | |
| | | @Override |
| | | public IPage<BzzNewPriceVo> bzzNewPrice(QueryRequest request) { |
| | | String newPrice = redisUtils.getString("bzz_order_new_price"); |
| | | BzzNewPriceVo bzzNewPriceVo = new BzzNewPriceVo(); |
| | | bzzNewPriceVo.setNewprice(newPrice); |
| | | List<BzzNewPriceVo> bzzNewPrices = new ArrayList<>(); |
| | | bzzNewPrices.add(bzzNewPriceVo); |
| | | |
| | | Page<BzzNewPriceVo> bzzNewPriceVos = new Page<>(); |
| | | bzzNewPriceVos.setRecords(bzzNewPrices); |
| | | return bzzNewPriceVos; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public FebsResponse bzzNewPriceUpdate(BzzNewPriceDto bzzNewPriceDto) { |
| | | String newprice = bzzNewPriceDto.getNewprice(); |
| | | boolean flag = redisUtils.set("bzz_order_new_price", newprice); |
| | | if(flag){ |
| | | return new FebsResponse().success().message("设置成功"); |
| | | }else{ |
| | | return new FebsResponse().fail().message("设置失败"); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.xcong.excoin.modules.trademanage.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class BzzNewPriceVo { |
| | | |
| | | private String newprice; |
| | | private long id; |
| | | |
| | | } |
New file |
| | |
| | | <div class="layui-fluid layui-anim febs-anim" id="febs-user" lay-title="最新价"> |
| | | <div class="layui-row febs-container"> |
| | | <div class="layui-col-md12"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-body febs-table-full"> |
| | | <form class="layui-form layui-table-form" lay-filter="user-table-form"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-md2 layui-col-sm12 layui-col-xs12 table-action-area"> |
| | | <div class="layui-btn layui-btn-sm layui-btn-primary febs-button-blue-plain table-action" id="query"> |
| | | <i class="layui-icon"></i> |
| | | </div> |
| | | <div class="layui-btn layui-btn-sm layui-btn-primary febs-button-green-plain table-action" id="reset"> |
| | | <i class="layui-icon"></i> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </form> |
| | | <table lay-filter="userTable" lay-data="{id: 'userTable'}"></table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- 表格操作栏 end --> |
| | | <script data-th-inline="none" type="text/javascript"> |
| | | // 引入组件并初始化 |
| | | layui.use([ 'jquery', 'form', 'table', 'febs'], function () { |
| | | var $ = layui.jquery, |
| | | febs = layui.febs, |
| | | form = layui.form, |
| | | table = layui.table, |
| | | $view = $('#febs-user'), |
| | | $query = $view.find('#query'), |
| | | $reset = $view.find('#reset'), |
| | | $searchForm = $view.find('form'), |
| | | sortObject = {field: 'createTime', type: null}, |
| | | tableIns; |
| | | |
| | | form.render(); |
| | | |
| | | // 表格初始化 |
| | | initTable(); |
| | | // 初始化表格操作栏各个按钮功能 |
| | | table.on('tool(userTable)', function (obj) { |
| | | var data = obj.data, |
| | | layEvent = obj.event; |
| | | if (layEvent === 'edit') { |
| | | febs.modal.open('设置', 'modules/trademanage/bzzNewPriceUpdate', { |
| | | btn: ['提交', '取消'], |
| | | yes: function (index, layero) { |
| | | $('#user-update').find('#submit').trigger('click'); |
| | | }, |
| | | btn2: function () { |
| | | layer.closeAll(); |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | // 查询按钮 |
| | | $query.on('click', function () { |
| | | var params = $.extend(getQueryParams(), {field: sortObject.field, order: sortObject.type}); |
| | | tableIns.reload({where: params, page: {curr: 1}}); |
| | | }); |
| | | |
| | | // 刷新按钮 |
| | | $reset.on('click', function () { |
| | | $searchForm[0].reset(); |
| | | tableIns.reload({where: getQueryParams(), page: {curr: 1}}); |
| | | }); |
| | | |
| | | function initTable() { |
| | | tableIns = febs.table.init({ |
| | | elem: $view.find('table'), |
| | | id: 'userTable', |
| | | url: ctx + 'orderCoin/bzzNewPrice', |
| | | cols: [[ |
| | | {field: 'newprice', title: '最新价', minWidth: 100,align:'left'}, |
| | | {title: '操作', title: '操作', |
| | | templet: function (d) { |
| | | return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit" shiro:hasPermission="user:update">修改</button>' |
| | | } |
| | | ,minWidth: 200,align:'center'} |
| | | ]] |
| | | }); |
| | | } |
| | | |
| | | // 获取查询参数 |
| | | function getQueryParams() { |
| | | return { |
| | | }; |
| | | } |
| | | |
| | | }) |
| | | </script> |
New file |
| | |
| | | <style> |
| | | #user-update { |
| | | padding: 20px 25px 25px 0; |
| | | } |
| | | |
| | | #user-update .layui-treeSelect .ztree li a, .ztree li span { |
| | | margin: 0 0 2px 3px !important; |
| | | } |
| | | #user-update #data-permission-tree-block { |
| | | border: 1px solid #eee; |
| | | border-radius: 2px; |
| | | padding: 3px 0; |
| | | } |
| | | #user-add .layui-treeSelect .ztree li span.button.switch { |
| | | top: 1px; |
| | | left: 3px; |
| | | } |
| | | |
| | | </style> |
| | | <div class="layui-fluid" id="user-update"> |
| | | <form class="layui-form" action="" lay-filter="user-update-form"> |
| | | <div class="layui-form-item febs-hide"> |
| | | <label class="layui-form-label febs-form-item-require">用户id:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="id" data-th-value="${member.id}"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label febs-form-item-require">最新价:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="number" name="newprice" data-th-id="${member.newprice}" |
| | | lay-verify="range|newprice" autocomplete="off" class="layui-input" > |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item febs-hide"> |
| | | <button class="layui-btn" lay-submit="" lay-filter="user-update-form-submit" id="submit"></button> |
| | | </div> |
| | | </form> |
| | | </div> |
| | | |
| | | <script data-th-inline="javascript"> |
| | | layui.use(['febs', 'form', 'formSelects', 'validate', 'treeSelect', 'eleTree'], function () { |
| | | var $ = layui.$, |
| | | febs = layui.febs, |
| | | layer = layui.layer, |
| | | formSelects = layui.formSelects, |
| | | treeSelect = layui.treeSelect, |
| | | form = layui.form, |
| | | eleTree = layui.eleTree, |
| | | member = [[${member}]], |
| | | $view = $('#user-update'), |
| | | validate = layui.validate, |
| | | _deptTree; |
| | | |
| | | form.render(); |
| | | |
| | | initUserValue(); |
| | | |
| | | formSelects.render(); |
| | | |
| | | function initUserValue() { |
| | | form.val("user-update-form", { |
| | | "newprice": member.newprice, |
| | | "id": member.id, |
| | | }); |
| | | } |
| | | |
| | | form.on('submit(user-update-form-submit)', function (data) { |
| | | febs.post(ctx + 'orderCoin/bzzNewPriceUpdate', data.field, function () { |
| | | layer.closeAll(); |
| | | febs.alert.success('设置成功'); |
| | | $('#febs-user').find('#reset').click(); |
| | | }); |
| | | return false; |
| | | }); |
| | | }); |
| | | </script> |