fanli/src/main/java/com/yeshi/fanli/controller/client/RecommendController.java
@@ -7,7 +7,6 @@ import java.util.Calendar; import java.util.Collections; import java.util.Date; import java.util.Iterator; import java.util.List; import javax.annotation.Resource; @@ -1572,24 +1571,34 @@ @RequestMapping(value = "getRecommendIndex") public void getRecommendIndex(AcceptData acceptData, Long uid, PrintWriter out) { try { // 专题模块 // 1、专题模块 JSONObject root = specialService.listCacheSpecialToIndex(); // 顶部轮播图 // 2、顶部轮播图 List<SwiperPicture> topPicList = getSwiperByCard("index_top"); if (topPicList == null) { topPicList = new ArrayList<SwiperPicture>(); } root.put("topPicList", JsonUtil.getApiCommonGson().toJson(topPicList)); // 邀请、分享轮播图 List<SwiperPicture> invitePicList = getInvitePicList(uid, acceptData); // 3、邀请有奖 List<SwiperPicture> invitePicList = null; if ("ios".equalsIgnoreCase(acceptData.getPlatform()) && configService.iosOnLining(Integer.parseInt(acceptData.getVersion()))) { // 如果IOS当前版本处于审核状态就不返回 } else { invitePicList = getSwiperByCard("index_invite"); } if (invitePicList == null) { invitePicList = new ArrayList<SwiperPicture>(); } } root.put("invitePicList", JsonUtil.getApiCommonGson().toJson(invitePicList)); // 底部网页链接 // 4、IOS的底部网页链接 String platform = acceptData.getPlatform(); if ("ios".equalsIgnoreCase(platform)) { root.put("htmlLink", configService.get("index_html_link_ios")); @@ -1621,25 +1630,7 @@ List<SwiperPicture> invitePicList = getSwiperByCard("index_invite"); if (uid != null) { try { // 用户自定义:不看邀请有奖 UserSettingsVO vo = userCustomSettingsService.getMySettings(uid); if (vo != null && vo.getNoInvitationBonus() != null && vo.getNoInvitationBonus() == 1 && invitePicList != null && invitePicList.size() > 0) { Iterator<SwiperPicture> iterator = invitePicList.iterator(); while (iterator.hasNext()) { SwiperPicture swiperPicture = iterator.next(); JumpDetailV2 jumpDetail = swiperPicture.getJumpDetail(); if (jumpDetail != null && "invite".equals(jumpDetail.getType())) { iterator.remove(); } } } } catch (UserCustomSettingsException e) { e.printStackTrace(); } } return invitePicList; } fanli/src/main/java/com/yeshi/fanli/controller/client/UserCouponController.java
@@ -511,7 +511,7 @@ prize = "NoPrize"; } else if (prize.equals(couponType)) { // 已存在此券 prize = "NoPrize"; } else { SystemCoupon coupon = systemCouponService.getCouponByType(prize); if (coupon != null) { fanli/src/main/java/com/yeshi/fanli/controller/client/UserMsgController.java
@@ -601,7 +601,7 @@ List<UserMsgCenter> listCenter = new ArrayList<>(); List<Special> listSpecial = specialService.listBySystemAndCard("msg_activities", system.getId()); List<Special> listSpecial = specialService.listByPlaceKey("msg_activities"); if (listSpecial != null && listSpecial.size() > 0) { for (Special special: listSpecial) { UserMsgCenter msgCenter = new UserMsgCenter(); fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/Special.java
@@ -92,8 +92,14 @@ // 更新时间 @Column(name = "b_updatetime") private Date updatetime; // 背景图片 private String bottomPicture; // 是否删除图片 private Boolean delIcon; private Boolean delPicture; private Boolean delSubPicture; public Long getId() { return id; @@ -231,4 +237,29 @@ public void setIcon(String icon) { this.icon = icon; } public Boolean getDelIcon() { return delIcon; } public void setDelIcon(Boolean delIcon) { this.delIcon = delIcon; } public Boolean getDelPicture() { return delPicture; } public void setDelPicture(Boolean delPicture) { this.delPicture = delPicture; } public Boolean getDelSubPicture() { return delSubPicture; } public void setDelSubPicture(Boolean delSubPicture) { this.delSubPicture = delSubPicture; } } fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/SpecialCard.java
@@ -68,6 +68,9 @@ // 已有专题数量 private Long totalSpecial; // 删除背景图 private Boolean delPicture; public Long getId() { return id; @@ -187,6 +190,14 @@ public void setPlaceName(String placeName) { this.placeName = placeName; } public Boolean getDelPicture() { return delPicture; } public void setDelPicture(Boolean delPicture) { this.delPicture = delPicture; } } fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/SpecialCardMapper.xml
@@ -55,7 +55,7 @@ <if test="placeId != null">cd_place_id=#{placeId,jdbcType=BIGINT},</if> <if test="bottomPicture != null">cd_bottom_picture=#{bottomPicture,jdbcType=VARCHAR},</if> <if test="startTime != null">cd_start_time=#{startTime,jdbcType=TIMESTAMP},</if> <if test="endTime != null">cd_end_time=#{endTime,jdbcType=TIMESTAMP},</if> <if test="endTime != null">cd_end_time=#{endTime,jdbcType=TIMESTAMP},</if> <if test="createtime != null">cd_createtime=#{createtime,jdbcType=TIMESTAMP},</if> <if test="updatetime != null">cd_updatetime=#{updatetime,jdbcType=TIMESTAMP},</if> </set> where cd_id = #{id,jdbcType=BIGINT} @@ -67,7 +67,7 @@ <if test='key != null and key != ""'> AND cd_name like '%${key}%' </if> ORDER BY cd_state DESC,cd_createtime ORDER BY cd_place_id,cd_state DESC LIMIT ${start},${count} </select> fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialCardServiceImpl.java
@@ -16,7 +16,6 @@ import com.yeshi.fanli.dao.mybatis.homemodule.SpecialCardMapper; import com.yeshi.fanli.entity.bus.homemodule.SpecialCard; import com.yeshi.fanli.entity.bus.homemodule.SpecialPlace; import com.yeshi.fanli.exception.FloatADException; import com.yeshi.fanli.exception.homemodule.SpecialCardException; import com.yeshi.fanli.service.inter.config.BusinessSystemService; import com.yeshi.fanli.service.inter.homemodule.SpecialCardService; @@ -79,7 +78,14 @@ // 修改 SpecialCard resultObj = specialCardMapper.selectByPrimaryKey(id); if (resultObj == null) { throw new FloatADException(1, "修改内容已不存在"); throw new SpecialCardException(1, "修改内容已不存在"); } // 删除图片 Boolean delPicture = record.getDelPicture(); if (delPicture != null && delPicture) { removePicture(resultObj.getBottomPicture()); resultObj.setBottomPicture(null); } if (picture != null && picture.trim().length() > 0) { fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/SpecialServiceImpl.java
@@ -120,6 +120,25 @@ throw new SpecialException(1, "修改内容已不存在"); } // 删除图片 Boolean delIcon = record.getDelIcon(); if (delIcon != null && delIcon) { removePicture(resultObj.getIcon()); resultObj.setIcon(null); } Boolean delPicture = record.getDelPicture(); if (delPicture != null && delPicture) { removePicture(resultObj.getPicture()); resultObj.setPicture(null); } Boolean delSubPicture = record.getDelSubPicture(); if (delSubPicture != null && delSubPicture) { removePicture(resultObj.getSubPicture()); resultObj.setSubPicture(null); } if (picture != null && picture.trim().length() > 0) { // 删除老图 removePicture(resultObj.getPicture()); @@ -374,6 +393,11 @@ return root; } @Override public List<Special> listByPlaceKey(String placeKey) { return specialMapper.listByPlaceKey(placeKey); } /** * 处理 数据 fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserLotteryRecordServiceImpl.java
@@ -164,14 +164,15 @@ throw new UserLotteryRecordException(2, "抽奖次数不足"); } String prize = null; String couponType = null; // 新人抽奖 -已抽中奖品 List<UserSystemCoupon> list = userSystemCouponService.getUserCouponBySource(uid, UserSystemCoupon.SOURCE_NEWBIES); String prize = null; if (list == null || list.size() == 0) { prize = getLotteryPrizeNewbies(count, 0, null); } else if (list.size() == 1) { String couponType = null; UserSystemCoupon userSystemCoupon = list.get(0); SystemCoupon systemCoupon = userSystemCoupon.getSystemCoupon(); if (systemCoupon != null) { @@ -185,6 +186,9 @@ } if (prize == null || prize.trim().length() == 0) { prize = "NoPrize"; } else if (prize.equals(couponType)) { // 已存在此券 prize = "NoPrize"; } else { try { @@ -363,7 +367,7 @@ String rebateCoupon = "rebateCoupon"; // 一张奖励券 String doubleCoupon = "doubleCoupon"; // 两张奖励券 if (count== 1) { if (count == 1) { // 剩余最后一次必中 long result = (1 + Math.round(Math.random() * (9))); if (result <= 7) { fanli/src/main/java/com/yeshi/fanli/service/inter/homemodule/SpecialService.java
@@ -87,4 +87,12 @@ */ public JSONObject listCacheSpecialToIndex() throws Exception; /** * 根据专题位置查询 * @param placeKey * @return */ public List<Special> listByPlaceKey(String placeKey); }