|
@@ -2,7 +2,6 @@ package com.benyun.core.controller;
|
|
|
|
|
|
import com.benyun.core.entity.bo.AttentionPoolBo;
|
|
|
import com.benyun.core.entity.bo.AttentionPoolStatisticsBo;
|
|
|
-import com.benyun.core.entity.bo.FollowUpRecordBo;
|
|
|
import com.benyun.core.entity.vo.AddFollowRecordVo;
|
|
|
import com.benyun.core.entity.vo.TurnBusinessOpportunitiesVo;
|
|
|
import com.benyun.core.entity.vo.WorkTableSearchVo;
|
|
@@ -34,9 +33,9 @@ public class WorkTableController {
|
|
|
@GetMapping("/databack/about")
|
|
|
public R about(){
|
|
|
// 获取用户id
|
|
|
- String userId = null;
|
|
|
-// if (userId == null || userId.equals(""))
|
|
|
-// return R.fail("请登录");
|
|
|
+ String userId = "1";
|
|
|
+ if (userId == null || userId.equals(""))
|
|
|
+ return R.fail("请登录");
|
|
|
AttentionPoolStatisticsBo bo = databackService.searchAbout(userId);
|
|
|
return R.ok(bo);
|
|
|
}
|
|
@@ -45,9 +44,9 @@ public class WorkTableController {
|
|
|
@GetMapping("/databack/trend")
|
|
|
public R trend(){
|
|
|
// 获取用户id
|
|
|
- String userId = null;
|
|
|
-// if (userId == null || userId.equals(""))
|
|
|
-// return R.fail("请登录");
|
|
|
+ String userId = "1";
|
|
|
+ if (userId == null || userId.equals(""))
|
|
|
+ return R.fail("请登录");
|
|
|
List<AttentionPoolStatisticsBo> bos = databackService.searchTrand(userId);
|
|
|
return R.ok(bos);
|
|
|
}
|
|
@@ -56,9 +55,9 @@ public class WorkTableController {
|
|
|
@GetMapping("/pool/list")
|
|
|
public R poolList(WorkTableSearchVo workTableSearchVo){
|
|
|
// 获取用户id
|
|
|
- String userId = null;
|
|
|
-// if (userId == null || userId.equals(""))
|
|
|
-// return R.fail("请登录");
|
|
|
+ String userId = "1";
|
|
|
+ if (userId == null || userId.equals(""))
|
|
|
+ return R.fail("请登录");
|
|
|
PageInfo<List<AttentionPoolBo>> listPageInfo = attentionPoolService.searchList(workTableSearchVo, userId);
|
|
|
return R.ok(listPageInfo);
|
|
|
}
|
|
@@ -67,9 +66,9 @@ public class WorkTableController {
|
|
|
@DeleteMapping("/pool")
|
|
|
public R cancel(String attentionId){
|
|
|
// 获取用户id
|
|
|
- String userId = null;
|
|
|
-// if (userId == null || userId.equals(""))
|
|
|
-// return R.fail("请登录");
|
|
|
+ String userId = "1";
|
|
|
+ if (userId == null || userId.equals(""))
|
|
|
+ return R.fail("请登录");
|
|
|
if (attentionId == null || attentionId.equals(""))
|
|
|
return R.fail("attentionId不能为空");
|
|
|
int flag = attentionPoolService.cancelAttention(attentionId, userId);
|
|
@@ -82,9 +81,9 @@ public class WorkTableController {
|
|
|
@PostMapping("/pool")
|
|
|
public R turn(TurnBusinessOpportunitiesVo turnVo){
|
|
|
// 获取用户id
|
|
|
- String userId = null;
|
|
|
-// if (userId == null || userId.equals(""))
|
|
|
-// return R.fail("请登录");
|
|
|
+ String userId = "1";
|
|
|
+ if (userId == null || userId.equals(""))
|
|
|
+ return R.fail("请登录");
|
|
|
int flag = attentionPoolService.turnBusinessOpportunities(turnVo, userId);
|
|
|
if (flag == 1)
|
|
|
return R.ok("转化成功!");
|
|
@@ -95,9 +94,9 @@ public class WorkTableController {
|
|
|
@GetMapping("/clue/list")
|
|
|
public R clueList(WorkTableSearchVo vo){
|
|
|
// 获取用户id
|
|
|
- String userId = null;
|
|
|
-// if (userId == null || userId.equals(""))
|
|
|
-// return R.fail("请登录");
|
|
|
+ String userId = "1";
|
|
|
+ if (userId == null || userId.equals(""))
|
|
|
+ return R.fail("请登录");
|
|
|
return R.ok(businessOpportunitiesService.searchList(vo,userId));
|
|
|
}
|
|
|
|
|
@@ -105,9 +104,9 @@ public class WorkTableController {
|
|
|
@GetMapping("/follow/list")
|
|
|
public R followList(WorkTableSearchVo vo){
|
|
|
// 获取用户id
|
|
|
- String userId = null;
|
|
|
-// if (userId == null || userId.equals(""))
|
|
|
-// return R.fail("请登录");
|
|
|
+ String userId = "1";
|
|
|
+ if (userId == null || userId.equals(""))
|
|
|
+ return R.fail("请登录");
|
|
|
return R.ok(businessOpportunitiesService.searchFollowList(vo,userId));
|
|
|
}
|
|
|
|
|
@@ -115,12 +114,72 @@ public class WorkTableController {
|
|
|
@PostMapping("/follow")
|
|
|
public R followAdd(AddFollowRecordVo addVo){
|
|
|
// 获取用户id
|
|
|
- String userId = null;
|
|
|
-// if (userId == null || userId.equals(""))
|
|
|
-// return R.fail("请登录");
|
|
|
+ String userId = "1";
|
|
|
+ if (userId == null || userId.equals(""))
|
|
|
+ return R.fail("请登录");
|
|
|
int flag = businessOpportunitiesService.addFollow(addVo, userId);
|
|
|
if (flag == 1)
|
|
|
return R.ok("添加成功!");
|
|
|
return R.fail("添加失败");
|
|
|
}
|
|
|
+
|
|
|
+ // 品牌关注
|
|
|
+ @PostMapping("/brand")
|
|
|
+ public R brandAttention(String brandId){
|
|
|
+ String userId = "1";
|
|
|
+ if (userId == null || userId.equals(""))
|
|
|
+ return R.fail("请登录");
|
|
|
+ int flag = attentionPoolService.attentionBrand(brandId, userId);
|
|
|
+ if (flag == 1){
|
|
|
+ return R.ok("关注成功!");
|
|
|
+ }else if (flag == 2){
|
|
|
+ return R.fail("重复关注。");
|
|
|
+ }else if (flag == 3){
|
|
|
+ return R.fail("未知品牌");
|
|
|
+ }
|
|
|
+ return R.fail("关注失败。");
|
|
|
+ }
|
|
|
+
|
|
|
+ // 品牌取消关注
|
|
|
+ @DeleteMapping("/brand")
|
|
|
+ public R brandCancel(String brandId){
|
|
|
+ String userId = "1";
|
|
|
+ if (userId == null || userId.equals(""))
|
|
|
+ return R.fail("请登录");
|
|
|
+ int flag = attentionPoolService.cancelBrand(brandId, userId);
|
|
|
+ if (flag == 1){
|
|
|
+ return R.ok("取消关注成功!");
|
|
|
+ }
|
|
|
+ return R.fail("取消关注失败。");
|
|
|
+ }
|
|
|
+
|
|
|
+// 网点关注
|
|
|
+ @PostMapping("/wdInfo")
|
|
|
+ public R wdInfoAttention(String wdId){
|
|
|
+ String userId = "1";
|
|
|
+ if (userId == null || userId.equals(""))
|
|
|
+ return R.fail("请登录");
|
|
|
+ int flag = attentionPoolService.attentionWdInfo(wdId,userId);
|
|
|
+ if (flag == 1){
|
|
|
+ return R.ok("关注成功!");
|
|
|
+ }else if (flag == 2){
|
|
|
+ return R.fail("重复关注。");
|
|
|
+ }else if (flag == 3){
|
|
|
+ return R.fail("未知网点");
|
|
|
+ }
|
|
|
+ return R.fail("关注失败。");
|
|
|
+ }
|
|
|
+
|
|
|
+// 网点取消关注
|
|
|
+ @DeleteMapping("/wdInfo")
|
|
|
+ public R wdInfoCancel(String wdId){
|
|
|
+ String userId = "1";
|
|
|
+ if (userId == null || userId.equals(""))
|
|
|
+ return R.fail("请登录");
|
|
|
+ int flag = attentionPoolService.cancelWdInfo(wdId, userId);
|
|
|
+ if (flag == 1){
|
|
|
+ return R.ok("取消关注成功!");
|
|
|
+ }
|
|
|
+ return R.fail("取消关注失败。");
|
|
|
+ }
|
|
|
}
|