| | |
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.AdActivityVersionControl;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.AdActivityVersionControl.AdActivityType;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.CommonShareInfo;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.CommonShareInfo.CommonShareInfoEnum;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.Special;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SpecialExtra;
|
| | | import com.yeshi.fanli.entity.common.JumpDetailV2;
|
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum;
|
| | | import com.yeshi.fanli.exception.banner.SwiperPictureException;
|
| | |
| | | import com.yeshi.fanli.service.inter.config.AppVersionService;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.AdActivityVersionControlService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.CommonShareInfoService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.SpecialCardService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.SpecialExtraService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.SpecialPlaceService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.SpecialService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | |
| | | private SpecialCardService specialCardService;
|
| | |
|
| | | @Resource
|
| | | private SpecialExtraService specialExtraService;
|
| | | private CommonShareInfoService commonShareInfoService;
|
| | |
|
| | | @Resource
|
| | | private JumpDetailV2Service jumpDetailV2Service;
|
| | |
| | |
|
| | | @Override
|
| | | public void saveObject(MultipartFile file, MultipartFile file2, MultipartFile file3, Special record,
|
| | | String jumpType, SpecialExtra extra) throws SpecialException, Exception {
|
| | | String jumpType, CommonShareInfo shareInfo) throws SpecialException, Exception {
|
| | |
|
| | | Long cardId = record.getCardId();
|
| | | if (cardId == null) {
|
| | |
| | | record.setUpdatetime(new Date());
|
| | | specialMapper.insert(record);
|
| | |
|
| | | extra.setId(record.getId());
|
| | | shareInfo.setPid(record.getId());
|
| | |
|
| | | Special s = new Special();
|
| | | s.setId(record.getId());
|
| | |
| | | record.setUpdatetime(new Date());
|
| | | specialMapper.updateByPrimaryKey(record);
|
| | |
|
| | | extra.setId(record.getId());
|
| | | shareInfo.setPid(record.getId());
|
| | | }
|
| | |
|
| | | // 添加补充信息
|
| | | specialExtraService.saveExtraInfo(extra);
|
| | | shareInfo.setType(CommonShareInfoEnum.special);
|
| | | commonShareInfoService.save(shareInfo);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | if (!StringUtil.isNullOrEmpty(subPicture)) {
|
| | | COSManager.getInstance().deleteFile(subPicture);
|
| | | }
|
| | | |
| | | commonShareInfoService.deleteByPidAndType(special.getId(), CommonShareInfoEnum.special.name());
|
| | | }
|
| | |
|
| | | if (listSpecial != null)
|
| | |
| | | if (!StringUtil.isNullOrEmpty(subPicture)) {
|
| | | COSManager.getInstance().deleteFile(subPicture);
|
| | | }
|
| | | |
| | | commonShareInfoService.deleteByPidAndType(special.getId(), CommonShareInfoEnum.special.name());
|
| | | }
|
| | |
|
| | | return specialMapper.deleteBatchByCardID(list);
|
| | |
| | | specialVO.setJumpDetail(jumpDetailV2);
|
| | | }
|
| | |
|
| | | // 补充信息
|
| | | SpecialExtra extra = specialExtraService.selectByPrimaryKey(specialVO.getId());
|
| | | if (extra == null) {
|
| | | // 分享补充信息
|
| | | CommonShareInfo info = commonShareInfoService.getByPidAndType(specialVO.getId(),
|
| | | CommonShareInfoEnum.special.name());
|
| | | if (info == null) {
|
| | | specialVO.setNeedSpin(false);
|
| | | specialVO.setComment("");
|
| | | } else {
|
| | | specialVO.setNeedSpin(extra.getNeedSpin());
|
| | | if (StringUtil.isNullOrEmpty(extra.getComment())) {
|
| | | specialVO.setNeedSpin(info.getNeedSpin());
|
| | | if (StringUtil.isNullOrEmpty(info.getComment())) {
|
| | | specialVO.setComment("");
|
| | | } else {
|
| | | specialVO.setComment(extra.getComment());
|
| | | specialVO.setComment(info.getComment());
|
| | | }
|
| | | }
|
| | | |
| | | listvo.add(specialVO);
|
| | | }
|
| | | return listvo;
|
| | |
| | |
|
| | | @Override
|
| | | @Cacheable(value = "specialCache", key = "'listBySystemAndCard-'+#card+'-'+#systemId")
|
| | | public List<Special> listBySystemAndCard(String card, Long systemId) {
|
| | | return specialMapper.listBySystemAndCard(card, systemId);
|
| | | public List<SpecialVO> listBySystemAndCard(String card, Long systemId) {
|
| | | List<Special> specialList = specialMapper.listBySystemAndCard(card, systemId);
|
| | | return transformVO(specialList);
|
| | | }
|
| | |
|
| | | @Override
|
| | | @Cacheable(value = "specialCache", key = "'listPageBySystemAndCard-'+#start+'-'+#count+'-'+#card+'-'+#systemId")
|
| | | public List<Special> listPageBySystemAndCard(long start, int count, String card, Long systemId) {
|
| | | return specialMapper.listPageBySystemAndCard(start, count, card, systemId);
|
| | | public List<SpecialVO> listPageBySystemAndCard(long start, int count, String card, Long systemId) {
|
| | | List<Special> specialList = specialMapper.listPageBySystemAndCard(start, count, card, systemId);
|
| | | return transformVO(specialList);
|
| | | }
|
| | |
|
| | | @Override
|
| | | @Cacheable(value = "specialCache", key = "'listByVersion-'+#start+'-'+#count+'-'+#card+'-'+#platform+'-'+#versionCode")
|
| | | public List<Special> listByVersion(long start, int count, String card, String platform, Integer versionCode) {
|
| | | public List<SpecialVO> listByVersion(long start, int count, String card, String platform, Integer versionCode) {
|
| | | List<Special> specialList = specialMapper.listByPlaceKey(card, null, null, null);
|
| | | filterSpecial(specialList, platform, versionCode);
|
| | | return specialList;
|
| | | return transformVO(specialList);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | |
|
| | | // 数据处理
|
| | | // handlelist(listArc);
|
| | | arcMap.put("list", JsonUtil.getApiCommonGson().toJson(listArc));
|
| | | arcMap.put("list", JsonUtil.getApiCommonGson().toJson(transformVO(listArc)));
|
| | |
|
| | | // 首页-活动区域(女王节)
|
| | | JSONObject activityMap = new JSONObject();
|
| | |
| | |
|
| | | handlelist(listActivity);
|
| | |
|
| | | activityMap.put("list", JsonUtil.getApiCommonGson().toJson(listActivity));
|
| | | activityMap.put("list", JsonUtil.getApiCommonGson().toJson(transformVO(listActivity)));
|
| | |
|
| | | // 首页-方形专题(品牌券、母婴...)
|
| | | String indexBlock = "index_block";
|
| | |
| | |
|
| | | // 数据处理
|
| | | handlelist(listBlock);
|
| | | blockJsonMap.put("list", JsonUtil.getApiCommonGson().toJson(listBlock));
|
| | | blockJsonMap.put("list", JsonUtil.getApiCommonGson().toJson(transformVO(listBlock)));
|
| | |
|
| | | JSONObject root = new JSONObject();
|
| | | root.put("arcArea", arcMap);
|
| | |
| | |
|
| | | @Override
|
| | | @Cacheable(value = "specialCache", key = "'listByPlaceKeyHasLabel'+#start+'-'+#platform+'-'+#versionCode+'-'+#list")
|
| | | public List<Special> listByPlaceKeyHasLabel(long start, int count, List<String> list, Integer platform,
|
| | | public List<SpecialVO> listByPlaceKeyHasLabel(long start, int count, List<String> list, Integer platform,
|
| | | Integer versionCode) {
|
| | | return specialMapper.listByPlaceKeyHasLabel(start, count, list, null, platform, versionCode);
|
| | | List<Special> listSpecial = specialMapper.listByPlaceKeyHasLabel(start, count, list, null,
|
| | | platform, versionCode);
|
| | | return transformVO(listSpecial);
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 转换VO
|
| | | * @param list
|
| | | * @return
|
| | | */
|
| | | private List<SpecialVO> transformVO(List<Special> list) {
|
| | | List<SpecialVO> listVo = new ArrayList<SpecialVO>();
|
| | | if (list != null && list.size() > 0) {
|
| | | for (Special special: list) {
|
| | | SpecialVO specialVO = new SpecialVO();
|
| | | try {
|
| | | PropertyUtils.copyProperties(specialVO, special);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | continue;
|
| | | }
|
| | | |
| | | // 跳转活动过渡页
|
| | | CommonShareInfo info = commonShareInfoService.getByPidAndType(specialVO.getId(), |
| | | CommonShareInfoEnum.special.name());
|
| | | if (info != null && !StringUtil.isNullOrEmpty(info.getComment())) {
|
| | | String link = configService.get(ConfigKeyEnum.activityDetailLink.getKey()) + "?type=%s&id=%s";
|
| | | link = String.format(link, CommonShareInfoEnum.special.name(),specialVO.getId());
|
| | | |
| | | JSONObject params = new JSONObject();
|
| | | params.put("url", link);
|
| | | |
| | | specialVO.setComment(info.getComment());
|
| | | specialVO.setParams(params.toString());
|
| | | specialVO.setJumpDetail(jumpDetailV2Service.getByTypeCache("web"));
|
| | | }
|
| | | listVo.add(specialVO);
|
| | | }
|
| | | }
|
| | | return listVo;
|
| | | }
|
| | | |
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 处理 数据
|