xiaoyong931011
2021-03-05 30e90f26c4d888502371fe21bdf6a724676015b0
20210304  跟单只允许跟一个交易员
1 files added
3 files modified
65 ■■■■■ changed files
src/main/java/com/xcong/excoin/modules/documentary/controller/DocumentaryController.java 14 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/documentary/service/DocumentaryService.java 2 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/documentary/service/impl/DocumentaryServiceImpl.java 32 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/documentary/vo/DocumentaryOrderSetStateVo.java 17 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/documentary/controller/DocumentaryController.java
@@ -24,6 +24,7 @@
import com.xcong.excoin.modules.documentary.service.DocumentaryService;
import com.xcong.excoin.modules.documentary.vo.DocumentaryOrderInfoVo;
import com.xcong.excoin.modules.documentary.vo.DocumentaryOrderSetInfoVo;
import com.xcong.excoin.modules.documentary.vo.DocumentaryOrderSetStateVo;
import com.xcong.excoin.modules.documentary.vo.FollowFollowerNoticeVo;
import com.xcong.excoin.modules.documentary.vo.FollowInfoVo;
import com.xcong.excoin.modules.documentary.vo.FollowRecordsVo;
@@ -166,6 +167,19 @@
    }
    
    /**
     *  跟单---跟单设置--是否已跟单
     */
    @ApiOperation(value="跟单---跟单设置--是否已跟单", notes="跟单---跟单设置--是否已跟单")
    @ApiResponses({@ApiResponse( code = 200, message = "success", response = DocumentaryOrderSetStateVo.class)})
    @ApiImplicitParams({
        @ApiImplicitParam(name = "tradeId", value = "交易员ID", required = true, dataType = "String", paramType="query")
    })
    @GetMapping(value = "/getDocumentaryOrderSetState")
    public Result  getDocumentaryOrderSetState(String tradeId) {
        return documentaryService.getDocumentaryOrderSetState(tradeId);
    }
    /**
     *  跟单---跟单设置--新增跟单
     */
    @ApiOperation(value="跟单---跟单设置--新增跟单", notes="跟单---跟单设置--新增跟单")
src/main/java/com/xcong/excoin/modules/documentary/service/DocumentaryService.java
@@ -77,5 +77,7 @@
    public Result beTraderCondition();
    public Result getDocumentaryOrderSetState(String tradeId);
}
src/main/java/com/xcong/excoin/modules/documentary/service/impl/DocumentaryServiceImpl.java
@@ -65,6 +65,7 @@
import com.xcong.excoin.modules.documentary.vo.BeTraderConditionVo;
import com.xcong.excoin.modules.documentary.vo.DocumentaryOrderInfoVo;
import com.xcong.excoin.modules.documentary.vo.DocumentaryOrderSetInfoVo;
import com.xcong.excoin.modules.documentary.vo.DocumentaryOrderSetStateVo;
import com.xcong.excoin.modules.documentary.vo.FollowFollowerNoticeVo;
import com.xcong.excoin.modules.documentary.vo.FollowInfoVo;
import com.xcong.excoin.modules.documentary.vo.FollowRecordsVo;
@@ -1265,6 +1266,37 @@
        List<BeTraderConditionVo> beTraderConditionVos = followTraderInfoDao.selectBeTraderCondition(type);
        return Result.ok(beTraderConditionVos);
    }
    @Override
    public Result getDocumentaryOrderSetState(String tradeId) {
        //获取用户ID
        Long memberId = LoginUserUtils.getAppLoginUser().getId();
        boolean OrderSetState = false;
        long parseLong = Long.parseLong(tradeId);
        //只能跟随一个人
        Map<String, Object> columnMaps = new HashMap<>();
        columnMaps.put("member_id", memberId);
        List<FollowFollowerSettingEntity> followFollowerSettingEntityAllows = followFollowerSettingDao.selectByMap(columnMaps);
        if(CollUtil.isEmpty(followFollowerSettingEntityAllows)) {
            OrderSetState = Boolean.TRUE;
        }else {
            if(followFollowerSettingEntityAllows.size() == 1) {
                Long tradeIdAllow = followFollowerSettingEntityAllows.get(0).getTraderId();
                if(parseLong == tradeIdAllow) {
                    OrderSetState = Boolean.TRUE;
                }
            }
        }
        DocumentaryOrderSetStateVo documentaryOrderSetStateVo = new DocumentaryOrderSetStateVo();
        if(OrderSetState) {
            documentaryOrderSetStateVo.setState(Boolean.TRUE);
        }else {
            documentaryOrderSetStateVo.setState(Boolean.FALSE);
        }
        return Result.ok(documentaryOrderSetStateVo);
    }
    
    
    
src/main/java/com/xcong/excoin/modules/documentary/vo/DocumentaryOrderSetStateVo.java
New file
@@ -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 = "DocumentaryOrderSetStateVo", description = "参数返回类")
public class DocumentaryOrderSetStateVo {
    /**
     * 内容
     */
    @ApiModelProperty("内容")
    private Boolean state;
}