admin
2020-06-28 eda623f37c3260f4b4657e34a8a39798c72432b1
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java
@@ -661,7 +661,7 @@
      
      
      if (VersionUtil.greaterThan_2_1_2(acceptData.getPlatform(), acceptData.getVersion())) {
         getCloudInfo(acceptData, goodsDetail, extraVO);  // 云发单文案信息
         getCloudInfo(acceptData, uid, goodsDetail, extraVO);  // 云发单文案信息
      }
      
      JSONObject object = new JSONObject();
@@ -883,7 +883,7 @@
      extraVO.setShare(shareInfoVO);
      
      if (VersionUtil.greaterThan_2_1_2(acceptData.getPlatform(), acceptData.getVersion())) {
         getCloudInfo(acceptData, goodsDetail, extraVO);  // 云发单文案信息
         getCloudInfo(acceptData, uid, goodsDetail, extraVO);  // 云发单文案信息
      }
      JSONObject object = new JSONObject();
@@ -1072,7 +1072,7 @@
      }
      
      if (VersionUtil.greaterThan_2_1_2(acceptData.getPlatform(), acceptData.getVersion())) {
         getCloudInfo(acceptData, goodsDetail, extraVO); // 云发单文案信息
         getCloudInfo(acceptData, uid, goodsDetail, extraVO); // 云发单文案信息
      }
      JSONObject object = new JSONObject();
@@ -1211,7 +1211,7 @@
      extraVO.setShare(shareInfoVO);
      
      // 云发单文案信息
      getCloudInfo(acceptData, goodsDetail, extraVO);
      getCloudInfo(acceptData, uid, goodsDetail, extraVO);
      JSONObject object = new JSONObject();
      object.put("extra", JsonUtil.getApiCommonGson().toJson(extraVO));
@@ -1345,7 +1345,7 @@
      extraVO.setShare(shareInfoVO);
      // 云发单文案信息
      getCloudInfo(acceptData, goodsDetail, extraVO);
      getCloudInfo(acceptData, uid, goodsDetail, extraVO);
            
      JSONObject object = new JSONObject();
      object.put("extra", JsonUtil.getApiCommonGson().toJson(extraVO));
@@ -1374,16 +1374,19 @@
    *    // 云发单文案信息
    * @param goodsDetail
    */
   private void getCloudInfo(AcceptData acceptData, GoodsDetailVO goodsDetail, GoodsDetailExtraVO extraVO) {
   private void getCloudInfo(AcceptData acceptData,Long uid, GoodsDetailVO goodsDetail, GoodsDetailExtraVO extraVO) {
      // 云发单是否开启
      String cloudState = configService.getByVersion(ConfigKeyEnum.robotCloudOpen.getKey(), acceptData.getPlatform(),
            Integer.parseInt(acceptData.getVersion()));
      if (!StringUtil.isNullOrEmpty(cloudState) && "1".equals(cloudState)) {
         extraVO.setCloudOpen(true);
      boolean cloudOpen = configService.isRobotCloudOpen(ConfigKeyEnum.robotCloudOpenGoodsDetail.getKey());
      if (!cloudOpen && uid != null) {
         List<String> testUsers = configService.getTestUsers();
         if (testUsers != null && testUsers.contains(uid+"")) {
            cloudOpen = true;
         }
      }
      extraVO.setCloudOpen(cloudOpen);
      
      if (!goodsDetail.isHasCoupon()) {
      // 无券或者未开启发圈
      if (!goodsDetail.isHasCoupon() || !cloudOpen) {
         return;
      }
      
@@ -1407,6 +1410,16 @@
         }
         
         if (!StringUtil.isNullOrEmpty(cloudText) && !StringUtil.isNullOrEmpty(cloudPic)) {
            cloudText = cloudText.replace("[原价]", MoneyBigDecimalUtil.getWithNoZera(goodsDetail.getZkPrice()) + "");
            if (!goodsDetail.isHasCoupon()) {
               cloudText = cloudText.replace("领券抢购", "抢购");
               cloudText = cloudText.replace("【券后价】[券后价]元", "");
            } else {
               cloudText = cloudText.replace("[券后价]", MoneyBigDecimalUtil.getWithNoZera(goodsDetail.getCouponPrice()) + "");
            }
            cloudText = cloudText.replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n");
            extraVO.setCloudPic(cloudPic);
            extraVO.setCloudText(cloudText);
         }