| | |
| | | @NotNull(groups = {AddGroup.class}, message = "游戏类别不能为空") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty("奖励类型(1.免费产品 2.免费服务)") |
| | | @ApiModelProperty("奖励类型(1.免费领 2.产品试用 3.消费赠礼 4.优惠券)") |
| | | private Integer awardType; |
| | | |
| | | @ApiModelProperty("戳戳币分配方式(1.随机分配 2.平均分配)") |
| | |
| | | @ApiModelProperty("游戏封面") |
| | | private String cover; |
| | | |
| | | @ApiModelProperty("奖励类型(1.免费产品 2.免费服务)") |
| | | @ApiModelProperty("奖励类型(1.免费领 2.产品试用 3.消费赠礼 4.优惠券)") |
| | | private Integer awardType; |
| | | |
| | | @ApiModelProperty("戳戳币分配方式(1.随机分配 2.平均分配)") |
| | |
| | | @ApiModelProperty("游戏类别(1.戳戳币游戏 2.体验游戏)") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty("奖励类型(1.免费产品 2.免费服务)") |
| | | @ApiModelProperty("奖励类型(1.免费领 2.产品试用 3.消费赠礼 4.优惠券)") |
| | | private Integer awardType; |
| | | |
| | | @ApiModelProperty("戳戳币分配方式(1.随机分配 2.平均分配)") |
| | |
| | | @ApiModelProperty("游戏封面") |
| | | private String cover; |
| | | |
| | | @ApiModelProperty("奖励类型(1.免费产品 2.免费服务)") |
| | | @ApiModelProperty("奖励类型(1.免费领 2.产品试用 3.消费赠礼 4.优惠券)") |
| | | private Integer awardType; |
| | | } |
| | |
| | | /** |
| | | * h5分页游戏查询 |
| | | * @param page |
| | | * @param minX |
| | | * @param maxX |
| | | * @param minY |
| | | * @param maxY |
| | | * @param pageMcsGameDTO |
| | | * @return |
| | | */ |
| | | IPage<McsGameVO> pageH5McsGame(@Param("page") Page page, @Param("minX") Double minX, @Param("maxX") Double maxX, |
| | | @Param("minY") Double minY, @Param("maxY") Double maxY, @Param("pageMcsGameDTO") PageMcsGameDTO pageMcsGameDTO); |
| | | IPage<McsGameVO> pageH5McsGame(@Param("page") Page page, @Param("pageMcsGameDTO") PageMcsGameDTO pageMcsGameDTO); |
| | | |
| | | /** |
| | | * 游戏详情 |
| | |
| | | */ |
| | | private Integer type; |
| | | /** |
| | | * 奖励类型(1.免费产品 2.免费服务) |
| | | * 奖励类型(1.免费领 2.产品试用 3.消费赠礼 4.优惠券) |
| | | */ |
| | | private Integer awardType; |
| | | /** |
| | |
| | | |
| | | import static java.util.Objects.isNull; |
| | | import static java.util.Objects.nonNull; |
| | | import static org.apache.commons.lang3.StringUtils.isNotEmpty; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | |
| | | import com.panzhihua.service_community.entity.McsGame; |
| | | import com.panzhihua.service_community.entity.McsMerchant; |
| | | import com.panzhihua.service_community.service.McsGameService; |
| | | import com.panzhihua.service_community.util.NearbyUtil; |
| | | import com.panzhihua.service_community.util.QRCodeUtil; |
| | | import com.spatial4j.core.shape.Rectangle; |
| | | |
| | | /** |
| | | * (McsGame)表服务实现类 |
| | |
| | | //体验游戏 |
| | | Integer awardType = mcsGame.getAwardType(); |
| | | if (awardType.equals(1)) { |
| | | mcsCoupon.setAward("免费产品"); |
| | | mcsCoupon.setAward("免费领"); |
| | | } else if (awardType.equals(2)) { |
| | | mcsCoupon.setAward("产品试用"); |
| | | } else if (awardType.equals(3)) { |
| | | mcsCoupon.setAward("消费赠礼"); |
| | | } else { |
| | | mcsCoupon.setAward("免费服务"); |
| | | mcsCoupon.setAward("优惠券"); |
| | | } |
| | | } |
| | | int num = mcsCouponDAO.insert(mcsCoupon); |
| | |
| | | Page page = new Page<>(); |
| | | page.setSize(pageMcsGameDTO.getPageSize()); |
| | | page.setCurrent(pageMcsGameDTO.getPageNum()); |
| | | String lat = pageMcsGameDTO.getLat(); |
| | | String lon = pageMcsGameDTO.getLon(); |
| | | Integer distance = pageMcsGameDTO.getDistance(); |
| | | IPage<McsGameVO> mcsGames; |
| | | if (isNotEmpty(lat) && isNotEmpty(lon) && nonNull(distance)) { |
| | | Rectangle rectangle = new NearbyUtil().getRectangle(pageMcsGameDTO.getDistance(), |
| | | Double.parseDouble(pageMcsGameDTO.getLon()), Double.parseDouble(pageMcsGameDTO.getLat())); |
| | | mcsGames = this.baseMapper.pageH5McsGame(page, rectangle.getMinX(), rectangle.getMaxX(), |
| | | rectangle.getMinY(), rectangle.getMaxY(), pageMcsGameDTO); |
| | | } else { |
| | | mcsGames = this.baseMapper.pageH5McsGame(page, null, null, null, null, pageMcsGameDTO); |
| | | } |
| | | |
| | | IPage<McsGameVO> mcsGames = this.baseMapper.pageH5McsGame(page, pageMcsGameDTO); |
| | | return R.ok(mcsGames); |
| | | } |
| | | |
| | |
| | | <select id="pageMcsGame" |
| | | resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.McsGameVO"> |
| | | (SELECT t1.id, t1.`name`, t1.`type`, t1.coupons, t1.surplus_coupons, |
| | | t1.publish_at, t1.`status`, t1.merchant_id, t2.`name` AS merchantName, t1.is_popular, t1.cover |
| | | t1.publish_at, t1.expire_at, t1.`status`, t1.merchant_id, t2.`name` AS merchantName, t1.is_popular, t1.cover |
| | | FROM mcs_game t1 |
| | | LEFT JOIN mcs_merchant t2 ON t1.merchant_id = t2.id |
| | | WHERE t1.is_del = 0 AND t1.`status` = 2 |
| | |
| | | </select> |
| | | <select id="pageH5McsGame" |
| | | resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.McsGameVO"> |
| | | SELECT * FROM ( |
| | | SELECT t1.id, t1.`name`, t1.`type`, t1.coupons, t1.surplus_coupons, t1.award_type, t1.cover, |
| | | t1.publish_at, t1.`status`, t1.merchant_id, t1.lat, t1.lon, t2.`name` AS merchantName |
| | | t1.publish_at, t1.`status`, t1.merchant_id, t1.lat, t1.lon, t2.`name` AS merchantName, |
| | | ROUND(6378.138 * 2 * ASIN(SQRT(POW(SIN((t1.lat * PI() / 180 - #{pageMcsGameDTO.lat} * PI() / 180) / 2),2) |
| | | + |
| | | COS(t1.lat * PI() / 180) * COS(#{pageMcsGameDTO.lat} * PI() / 180) * POW(SIN((t1.lon * PI() / 180 - |
| | | #{pageMcsGameDTO.lon} * PI() / 180) / 2),2))), 2) AS distance |
| | | FROM mcs_game t1 |
| | | LEFT JOIN mcs_merchant t2 ON t1.merchant_id = t2.id |
| | | LEFT JOIN sys_user t3 ON t2.user_id = t3.user_id |
| | |
| | | <if test="pageMcsGameDTO.keyword != null and pageMcsGameDTO.keyword != """> |
| | | AND t1.`name` LIKE CONCAT(#{pageMcsGameDTO.keyword}, '%') |
| | | </if> |
| | | <if test="pageMcsGameDTO.type != null"> |
| | | AND t1.`type` = #{pageMcsGameDTO.type} |
| | | </if> |
| | | <if test="pageMcsGameDTO.merchantId != null"> |
| | | AND t1.merchant_id = #{pageMcsGameDTO.merchantId} |
| | | </if> |
| | | <if test="maxX != null"> |
| | | AND (t1.lon BETWEEN #{minX} AND #{maxX}) |
| | | AND (t1.lat BETWEEN #{minY} AND #{maxY}) |
| | | </if> |
| | | ORDER BY t1.created_at DESC |
| | | ) temp WHERE 1=1 |
| | | <if test="pageMcsGameDTO.distance != null"> |
| | | AND distance <= #{pageMcsGameDTO.distance} |
| | | </if> |
| | | </select> |
| | | <select id="selectDetailById" |
| | | resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.McsGameVO"> |
| | |
| | | (SELECT COUNT(t1.id) FROM mcs_game t1 |
| | | LEFT JOIN mcs_merchant t2 ON t1.merchant_id = t2.id |
| | | LEFT JOIN sys_user t3 ON t2.user_id = t3.user_id |
| | | WHERE t1.is_del = 0 AND t1.`status` = 2 AND t1.expire_at > NOW() AND t2.is_del = 0 AND t3.`status` = 1) AS gameTotal, |
| | | WHERE t1.is_del = 0 AND t1.`status` = 2 AND t1.`type` = 1 AND t1.expire_at > NOW() AND t2.is_del = 0 AND t3.`status` = 1) AS gameTotal, |
| | | |
| | | (SELECT COUNT(t1.id) FROM mcs_information t1 |
| | | (SELECT COUNT(t1.id) FROM mcs_game t1 |
| | | LEFT JOIN mcs_merchant t2 ON t1.merchant_id = t2.id |
| | | LEFT JOIN sys_user t3 ON t2.user_id = t3.user_id |
| | | WHERE t1.is_del = 0 AND t1.`status` = 2 AND t2.is_del = 0 AND t3.`status` = 1) AS infoTotal |
| | | WHERE t1.is_del = 0 AND t1.`status` = 2 AND t1.`type` = 2 AND t1.expire_at > NOW() AND t2.is_del = 0 AND t3.`status` = 1) AS infoTotal |
| | | ) temp |
| | | </select> |
| | | <select id="pageH5McsMerchant" |
| | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("修改数字商业街商家用户报错【{}】", e.getMessage()); |
| | | if (e.getMessage().contains("union_phone_type")) { |
| | | return R.fail("手机号已存在"); |
| | | } else if (e.getMessage().contains("union_account_type")) { |
| | | if (e.getMessage().contains("union_account_type") || e.getMessage().contains("23000")) { |
| | | return R.fail("账户已经存在"); |
| | | }else if(e.getMessage().contains("23000")){ |
| | | return R.fail("手机号已存在"); |
| | | } else { |
| | | return R.fail("账户或手机号已存在,请重新填写尝试"); |
| | | } |