admin
2019-09-09 0922bfdb56bc30125d6fc8e13c50cdda7cd9dc72
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialServiceImpl.java
@@ -18,7 +18,6 @@
import com.yeshi.fanli.dao.mybatis.homemodule.SpecialMapper;
import com.yeshi.fanli.dto.common.CommonContentTypeEnum;
import com.yeshi.fanli.entity.AppVersionInfo;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.homemodule.Special;
import com.yeshi.fanli.entity.common.JumpDetailV2;
@@ -29,7 +28,6 @@
import com.yeshi.fanli.service.inter.homemodule.SpecialCardService;
import com.yeshi.fanli.service.inter.homemodule.SpecialPlaceService;
import com.yeshi.fanli.service.inter.homemodule.SpecialService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.VersionUtil;
@@ -52,10 +50,9 @@
   @Resource
   private ConfigService configService;
   @Resource
   private AppVersionService appVersionService;
   @Override
   public Special selectByPrimaryKey(Long id) {
@@ -79,26 +76,6 @@
      Integer sex = record.getSex();
      if (sex == null) {
         throw new SpecialException(1, "性别不能为空");
      }
      String version = record.getVersion();
      Integer platformCode = record.getPlatform();
      if (!StringUtil.isNullOrEmpty(version) && platformCode != null) {
         String platform = "android";
         if (platformCode == 2)
            platform = "ios";
         AppVersionInfo versionInfo = appVersionService.getByPlatformAndVersion(platform, version);
         if (versionInfo == null)
            throw new SpecialException(1, "版本号信息缺失");
         record.setVersionCode(versionInfo.getVersionCode());
         record.setPlatform(platformCode);
      } else {
         if (!StringUtil.isNullOrEmpty(version))
            throw new SpecialException(1, "平台类型不能为空");
         if (platformCode != null)
            throw new SpecialException(1, "版本号不能为空");
      }
      String params = record.getParams();
@@ -396,8 +373,7 @@
   public List<Special> listByVersion(long start, int count, String card, Integer platform, Integer versionCode) {
      return specialMapper.listByVersion(start, count, card, platform, versionCode);
   }
   @Override
   @Cacheable(value = "specialCache", key = "'listCacheSpecialToIndex'+#acceptData.platform+'-'+#acceptData.version+'-'+#sex")
   public JSONObject listCacheSpecialToIndex(AcceptData acceptData, Integer sex) throws Exception {
@@ -406,7 +382,9 @@
      JSONObject arcMap = new JSONObject();
      String indexArc = "index_arc";
      if (VersionUtil.greaterThan_1_6_0(acceptData.getPlatform(), acceptData.getVersion()))
      if (VersionUtil.greaterThan_1_6_5(acceptData.getPlatform(), acceptData.getVersion()))
         indexArc = "index_arc_1.6.5";
      else if (VersionUtil.greaterThan_1_6_0(acceptData.getPlatform(), acceptData.getVersion()))
         indexArc = "index_arc_1.6.0";
      else if (VersionUtil.greaterThan_1_5_70(acceptData.getPlatform(), acceptData.getVersion()))
         indexArc = "index_arc_1.5.7";
@@ -442,8 +420,10 @@
                  params.put("url", configService.get("tlj_own_buy_nogoods"));
                  s.setParams(params.toString());
               } else {
                  s.setJumpDetail(jumpDetailV2Service.getByTypeCache("tlj_own_buy"));
                  s.setParams(null);
                  // 查询专题详情
                  Special special = specialMapper.selectByPrimaryKey(s.getId());
                  s.setJumpDetail(special.getJumpDetail());
                  s.setParams(special.getParams());
               }
            }
         }