From 75e4dc92fd32c26be667e8c7235b435d1437261d Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Tue, 26 Jan 2021 11:18:25 +0800
Subject: [PATCH] 20210126

---
 src/main/java/com/xcong/excoin/modules/documentary/entity/FollowTraderLabelEntity.java      |   24 ++++++++
 src/main/java/com/xcong/excoin/modules/documentary/vo/TradeSetInfoVo.java                   |    3 +
 src/main/java/com/xcong/excoin/modules/documentary/vo/TradeSetLabelInfoVo.java              |   17 +++++
 src/main/java/com/xcong/excoin/modules/documentary/controller/TraderController.java         |   11 +++
 src/main/java/com/xcong/excoin/modules/documentary/dto/UpdateTradeSetInfoDto.java           |    2 
 src/main/java/com/xcong/excoin/modules/documentary/dao/FollowTraderLabelDao.java            |    8 ++
 src/main/java/com/xcong/excoin/modules/documentary/entity/FollowTraderInfoEntity.java       |    4 +
 src/main/java/com/xcong/excoin/modules/documentary/service/DocumentaryService.java          |    2 
 src/main/java/com/xcong/excoin/modules/documentary/service/impl/DocumentaryServiceImpl.java |   76 +++++++++++++++++++++++++
 src/main/resources/mapper/documentary/FollowTraderLabelDao.xml                              |    5 +
 src/main/java/com/xcong/excoin/modules/documentary/vo/FollowTraderProfitInfoVo.java         |    5 +
 11 files changed, 156 insertions(+), 1 deletions(-)

diff --git a/src/main/java/com/xcong/excoin/modules/documentary/controller/TraderController.java b/src/main/java/com/xcong/excoin/modules/documentary/controller/TraderController.java
index e05bf0d..ae140b0 100644
--- a/src/main/java/com/xcong/excoin/modules/documentary/controller/TraderController.java
+++ b/src/main/java/com/xcong/excoin/modules/documentary/controller/TraderController.java
@@ -20,6 +20,7 @@
 import com.xcong.excoin.modules.documentary.vo.TradeOrderInfoVo;
 import com.xcong.excoin.modules.documentary.vo.TradeProfitInfoVo;
 import com.xcong.excoin.modules.documentary.vo.TradeSetInfoVo;
+import com.xcong.excoin.modules.documentary.vo.TradeSetLabelInfoVo;
 import com.xcong.excoin.modules.documentary.vo.TraderStatusVo;
 
 import io.swagger.annotations.Api;
@@ -118,6 +119,16 @@
 	}
 	
 	/**
+	 * 交易员设置--进入编辑---获取标签信息
+	 */
+	@ApiOperation(value="交易员设置--进入编辑---获取标签信息", notes="交易员设置--进入编辑---获取标签信息")
+	@ApiResponses({@ApiResponse( code = 200, message = "success", response = TradeSetLabelInfoVo.class)})
+	@GetMapping(value = "/getTradeSetLabelInfo")
+	public Result  getTradeSetLabelInfo() {
+		return documentaryService.getTradeSetLabelInfo();
+	}
+	
+	/**
 	 * 交易员设置--更新设置
 	 */
 	@ApiOperation(value="交易员设置--更新设置", notes="交易员设置--更新设置")
diff --git a/src/main/java/com/xcong/excoin/modules/documentary/dao/FollowTraderLabelDao.java b/src/main/java/com/xcong/excoin/modules/documentary/dao/FollowTraderLabelDao.java
new file mode 100644
index 0000000..44a4441
--- /dev/null
+++ b/src/main/java/com/xcong/excoin/modules/documentary/dao/FollowTraderLabelDao.java
@@ -0,0 +1,8 @@
+package com.xcong.excoin.modules.documentary.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.xcong.excoin.modules.documentary.entity.FollowTraderLabelEntity;
+
+public interface FollowTraderLabelDao extends BaseMapper<FollowTraderLabelEntity> {
+
+}
diff --git a/src/main/java/com/xcong/excoin/modules/documentary/dto/UpdateTradeSetInfoDto.java b/src/main/java/com/xcong/excoin/modules/documentary/dto/UpdateTradeSetInfoDto.java
index 6112e6b..d14ae4c 100644
--- a/src/main/java/com/xcong/excoin/modules/documentary/dto/UpdateTradeSetInfoDto.java
+++ b/src/main/java/com/xcong/excoin/modules/documentary/dto/UpdateTradeSetInfoDto.java
@@ -21,5 +21,7 @@
 		@NotNull(message = "宣言不能为空")
 		@ApiModelProperty("宣言")
 		private String declaration;
