yujian
2020-05-21 84b968d16a1f58dcd46aaa39d9593ef86189df04
添加活动名称
3个文件已修改
69 ■■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/admin/homemodule/SwiperBannerAdminController.java 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SwiperPictureServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/SwiperPictureService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/admin/homemodule/SwiperBannerAdminController.java
@@ -12,6 +12,7 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.beanutils.PropertyUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.multipart.MultipartHttpServletRequest;
@@ -337,70 +338,81 @@
        }
        try {
            List<BannerVO> list = swiperPictureService.queryByBannerID((pageIndex - 1) * pageSize, pageSize,
            List<SwiperPicture> listPic = swiperPictureService.queryByBannerID((pageIndex - 1) * pageSize, pageSize,
                    bannerId);
            if (list == null || list.size() == 0) {
            if (listPic == null || listPic.size() == 0) {
                JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
                return;
            }
            List<BannerVO> list = new ArrayList<BannerVO>();
            // 跳转链接
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm");
            for (BannerVO swiperPicture : list) {
                if (swiperPicture.getState() != null && swiperPicture.getState() == 0) {
                    swiperPicture.setState(1);
                } else {
                    swiperPicture.setState(0);
            for (SwiperPicture swiperPicture : listPic) {
                BannerVO bannerVO = new BannerVO();
                try {
                    PropertyUtils.copyProperties(bannerVO, swiperPicture);
                } catch (Exception e) {
                    e.printStackTrace();
                    continue;
                }
                
                
                Date startTime = swiperPicture.getStartTime();
                if (bannerVO.getState() != null && bannerVO.getState() == 0) {
                    bannerVO.setState(1);
                } else {
                    bannerVO.setState(0);
                }
                Date startTime = bannerVO.getStartTime();
                if (startTime == null) {
                    swiperPicture.setStartTime_str("");
                    bannerVO.setStartTime_str("");
                } else {
                    swiperPicture.setStartTime_str(sdf.format(startTime));
                    bannerVO.setStartTime_str(sdf.format(startTime));
                }
                Date endTime = swiperPicture.getEndTime();
                Date endTime = bannerVO.getEndTime();
                if (endTime == null) {
                    swiperPicture.setEndTime_str("");
                    bannerVO.setEndTime_str("");
                } else {
                    swiperPicture.setEndTime_str(sdf.format(endTime));
                    bannerVO.setEndTime_str(sdf.format(endTime));
                }
                String params = swiperPicture.getParams();
                String params = bannerVO.getParams();
                if (params == null) {
                    swiperPicture.setParams("");
                    bannerVO.setParams("");
                }
                String remark = swiperPicture.getRemark();
                String remark = bannerVO.getRemark();
                if (remark == null) {
                    swiperPicture.setRemark("");
                    bannerVO.setRemark("");
                }
                JumpDetailV2 jumpDetail = swiperPicture.getJumpDetail();
                JumpDetailV2 jumpDetail = bannerVO.getJumpDetail();
                if (jumpDetail == null) {
                    // 默认未选择
                    JumpDetailV2 jumpDetailV2 = new JumpDetailV2();
                    jumpDetailV2.setName("-未选择-");
                    jumpDetailV2.setType("default");
                    swiperPicture.setJumpDetail(jumpDetailV2);
                    bannerVO.setJumpDetail(jumpDetailV2);
                }
                
                // 分享补充信息
                CommonShareInfo info = commonShareInfoService.getByPidAndType(swiperPicture.getId(),
                CommonShareInfo info = commonShareInfoService.getByPidAndType(bannerVO.getId(),
                        CommonShareInfoEnum.banner.name());
                if (info == null) {
                    swiperPicture.setNeedSpin(false);
                    swiperPicture.setComment("");
                    bannerVO.setNeedSpin(false);
                    bannerVO.setComment("");
                } else {
                    swiperPicture.setNeedSpin(info.getNeedSpin());
                    bannerVO.setNeedSpin(info.getNeedSpin());
                    if (StringUtil.isNullOrEmpty(info.getComment())) {
                        swiperPicture.setComment("");
                        bannerVO.setComment("");
                    } else {
                        swiperPicture.setComment(info.getComment());
                        bannerVO.setComment(info.getComment());
                    }
                }
                list.add(bannerVO);
            }
            long count = swiperPictureService.countQueryByBannerID(bannerId);
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SwiperPictureServiceImpl.java
@@ -84,9 +84,8 @@
    }
    @Override
    public List<BannerVO> queryByBannerID(long start, int count, Long bannerId) throws SwiperPictureException {
        List<SwiperPicture> list = swiperPictureMapper.queryByBannerID(start, count, bannerId);
        return transformVO(list);
    public List<SwiperPicture> queryByBannerID(long start, int count, Long bannerId) throws SwiperPictureException {
        return swiperPictureMapper.queryByBannerID(start, count, bannerId);
    }
    @Override
fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/SwiperPictureService.java
@@ -28,7 +28,7 @@
     * @return
     * @throws SwiperPictureException
     */
    public List<BannerVO> queryByBannerID(long start, int count, Long bannerId) throws SwiperPictureException;
    public List<SwiperPicture> queryByBannerID(long start, int count, Long bannerId) throws SwiperPictureException;
    public long countQueryByBannerID(Long bannerId) throws SwiperPictureException;