xiaoyong931011
2020-08-06 5bf271bdaee169546ec97e583cd049160bbfc756
20200806 代码提交
1 files added
10 files modified
98 ■■■■ changed files
src/main/java/com/xcong/excoin/modules/documentary/controller/DocumentaryController.java 7 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/documentary/dao/FollowFollowerNoticeDao.java 8 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/documentary/dao/FollowTraderInfoDao.java 3 ●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/documentary/dto/FollowFollowerNoticeDto.java 20 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/documentary/service/DocumentaryService.java 4 ●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/documentary/service/impl/DocumentaryServiceImpl.java 31 ●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/documentary/vo/FollowFollowerNoticeVo.java 5 ●●●●● patch | view | raw | blame | history
src/main/resources/i18n/messages_en_US.properties 2 ●●●●● patch | view | raw | blame | history
src/main/resources/i18n/messages_zh_CN.properties 2 ●●●●● patch | view | raw | blame | history
src/main/resources/mapper/documentary/FollowFollowerNoticeDao.xml 14 ●●●●● patch | view | raw | blame | history
src/main/resources/mapper/documentary/FollowTraderInfoDao.xml 2 ●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/documentary/controller/DocumentaryController.java
@@ -14,6 +14,7 @@
import com.xcong.excoin.modules.coin.parameter.dto.RecordsPageDto;
import com.xcong.excoin.modules.documentary.dto.CancelDocumentaryOrderSetDto;
import com.xcong.excoin.modules.documentary.dto.DocumentaryOrderSetDto;
import com.xcong.excoin.modules.documentary.dto.FollowFollowerNoticeDto;
import com.xcong.excoin.modules.documentary.dto.FollowRecordsDto;
import com.xcong.excoin.modules.documentary.dto.HistoryOrderRecordsDto;
import com.xcong.excoin.modules.documentary.dto.MyFollowOrderDto;
@@ -65,8 +66,8 @@
    @ApiOperation(value="通知消息", notes="通知消息")
    @ApiResponses({@ApiResponse( code = 200, message = "success", response = FollowFollowerNoticeVo.class)})
    @PostMapping(value = "/getFollowFollowerNoticeList")
    public Result  getFollowFollowerNoticeList() {
        return documentaryService.getFollowFollowerNoticeList();
    public Result  getFollowFollowerNoticeList(@RequestBody @Valid FollowFollowerNoticeDto followFollowerNoticeDto) {
        return documentaryService.getFollowFollowerNoticeList(followFollowerNoticeDto);
    }
    
    /**
@@ -164,7 +165,7 @@
    }
    
    /**
     *  跟单---跟单设置
     *  跟单---跟单设置--新增跟单
     */
    @ApiOperation(value="跟单---跟单设置--新增跟单", notes="跟单---跟单设置--新增跟单")
    @PostMapping(value = "/addDocumentaryOrderSet")
src/main/java/com/xcong/excoin/modules/documentary/dao/FollowFollowerNoticeDao.java
@@ -1,10 +1,18 @@
package com.xcong.excoin.modules.documentary.dao;
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.documentary.entity.FollowFollowerNoticeEntity;
import org.apache.ibatis.annotations.Param;
/**
 * @author helius
 */
public interface FollowFollowerNoticeDao extends BaseMapper<FollowFollowerNoticeEntity> {
    IPage<FollowFollowerNoticeEntity> selectFollowFollowerNoticePage(Page<FollowFollowerNoticeEntity> page,
            @Param("record")FollowFollowerNoticeEntity followFollowerNoticeEntity);
}
src/main/java/com/xcong/excoin/modules/documentary/dao/FollowTraderInfoDao.java
@@ -2,8 +2,7 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xcong.excoin.modules.documentary.entity.FollowTraderInfoEntity;
import io.lettuce.core.dynamic.annotation.Param;
import org.apache.ibatis.annotations.Param;
public interface FollowTraderInfoDao extends BaseMapper<FollowTraderInfoEntity> {
src/main/java/com/xcong/excoin/modules/documentary/dto/FollowFollowerNoticeDto.java
New file
@@ -0,0 +1,20 @@
package com.xcong.excoin.modules.documentary.dto;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "FollowFollowerNoticeDto", description = "参数接受类")
public class FollowFollowerNoticeDto {
    @NotNull
    @Min(1)
    @ApiModelProperty(value = "第几页", example = "1")
    private int pageNum;
    @NotNull
    @ApiModelProperty(value = "每页数量", example = "10")
    private int pageSize;
}
src/main/java/com/xcong/excoin/modules/documentary/service/DocumentaryService.java
@@ -7,6 +7,7 @@
import com.xcong.excoin.modules.coin.parameter.dto.RecordsPageDto;
import com.xcong.excoin.modules.documentary.dto.CancelDocumentaryOrderSetDto;
import com.xcong.excoin.modules.documentary.dto.DocumentaryOrderSetDto;
import com.xcong.excoin.modules.documentary.dto.FollowFollowerNoticeDto;
import com.xcong.excoin.modules.documentary.dto.FollowRecordsDto;
import com.xcong.excoin.modules.documentary.dto.HistoryOrderRecordsDto;
import com.xcong.excoin.modules.documentary.dto.MyFollowOrderDto;
@@ -66,6 +67,7 @@
    public Result getOutFollowInfo(@Valid OutFollowInfoDto outFollowInfoDto);
    public Result getFollowFollowerNoticeList();
    public Result getFollowFollowerNoticeList(@Valid FollowFollowerNoticeDto followFollowerNoticeDto);
}
src/main/java/com/xcong/excoin/modules/documentary/service/impl/DocumentaryServiceImpl.java
@@ -35,6 +35,7 @@
import com.xcong.excoin.modules.documentary.dao.FollowTraderProfitInfoDao;
import com.xcong.excoin.modules.documentary.dto.CancelDocumentaryOrderSetDto;
import com.xcong.excoin.modules.documentary.dto.DocumentaryOrderSetDto;
import com.xcong.excoin.modules.documentary.dto.FollowFollowerNoticeDto;
import com.xcong.excoin.modules.documentary.dto.FollowRecordsDto;
import com.xcong.excoin.modules.documentary.dto.HistoryOrderRecordsDto;
import com.xcong.excoin.modules.documentary.dto.MyFollowOrderDto;
@@ -455,7 +456,7 @@
        FollowTraderInfoEntity traderInfoEntity = followTraderInfoDao.selectTraderInfoByMemberId(memberId);
        if (traderInfoEntity != null) {
            return Result.fail("交易员不能进行跟单");
            return Result.fail(MessageSourceUtils.getString("documentary_service_0014"));
        }
        FollowFollowerSettingEntity isExistSetting = followFollowerSettingDao.selectOneBymemberIdAndTradeId(memberId, traderId);