+		@ApiModelProperty("标签")
+		private String labels;
 		
 }
diff --git a/src/main/java/com/xcong/excoin/modules/documentary/entity/FollowTraderInfoEntity.java b/src/main/java/com/xcong/excoin/modules/documentary/entity/FollowTraderInfoEntity.java
index 174bf54..28f4d6f 100644
--- a/src/main/java/com/xcong/excoin/modules/documentary/entity/FollowTraderInfoEntity.java
+++ b/src/main/java/com/xcong/excoin/modules/documentary/entity/FollowTraderInfoEntity.java
@@ -38,6 +38,10 @@
      */
     private String declaration;
     /**
+     * 标签
+     */
+    private String labels;
+    /**
      * 是否满员 1-是2-否
      */
     private Integer isAll;
diff --git a/src/main/java/com/xcong/excoin/modules/documentary/entity/FollowTraderLabelEntity.java b/src/main/java/com/xcong/excoin/modules/documentary/entity/FollowTraderLabelEntity.java
new file mode 100644
index 0000000..57a7e9a
--- /dev/null
+++ b/src/main/java/com/xcong/excoin/modules/documentary/entity/FollowTraderLabelEntity.java
@@ -0,0 +1,24 @@
+package com.xcong.excoin.modules.documentary.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.xcong.excoin.common.system.base.BaseEntity;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@EqualsAndHashCode(callSuper = true)
+@Data
+@TableName("follow_follower_profit")
+public class FollowTraderLabelEntity extends BaseEntity{
+	
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+	
+	/**
+     * 标签
+     */
+    private String labels;
+
+}
diff --git a/src/main/java/com/xcong/excoin/modules/documentary/service/DocumentaryService.java b/src/main/java/com/xcong/excoin/modules/documentary/service/DocumentaryService.java
index 859dc6a..f29bdcf 100644
--- a/src/main/java/com/xcong/excoin/modules/documentary/service/DocumentaryService.java
+++ b/src/main/java/com/xcong/excoin/modules/documentary/service/DocumentaryService.java
@@ -69,5 +69,7 @@
 
 	public Result getFollowFollowerNoticeList(@Valid FollowFollowerNoticeDto followFollowerNoticeDto);
 
+	public Result getTradeSetLabelInfo();
+
 
 }
diff --git a/src/main/java/com/xcong/excoin/modules/documentary/service/impl/DocumentaryServiceImpl.java b/src/main/java/com/xcong/excoin/modules/documentary/service/impl/DocumentaryServiceImpl.java
index cb4d891..23d1783 100644
--- a/src/main/java/com/xcong/excoin/modules/documentary/service/impl/DocumentaryServiceImpl.java
+++ b/src/main/java/com/xcong/excoin/modules/documentary/service/impl/DocumentaryServiceImpl.java
@@ -16,8 +16,10 @@
 import org.springframework.transaction.annotation.Transactional;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.taobao.api.internal.toplink.embedded.websocket.util.StringUtil;
 import com.xcong.excoin.common.LoginUserUtils;
 import com.xcong.excoin.common.response.Result;
 import com.xcong.excoin.modules.coin.dao.OrderCoinsDao;
@@ -32,6 +34,7 @@
 import com.xcong.excoin.modules.documentary.dao.FollowFollowerProfitDao;
 import com.xcong.excoin.modules.documentary.dao.FollowFollowerSettingDao;
 import com.xcong.excoin.modules.documentary.dao.FollowTraderInfoDao;
+import com.xcong.excoin.modules.documentary.dao.FollowTraderLabelDao;
 import com.xcong.excoin.modules.documentary.dao.FollowTraderProfitDetailDao;
 import com.xcong.excoin.modules.documentary.dao.FollowTraderProfitInfoDao;
 import com.xcong.excoin.modules.documentary.dto.CancelDocumentaryOrderSetDto;
@@ -51,6 +54,7 @@
 import com.xcong.excoin.modules.documentary.entity.FollowFollowerProfitEntity;
 import com.xcong.excoin.modules.documentary.entity.FollowFollowerSettingEntity;
 import com.xcong.excoin.modules.documentary.entity.FollowTraderInfoEntity;
