| | |
| | | } |
| | | // 将DTO中的属性值复制到横幅对象中 |
| | | BeanUtils.copyProperties(mgtBannerEditDto, banner); |
| | | if(banner.getTargetType()==1){ |
| | | //外链 |
| | | if (banner.getLinkType()==1){ |
| | | //外链-链接 |
| | | banner.setJumpType(null); |
| | | banner.setJumpId(null); |
| | | banner.setAppid(null); |
| | | }else{ |
| | | //外链-小程序 |
| | | banner.setJumpType(null); |
| | | banner.setJumpId(null); |
| | | } |
| | | }else if(banner.getTargetType()==2){ |
| | | if(banner.getLinkType()==1){ |
| | | banner.setJumpType(null); |
| | | banner.setJumpId(null); |
| | | }else{ |
| | | banner.setLinkUrl(null); |
| | | } |
| | | }else if(banner.getTargetType()==3){ |
| | | banner.setLinkUrl(null); |
| | | banner.setLinkType(null); |
| | | banner.setJumpType(null); |
| | | banner.setJumpId(null); |
| | | } |
| | | // 设置创建用户ID和创建时间 |
| | | banner.setCreateUserId(mgtBannerEditDto.getUserId()); |
| | | banner.setCreateTime(new Date()); |
| | |
| | | @Override |
| | | public MgtBannerGetVo getMgtBanner(Long bannerId){ |
| | | Banner banner = this.getById(bannerId); |
| | | if(banner.getTargetType()==1){ |
| | | banner.setJumpType(null); |
| | | banner.setJumpId(null); |
| | | banner.setLinkType(null); |
| | | }else if(banner.getTargetType()==2){ |
| | | if(banner.getLinkType()==1){ |
| | | banner.setJumpType(null); |
| | | banner.setJumpId(null); |
| | | }else{ |
| | | banner.setLinkUrl(null); |
| | | } |
| | | }else if(banner.getTargetType()==3){ |
| | | banner.setLinkUrl(null); |
| | | banner.setLinkType(null); |
| | | banner.setJumpType(null); |
| | | banner.setJumpId(null); |
| | | } |
| | | |
| | | MgtBannerGetVo mgtBannerGetVo = new MgtBannerGetVo(); |
| | | BeanUtils.copyProperties(banner, mgtBannerGetVo); |
| | | return mgtBannerGetVo; |