| | |
| | |
|
| | | 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;
|
| | |
| | | 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;
|
| | |
|
| | |
| | |
|
| | | @Resource
|
| | | private ConfigService configService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private AppVersionService appVersionService;
|
| | | |
| | |
|
| | | @Override
|
| | | public Special selectByPrimaryKey(Long id) {
|
| | |
| | | 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();
|
| | |
| | | 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 {
|
| | |
| | | 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";
|
| | |
| | | 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());
|
| | | }
|
| | | }
|
| | | }
|