+import com.xcong.excoin.modules.documentary.entity.FollowTraderLabelEntity;
 import com.xcong.excoin.modules.documentary.entity.FollowTraderProfitInfoEntity;
 import com.xcong.excoin.modules.documentary.service.DocumentaryService;
 import com.xcong.excoin.modules.documentary.vo.DocumentaryOrderInfoVo;
@@ -68,6 +72,7 @@
 import com.xcong.excoin.modules.documentary.vo.TradeOrderInfoVo;
 import com.xcong.excoin.modules.documentary.vo.TradeProfitInfoVo;
 import com.xcong.excoin.modules.documentary.vo.TradeSetInfoVo;
+import com.xcong.excoin.modules.documentary.vo.TradeSetLabelInfoVo;
 import com.xcong.excoin.modules.documentary.vo.TraderStatusVo;
 import com.xcong.excoin.modules.member.dao.MemberDao;
 import com.xcong.excoin.modules.member.dao.MemberLevelRateDao;
@@ -80,6 +85,7 @@
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
+import jnr.ffi.Struct.int16_t;
 import lombok.extern.slf4j.Slf4j;
 
 @Slf4j
@@ -116,6 +122,8 @@
     private FollowFollowerOrderRelationDao followFollowerOrderRelationDao;
     @Resource
     private FollowFollowerNoticeDao followFollowerNoticeDao;
+    @Resource
+    private FollowTraderLabelDao followTraderLabelDao;
     
 	
 	@Override
@@ -165,9 +173,38 @@
         		FollowTraderProfitInfoVo.setDeclaration(declaration);
         		Integer isAll = followTraderInfoEntity.getIsAll();
         		FollowTraderProfitInfoVo.setIsAll(isAll);
+        		
+        		String labels = followTraderInfoEntity.getLabels();
+        		if(StrUtil.isNotEmpty(labels)) {
+        			String labelsName = "";
+        			String[] split = labels.split(",");
+        			int length = split.length;
+        			for(int i = 0;i < length;i++) {
+        				String string = split[i];
+        				FollowTraderLabelEntity selectById = followTraderLabelDao.selectById(Long.parseLong(string));
+        				labelsName = selectById.getLabels();
+        				labelsName += (labelsName + ",");
+        			}
+        			FollowTraderProfitInfoVo.setLabels(labelsName);
+        		}
+        		
         	}
         }
 		return Result.ok(followTraderProfitInfoVoList);
+	}
+	
+	public static void main(String[] args) {
+		String labels = "";
+		if(StrUtil.isNotEmpty(labels)) {
+			String labelsName = "";
+			String[] split = labels.split(",");
+			int length = split.length;
+			for(int i = 0;i < length;i++) {
+				String string = split[i];
+				labelsName += (string + ",");
+			}
+			System.out.println(labelsName);
+		}
 	}
 
 	@Override
@@ -744,6 +781,20 @@
         tradeSetInfoVo.setDeclaration(declaration);
         Integer isOpen = followTraderInfoEntity.getIsOpen();
         tradeSetInfoVo.setIsOpen(isOpen);
+        
+        String labels = followTraderInfoEntity.getLabels();
+		if(StrUtil.isNotEmpty(labels)) {
+			String labelsName = "";
+			String[] split = labels.split(",");
+			int length = split.length;
+			for(int i = 0;i < length;i++) {
+				String string = split[i];
+				FollowTraderLabelEntity selectById = followTraderLabelDao.selectById(Long.parseLong(string));
+				labelsName = selectById.getLabels();
+				labelsName += (labelsName + ",");
+			}
+			tradeSetInfoVo.setLabels(labelsName);
+		}
 		return Result.ok(tradeSetInfoVo);
 	}
 
@@ -760,6 +811,8 @@
         String nickname = updateTradeSetInfoDto.getNickname();
         String declaration = updateTradeSetInfoDto.getDeclaration();
         int isOpen = updateTradeSetInfoDto.getIsOpen();
+        String labels = updateTradeSetInfoDto.getLabels();
+        followTraderInfoEntity.setLabels(labels);
         followTraderInfoEntity.setAvatar(avatar);
         followTraderInfoEntity.setNickname(nickname);
         followTraderInfoEntity.setDeclaration(declaration);