@@ -649,6 +650,14 @@
        List<FollowFollowerProfitEntity> followFollowerProfitEntitys = followFollowerProfitDao.selectByMap(columnMaps);
        if(CollUtil.isNotEmpty(followFollowerProfitEntitys)) {
            return Result.fail(MessageSourceUtils.getString("documentary_service_0015"));
        }
        //合约不能持仓
        Map<String, Object> contractHoldColumnMap = new HashMap<>();
        contractHoldColumnMap.put("member_id", memberId);
        List<ContractHoldOrderEntity> contractHoldOrderEntitys = contractHoldOrderDao.selectByMap(contractHoldColumnMap);
        if(CollUtil.isNotEmpty(contractHoldOrderEntitys)) {
            return Result.fail(MessageSourceUtils.getString("documentary_service_0013"));
        }
        
        Map<String, Object> columnMap = new HashMap<>();
@@ -997,21 +1006,25 @@
    }
    @Override
    public Result getFollowFollowerNoticeList() {
    public Result getFollowFollowerNoticeList(FollowFollowerNoticeDto followFollowerNoticeDto) {
        //获取用户ID
        Long memberId = LoginUserUtils.getAppLoginUser().getId();
        List<FollowFollowerNoticeVo> arrayList = new ArrayList<>();
        
        Map<String, Object> columnMap = new HashMap<>();
        columnMap.put("member_id", memberId);
        List<FollowFollowerNoticeEntity> selectByMap = followFollowerNoticeDao.selectByMap(columnMap );
        if(CollUtil.isNotEmpty(selectByMap)) {
            for(FollowFollowerNoticeEntity followFollowerNoticeEntity : selectByMap) {
        Page<FollowFollowerNoticeEntity> page = new Page<>(followFollowerNoticeDto.getPageNum(), followFollowerNoticeDto.getPageSize());
        FollowFollowerNoticeEntity followFollowerNoticeEntity = new FollowFollowerNoticeEntity();
        followFollowerNoticeEntity.setMemberId(memberId);
        IPage<FollowFollowerNoticeEntity> followFollowerNoticelist = followFollowerNoticeDao.selectFollowFollowerNoticePage(page, followFollowerNoticeEntity);
        List<FollowFollowerNoticeEntity> records = followFollowerNoticelist.getRecords();
        if(CollUtil.isNotEmpty(records)) {
            for(FollowFollowerNoticeEntity followFollowerNotice : records) {
                FollowFollowerNoticeVo followFollowerNoticeVo = new FollowFollowerNoticeVo();
                String title = followFollowerNoticeEntity.getTitle();
                String title = followFollowerNotice.getTitle();
                followFollowerNoticeVo.setTitle(title);
                String content = followFollowerNoticeEntity.getContent();
                String content = followFollowerNotice.getContent();
                followFollowerNoticeVo.setContent(content);
                Date createTime = followFollowerNotice.getCreateTime();
                followFollowerNoticeVo.setCreateTime(createTime);
                arrayList.add(followFollowerNoticeVo);
            }
        }
src/main/java/com/xcong/excoin/modules/documentary/vo/FollowFollowerNoticeVo.java
@@ -1,5 +1,7 @@
package com.xcong.excoin.modules.documentary.vo;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -8,6 +10,9 @@
@ApiModel(value = "FollowFollowerNoticeVo", description = "返回值")
public class FollowFollowerNoticeVo {
    
    @ApiModelProperty("时间")
    private Date createTime;
    @ApiModelProperty("标题")
    private String title;
    
src/main/resources/i18n/messages_en_US.properties
@@ -223,6 +223,8 @@
home_service_0013=Modification succeeded, please log in
home_service_0014=The mobile number does not exist, please register and log in
documentary_service_0013=Please close the position after applying
documentary_service_0014=The current status cannot be followed
documentary_service_0015=Please cancel and apply again
uploadFile_controller_0001=Upload failed
src/main/resources/i18n/messages_zh_CN.properties
@@ -223,6 +223,8 @@
home_service_0013=修改成功,请登录
home_service_0014=不存在该手机号码,请进行注册登录
documentary_service_0013=请平仓后,在申请
documentary_service_0014=当前状态不能进行跟单
documentary_service_0015=当前有跟单,请取消再申请
uploadFile_controller_0001=上传失败
src/main/resources/mapper/documentary/FollowFollowerNoticeDao.xml
@@ -1,5 +1,17 @@
<?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.FollowFollowerNoticeDao">
    <select id="selectFollowFollowerNoticePage" resultType="com.xcong.excoin.modules.documentary.entity.FollowFollowerNoticeEntity">
        select
            *
        from follow_follower_notice
        <if test="record != null">
            <where>
                <if test="record.memberId != null" >
                    and member_id=#{record.memberId}
                </if>
            </where>
        </if>
        order by create_time desc
    </select>
</mapper>
src/main/resources/mapper/documentary/FollowTraderInfoDao.xml
@@ -8,7 +8,7 @@
    <select id="selectTraderInfoByMemberId" resultType="com.xcong.excoin.modules.documentary.entity.FollowTraderInfoEntity">
        select * from follow_trader_info where member_id=#{memberId}
        select * from follow_trader_info where member_id=#{memberId} and verify_status in (1,3)
    </select>