| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.apache.commons.beanutils.PropertyUtils;
|
| | | import org.springframework.cache.annotation.Cacheable;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
| | | import com.yeshi.fanli.entity.bus.homemodule.AdActivityVersionControl;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.AdActivityVersionControl.AdActivityType;
|
| | | 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.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.AdActivityVersionControlService;
|
| | | 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;
|
| | | import com.yeshi.fanli.util.FilePathEnum;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | | import com.yeshi.fanli.vo.homemodule.SpecialVO;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | |
| | | @Resource
|
| | | private SpecialCardService specialCardService;
|
| | |
|
| | | @Resource
|
| | | private SpecialExtraService specialExtraService;
|
| | | |
| | | @Resource
|
| | | private JumpDetailV2Service jumpDetailV2Service;
|
| | |
|
| | |
| | |
|
| | | @Override
|
| | | public void saveObject(MultipartFile file, MultipartFile file2, MultipartFile file3, Special record,
|
| | | String jumpType) throws SpecialException, Exception {
|
| | | String jumpType, SpecialExtra extra) throws SpecialException, Exception {
|
| | |
|
| | | Long cardId = record.getCardId();
|
| | | if (cardId == null) {
|
| | |
| | | record.setUpdatetime(new Date());
|
| | | specialMapper.insert(record);
|
| | |
|
| | | extra.setId(record.getId());
|
| | | |
| | | Special s = new Special();
|
| | | s.setId(record.getId());
|
| | | s.setOrderby(Integer.parseInt(s.getId() + ""));
|
| | |
| | |
|
| | | record.setUpdatetime(new Date());
|
| | | specialMapper.updateByPrimaryKey(record);
|
| | | |
| | | extra.setId(record.getId());
|
| | | }
|
| | | |
| | | // 添加补充信息
|
| | | specialExtraService.saveExtraInfo(extra);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Special> listQueryByCard(long start, int count, Long card, String key, Integer sex) {
|
| | |
|
| | | public List<SpecialVO> listQueryByCard(long start, int count, Long card, String key, Integer sex) {
|
| | | List<Special> list = specialMapper.listQueryByCard(start, count, card, key, sex);
|
| | | if (list == null || list.size() == 0) {
|
| | | return list;
|
| | | if (list == null) {
|
| | | return null;
|
| | | }
|
| | |
|
| | | // 跳转链接
|
| | | List<SpecialVO> listvo = new ArrayList<SpecialVO>();
|
| | | for (Special special : list) {
|
| | | if (special.getState() != null && special.getState().longValue() == 0) {
|
| | | special.setState(1L);
|
| | | } else {
|
| | | special.setState(0L);
|
| | | SpecialVO specialVO = new SpecialVO();
|
| | | try {
|
| | | PropertyUtils.copyProperties(specialVO, special);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | continue;
|
| | | }
|
| | |
|
| | | Date startTime = special.getStartTime();
|
| | | Date endTime = special.getEndTime();
|
| | | if (specialVO.getState() != null && specialVO.getState().longValue() == 0) {
|
| | | specialVO.setState(1L);
|
| | | } else {
|
| | | specialVO.setState(0L);
|
| | | }
|
| | | |
| | | Date startTime = specialVO.getStartTime();
|
| | | Date endTime = specialVO.getEndTime();
|
| | | if (startTime == null && endTime == null) {
|
| | | special.setStartTime_str("");
|
| | | special.setEndTime_str("");
|
| | | specialVO.setStartTime_str("");
|
| | | specialVO.setEndTime_str("");
|
| | | } else {
|
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm");
|
| | | if (startTime == null) {
|
| | | special.setStartTime_str("");
|
| | | specialVO.setStartTime_str("");
|
| | | } else {
|
| | | special.setStartTime_str(sdf.format(startTime));
|
| | | specialVO.setStartTime_str(sdf.format(startTime));
|
| | | }
|
| | |
|
| | | if (endTime == null) {
|
| | | special.setEndTime_str("");
|
| | | specialVO.setEndTime_str("");
|
| | | } else {
|
| | | special.setEndTime_str(sdf.format(endTime));
|
| | | specialVO.setEndTime_str(sdf.format(endTime));
|
| | | }
|
| | | }
|
| | |
|
| | | String params = special.getParams();
|
| | | String params = specialVO.getParams();
|
| | | if (StringUtil.isNullOrEmpty(params)) {
|
| | | special.setParams("");
|
| | | specialVO.setParams("");
|
| | | }
|
| | |
|
| | | String remark = special.getRemark();
|
| | | String remark = specialVO.getRemark();
|
| | | if (StringUtil.isNullOrEmpty(remark)) {
|
| | | special.setRemark("");
|
| | | specialVO.setRemark("");
|
| | | }
|
| | |
|
| | | JumpDetailV2 jumpDetail = special.getJumpDetail();
|
| | | JumpDetailV2 jumpDetail = specialVO.getJumpDetail();
|
| | | if (jumpDetail == null) {
|
| | | // 默认未选择
|
| | | JumpDetailV2 jumpDetailV2 = new JumpDetailV2();
|
| | | jumpDetailV2.setName("-未选择-");
|
| | | jumpDetailV2.setType("default");
|
| | | special.setJumpDetail(jumpDetailV2);
|
| | | specialVO.setJumpDetail(jumpDetailV2);
|
| | | }
|
| | | |
| | | // 补充信息
|
| | | SpecialExtra extra = specialExtraService.selectByPrimaryKey(specialVO.getId());
|
| | | if (extra == null) {
|
| | | specialVO.setNeedSpin(false);
|
| | | specialVO.setComment("");
|
| | | } else {
|
| | | specialVO.setNeedSpin(extra.getNeedSpin());
|
| | | if (StringUtil.isNullOrEmpty(extra.getComment())) {
|
| | | specialVO.setComment("");
|
| | | } else {
|
| | | specialVO.setComment(extra.getComment());
|
| | | }
|
| | | }
|
| | | |
| | | listvo.add(specialVO);
|
| | | }
|
| | | return list;
|
| | | return listvo;
|
| | | }
|
| | |
|
| | | @Override
|