@@ -767,7 +820,7 @@
         followTraderInfoDao.updateById(followTraderInfoEntity);
 		return Result.ok(MessageSourceUtils.getString("member_service_0024"));
 	}
-
+	
 	@Override
 	public Result getTradeProfitInfo() {
 		//获取用户ID
@@ -1053,6 +1106,27 @@
         
 		return Result.ok(arrayList);
 	}
+
+	@Override
+	public Result getTradeSetLabelInfo() {
+		//获取用户ID
+        Long memberId = LoginUserUtils.getAppLoginUser().getId();
+        
+        Map<String, Object> columnMap = new HashMap<>();
+		List<FollowTraderLabelEntity> selectByMap = followTraderLabelDao.selectByMap(columnMap);
+		ArrayList<TradeSetLabelInfoVo> arrayList = new ArrayList<>();
+		if(CollUtil.isNotEmpty(selectByMap)) {
+			for(FollowTraderLabelEntity followTraderLabelEntity : selectByMap) {
+				TradeSetLabelInfoVo tradeSetLabelInfoVo = new TradeSetLabelInfoVo();
+				Long id = followTraderLabelEntity.getId();
+				String labels = followTraderLabelEntity.getLabels();
+				tradeSetLabelInfoVo.setId(id);
+				tradeSetLabelInfoVo.setLabels(labels);
+				arrayList.add(tradeSetLabelInfoVo);
+			}
+		}
+		return Result.ok(arrayList);
+	}
 	
 	
 	
diff --git a/src/main/java/com/xcong/excoin/modules/documentary/vo/FollowTraderProfitInfoVo.java b/src/main/java/com/xcong/excoin/modules/documentary/vo/FollowTraderProfitInfoVo.java
index 1aef5ca..1b24b68 100644
--- a/src/main/java/com/xcong/excoin/modules/documentary/vo/FollowTraderProfitInfoVo.java
+++ b/src/main/java/com/xcong/excoin/modules/documentary/vo/FollowTraderProfitInfoVo.java
@@ -72,6 +72,11 @@
      */
 	@ApiModelProperty("宣言")
     private String declaration;
+	/**
+	 * 标签
+	 */
+	@ApiModelProperty("标签")
+	private String labels;
     /**
      * 是否满员 1-是2-否
      */
diff --git a/src/main/java/com/xcong/excoin/modules/documentary/vo/TradeSetInfoVo.java b/src/main/java/com/xcong/excoin/modules/documentary/vo/TradeSetInfoVo.java
index 8d3722e..1f0d0a7 100644
--- a/src/main/java/com/xcong/excoin/modules/documentary/vo/TradeSetInfoVo.java
+++ b/src/main/java/com/xcong/excoin/modules/documentary/vo/TradeSetInfoVo.java
@@ -23,6 +23,9 @@
 	@ApiModelProperty("宣言")
 	private String declaration;
 	
+	@ApiModelProperty("标签")
+	private String labels;
+	
 	
 
 }
diff --git a/src/main/java/com/xcong/excoin/modules/documentary/vo/TradeSetLabelInfoVo.java b/src/main/java/com/xcong/excoin/modules/documentary/vo/TradeSetLabelInfoVo.java
new file mode 100644
index 0000000..29b0b58
--- /dev/null
+++ b/src/main/java/com/xcong/excoin/modules/documentary/vo/TradeSetLabelInfoVo.java
@@ -0,0 +1,17 @@
+package com.xcong.excoin.modules.documentary.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+@ApiModel(value = "TradeSetLabelInfoVo", description = "返回类")
+public class TradeSetLabelInfoVo {
+	
+	@ApiModelProperty(value = "ID")
+    private Long Id;
+    
+	@ApiModelProperty("标签")
+    private String labels;
+
+}
diff --git a/src/main/resources/mapper/documentary/FollowTraderLabelDao.xml b/src/main/resources/mapper/documentary/FollowTraderLabelDao.xml
new file mode 100644
index 0000000..7a0ef70
--- /dev/null
+++ b/src/main/resources/mapper/documentary/FollowTraderLabelDao.xml
@@ -0,0 +1,5 @@
+<?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.documentary.dao.FollowTraderLabelDao">
+	
+</mapper>
\ No newline at end of file

--
Gitblit v1.9.1