From 2a6df70da19c093e1a16f80acc38d7c3fbb76186 Mon Sep 17 00:00:00 2001
From: zainali5120 <512061637@qq.com>
Date: Thu, 12 Nov 2020 21:46:32 +0800
Subject: [PATCH] 功能同步

---
 src/main/java/com/xcong/excoin/modules/trademanage/entity/OrderCoinsDealEntity.java            |   83 ++++++++++++++++
 src/main/java/com/xcong/excoin/modules/trademanage/service/impl/OrderCoinsDealServiceImpl.java |   44 ++++++++
 src/main/java/com/xcong/excoin/modules/member/dto/MemberLimitDto.java                          |   11 ++
 src/main/java/com/xcong/excoin/modules/trademanage/mapper/OrderCoinDealMapper.java             |   15 +++
 src/main/resources/mapper/modules/OrderCoinDealMapper.xml                                      |   23 ++++
 src/main/java/com/xcong/excoin/modules/trademanage/controller/OrderCoinViewController.java     |   21 ++++
 src/main/java/com/xcong/excoin/modules/trademanage/controller/OrderCoinDealController.java     |   33 ++++++
 src/main/java/com/xcong/excoin/modules/trademanage/service/OrderCoinDealService.java           |   22 ++++
 8 files changed, 252 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/xcong/excoin/modules/member/dto/MemberLimitDto.java b/src/main/java/com/xcong/excoin/modules/member/dto/MemberLimitDto.java
