Kaynağa Gözat

修复可以重复转化商机的错误

云殇忆 1 yıl önce
ebeveyn
işleme
99697c2c7b

+ 2 - 0
benyun-core/src/main/java/com/benyun/core/controller/WorkTableController.java

@@ -87,6 +87,8 @@ public class WorkTableController {
         int flag = attentionPoolService.turnBusinessOpportunities(turnVo, userId);
         if (flag == 1)
             return R.ok("转化成功!");
+        if (flag == 2)
+            return R.ok("已转化。");
         return R.fail("转化失败。");
     }
 

+ 4 - 0
benyun-core/src/main/java/com/benyun/core/service/impl/AttentionPoolServiceImpl.java

@@ -69,6 +69,10 @@ public class AttentionPoolServiceImpl implements AttentionPoolService {
         AttentionPool pool = attentionPoolDao.searchByAttentionIdAndUserId(turnVo.getAttentionId(), userId);
         if (pool == null)
             return 0;
+        BusinessOpportunitiesClue businessOpportunitiesClue = businessOpportunitiesDao.searchByClueIdOrAttentionIdAndUserId(null, turnVo.getAttentionId(), userId);
+        if (businessOpportunitiesClue != null){
+            return 2;
+        }
         BusinessOpportunitiesClue clue = new BusinessOpportunitiesClue();
         clue.setClueId(UUID.randomUUID().toString().replace("-",""));
         clue.setAttentionId(turnVo.getAttentionId());

+ 2 - 0
benyun-core/src/main/java/com/benyun/core/service/impl/BusinessOpportunitiesServiceImpl.java

@@ -67,6 +67,8 @@ public class BusinessOpportunitiesServiceImpl implements BusinessOpportunitiesSe
 
     @Override
     public int addFollow(AddFollowRecordVo addVo, String userId) {
+        if (addVo.getClueId() == null || addVo.getClueId().equals(""))
+            return 0;
         BusinessOpportunitiesClue clue = businessOpportunitiesDao.searchByClueIdOrAttentionIdAndUserId(addVo.getClueId(),null, userId);
         if (clue == null)
             return 0;