new file mode 100644
index 0000000..fea2254
--- /dev/null
+++ b/src/main/java/com/xcong/excoin/modules/member/dto/MemberLimitDto.java
@@ -0,0 +1,11 @@
+package com.xcong.excoin.modules.member.dto;
+
+import lombok.Data;
+
+@Data
+public class MemberLimitDto {
+    private String slxttbxz;
+    private String jysmcxz;
+    private String jystbxz;
+    private String jysmrxz;
+}
diff --git a/src/main/java/com/xcong/excoin/modules/trademanage/controller/OrderCoinDealController.java b/src/main/java/com/xcong/excoin/modules/trademanage/controller/OrderCoinDealController.java
new file mode 100644
index 0000000..4b88a5a
--- /dev/null
+++ b/src/main/java/com/xcong/excoin/modules/trademanage/controller/OrderCoinDealController.java
@@ -0,0 +1,33 @@
+package com.xcong.excoin.modules.trademanage.controller;
+
+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.trademanage.entity.ContractHoldOrderEntity;
+import com.xcong.excoin.modules.trademanage.entity.OrderCoinsDealEntity;
+import com.xcong.excoin.modules.trademanage.service.OrderCoinDealService;
+import lombok.RequiredArgsConstructor;
+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.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import java.util.Map;
+
+@Validated
+@RestController
+@RequiredArgsConstructor
+@RequestMapping(value = "/orderCoin")
+public class OrderCoinDealController extends BaseController {
+
+    private final OrderCoinDealService orderCoinDealService;
+
+    @GetMapping("/page")
+    @RequiresPermissions("orderCoins:view")
+    public FebsResponse getList(OrderCoinsDealEntity contractHoldOrderEntity, QueryRequest request) {
+        Map<String, Object> data = getDataTable(orderCoinDealService.findOrderCoinsDealListInPage(contractHoldOrderEntity, request));
+        return new FebsResponse().success().data(data);
+    }
+}
diff --git a/src/main/java/com/xcong/excoin/modules/trademanage/controller/OrderCoinViewController.java b/src/main/java/com/xcong/excoin/modules/trademanage/controller/OrderCoinViewController.java
new file mode 100644
index 0000000..492aee5
--- /dev/null
+++ b/src/main/java/com/xcong/excoin/modules/trademanage/controller/OrderCoinViewController.java
@@ -0,0 +1,21 @@
+package com.xcong.excoin.modules.trademanage.controller;
+
+import com.xcong.excoin.common.entity.FebsConstant;
+import com.xcong.excoin.common.utils.FebsUtil;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+@Controller("orderCoinView")
+@RequestMapping(FebsConstant.VIEW_PREFIX + "modules/orderCoin")
+public class OrderCoinViewController {
+    /**
+     * 当前持仓
+     */
+    @GetMapping("/page")
+    @RequiresPermissions("orderCoins:view")
+    public String contractHoldOrder() {
+        return FebsUtil.view("modules/orderCoin/orderCoin");
+    }
+}
diff --git a/src/main/java/com/xcong/excoin/modules/trademanage/entity/OrderCoinsDealEntity.java b/src/main/java/com/xcong/excoin/modules/trademanage/entity/OrderCoinsDealEntity.java
new file mode 100644
index 0000000..5508bb1
--- /dev/null
+++ b/src/main/java/com/xcong/excoin/modules/trademanage/entity/OrderCoinsDealEntity.java
@@ -0,0 +1,83 @@
+package com.xcong.excoin.modules.trademanage.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 币币订单成交表
+ */
+@Data
+@TableName("coins_order_deal")
+public class OrderCoinsDealEntity{
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+	private Long id;
+	/**
+	 * 会员ID
+	 */
+	private Long memberId;
+	/**
+	 * 订单主表ID
+	 */
+	private Long orderId;
+	/**
+	 * 订单编号
+	 */
+	private String orderNo;
+	/**
+	 * 订单类型 1、买入2、卖出
+	 */
+	private Integer orderType;
+	public static final Integer ORDERTYPE_BUY = 1;
+	public static final Integer ORDERTYPE_SELL = 2;
+	/**
+	 * 交易类型 1:市价2:限价
+	 */
+	private Integer tradeType;
+	public static final Integer TRADETYPE_MARKETPRICE = 1;
+	public static final Integer TRADETYPE_FIXEDPRICE = 2;
+	
+	/**
+	 * 状态  2:撤单3:已成交
+	 */
+	private Integer orderStatus;
+	public static final Integer ORDERSTATUS_CANCEL = 2;
+	public static final Integer ORDERSTATUS_DONE = 3;
+	/**
+	 * 币种
+	 */
+	private String symbol;
+	/**
+	 * 数量
+	 */
+	private BigDecimal symbolCnt;
+	/**
+	 * 委托价
+	 */
+	private BigDecimal entrustPrice;
+	/**
+	 * 成交价
+	 */
+	private BigDecimal dealPrice;
+	/**
+	 * 成交金额
+	 */
+	private BigDecimal dealAmount;
+	/**
+	 * 手续费
+	 */
+	private BigDecimal feeAmount;
+
+	private Date createTime;
+
+	private String phone;
+	private String email;
+
+	private Integer ipo;
+
+}
diff --git a/src/main/java/com/xcong/excoin/modules/trademanage/mapper/OrderCoinDealMapper.java b/src/main/java/com/xcong/excoin/modules/trademanage/mapper/OrderCoinDealMapper.java
new file mode 100644
index 0000000..ee8759e
--- /dev/null
+++ b/src/main/java/com/xcong/excoin/modules/trademanage/mapper/OrderCoinDealMapper.java
@@ -0,0 +1,15 @@
+package com.xcong.excoin.modules.trademanage.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.xcong.excoin.modules.trademanage.entity.ContractHoldOrderEntity;
+import com.xcong.excoin.modules.trademanage.entity.OrderCoinsDealEntity;
+import org.apache.ibatis.annotations.Param;
+
+public interface OrderCoinDealMapper extends BaseMapper<OrderCoinsDealEntity> {
+
+    IPage<OrderCoinsDealEntity> selectOrderCoinsDealListInPage(Page<OrderCoinsDealEntity> page,
+                                                               @Param("record") OrderCoinsDealEntity OrderCoinsDealEntity);
+
+}
diff --git a/src/main/java/com/xcong/excoin/modules/trademanage/service/OrderCoinDealService.java b/src/main/java/com/xcong/excoin/modules/trademanage/service/OrderCoinDealService.java
new file mode 100644
index 0000000..b2c323c
--- /dev/null
+++ b/src/main/java/com/xcong/excoin/modules/trademanage/service/OrderCoinDealService.java
@@ -0,0 +1,22 @@
+package com.xcong.excoin.modules.trademanage.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.IService;
+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.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.MemberAccountInfoVo;
+
+/**
+ * @author helius
+ */
+public interface OrderCoinDealService extends IService<OrderCoinsDealEntity> {
+
+	IPage<OrderCoinsDealEntity> findOrderCoinsDealListInPage(OrderCoinsDealEntity contractHoldOrderEntity, QueryRequest request);
+
+
+}
diff --git a/src/main/java/com/xcong/excoin/modules/trademanage/service/impl/OrderCoinsDealServiceImpl.java b/src/main/java/com/xcong/excoin/modules/trademanage/service/impl/OrderCoinsDealServiceImpl.java
new file mode 100644
index 0000000..87ff435
--- /dev/null
+++ b/src/main/java/com/xcong/excoin/modules/trademanage/service/impl/OrderCoinsDealServiceImpl.java
@@ -0,0 +1,44 @@
+package com.xcong.excoin.modules.trademanage.service.impl;
+
+
+import cn.hutool.core.collection.CollUtil;
+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.QueryRequest;
+import com.xcong.excoin.common.utils.CoinTypeConvert;
+import com.xcong.excoin.common.utils.RedisUtils;
+import com.xcong.excoin.modules.member.entity.MemberAccountMoneyChangeEntity;
+import com.xcong.excoin.modules.member.entity.MemberAuthenticationEntity;
+import com.xcong.excoin.modules.member.entity.MemberEntity;
+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.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.MemberAccountInfoVo;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.math.BigDecimal;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Service
+@RequiredArgsConstructor
+public class OrderCoinsDealServiceImpl extends ServiceImpl<OrderCoinDealMapper, OrderCoinsDealEntity> implements OrderCoinDealService {
+
+
+	private final OrderCoinDealMapper orderCoinDealMapper;
+	@Override
+	public IPage<OrderCoinsDealEntity> findOrderCoinsDealListInPage(OrderCoinsDealEntity contractHoldOrderEntity, QueryRequest request) {
+		Page<OrderCoinsDealEntity> page = new Page<>(request.getPageNum(), request.getPageSize());
+		IPage<OrderCoinsDealEntity> findMemberAccountInfoListInPage = orderCoinDealMapper.selectOrderCoinsDealListInPage(page, contractHoldOrderEntity);
+		//List<OrderCoinsDealEntity> records = findMemberAccountInfoListInPage.getRecords();
+		return findMemberAccountInfoListInPage;
+	}
+}
diff --git a/src/main/resources/mapper/modules/OrderCoinDealMapper.xml b/src/main/resources/mapper/modules/OrderCoinDealMapper.xml
new file mode 100644
index 0000000..98982d7
--- /dev/null
+++ b/src/main/resources/mapper/modules/OrderCoinDealMapper.xml
@@ -0,0 +1,23 @@
+<?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.xcong.excoin.modules.trademanage.mapper.OrderCoinDealMapper">
+
+	<select id="selectOrderCoinsDealListInPage" resultType="com.xcong.excoin.modules.trademanage.entity.OrderCoinsDealEntity">
+		SELECT
+			s.*,m.phone,m.email,m.ipo
+		FROM
+		coins_order_deal s
+		LEFT JOIN member m ON m.id = s.member_id
+		<where>
+		s.order_status = 3
+			<if test="record != null" >
+                <if test="record.phone!=null and record.phone!=''">
+                    and (m.phone like concat("%",#{record.phone},"%") or m.email like concat("%",#{record.phone},"%") or m.invite_id=#{record.phone})
+                </if>
+            </if>
+		</where>
+		ORDER BY s.create_time DESC
+	</select>
+
+    
+</mapper>
\ No newline at end of file

--
Gitblit v1.9.1