| | |
| | | private Integer idleTotal; |
| | | |
| | | @ApiModelProperty("距离") |
| | | private Integer distance; |
| | | private Double distance; |
| | | |
| | | @ApiModelProperty("客服电话") |
| | | private String customPhone; |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsInformationDTO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsInformationVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import com.panzhihua.service_community.entity.McsInformation; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * H5分页查询资讯 |
| | | * @param page |
| | | * @param minX |
| | | * @param maxX |
| | | * @param minY |
| | | * @param maxY |
| | | * @param pageMcsInformationDTO |
| | | * @return |
| | | */ |
| | | IPage<McsInformationVO> pageH5McsInfo(@Param("page") Page page, @Param("minX") Double minX, |
| | | @Param("maxX") Double maxX, @Param("minY") Double minY, @Param("maxY") Double maxY, |
| | | @Param("pageMcsInformationDTO") PageMcsInformationDTO pageMcsInformationDTO); |
| | | IPage<McsInformationVO> pageH5McsInfo(@Param("page") Page page, @Param("pageMcsInformationDTO") PageMcsInformationDTO pageMcsInformationDTO); |
| | | |
| | | /** |
| | | * 通过商家id批量下架戳戳资讯 |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsMerchantDTO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.IndexTopStatisticsVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsMerchantVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import com.panzhihua.service_community.entity.McsMerchant; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * H5分页查询数字商业街商家 |
| | | * @param page |
| | | * @param minX |
| | | * @param maxX |
| | | * @param minY |
| | | * @param maxY |
| | | * @param pageMcsMerchantDTO |
| | | * @return |
| | | */ |
| | | IPage<McsMerchantVO> pageH5McsMerchant(@Param("page") Page page, @Param("minX") Double minX, @Param("maxX") Double maxX, |
| | | @Param("minY") Double minY, @Param("maxY") Double maxY, @Param("pageMcsMerchantDTO") PageMcsMerchantDTO pageMcsMerchantDTO); |
| | | IPage<McsMerchantVO> pageH5McsMerchant(@Param("page") Page page, @Param("pageMcsMerchantDTO") PageMcsMerchantDTO pageMcsMerchantDTO); |
| | | |
| | | /** |
| | | * 查询需要处理的已到期商家 |
| | |
| | | |
| | | import static java.util.Objects.isNull; |
| | | import static java.util.Objects.nonNull; |
| | | import static org.apache.commons.lang3.StringUtils.isNotEmpty; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsInfoDTO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsGameVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsMerchantVO; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.panzhihua.service_community.util.NearbyUtil; |
| | | import com.spatial4j.core.shape.Rectangle; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsInfoDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsInformationDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.SetShelfForInfoDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsInformationVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsMerchantVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.TopStatisticsVO; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.panzhihua.service_community.dao.McsGameDAO; |
| | | import com.panzhihua.service_community.dao.McsInformationDAO; |
| | | import com.panzhihua.service_community.dao.McsMerchantDAO; |
| | | import com.panzhihua.service_community.entity.McsInformation; |
| | | import com.panzhihua.service_community.entity.McsMerchant; |
| | | import com.panzhihua.service_community.service.McsInformationService; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * (McsInformation)表服务实现类 |
| | |
| | | Page page = new Page<>(); |
| | | page.setSize(pageMcsInformationDTO.getPageSize()); |
| | | page.setCurrent(pageMcsInformationDTO.getPageNum()); |
| | | String lat = pageMcsInformationDTO.getLat(); |
| | | String lon = pageMcsInformationDTO.getLon(); |
| | | Integer distance = pageMcsInformationDTO.getDistance(); |
| | | IPage<McsInformationVO> mcsInfos; |
| | | if (isNotEmpty(lat) && isNotEmpty(lon) && nonNull(distance)) { |
| | | Rectangle rectangle =new NearbyUtil().getRectangle(pageMcsInformationDTO.getDistance(), |
| | | Double.parseDouble(pageMcsInformationDTO.getLon()), Double.parseDouble(pageMcsInformationDTO.getLat())); |
| | | mcsInfos = this.baseMapper.pageH5McsInfo(page, rectangle.getMinX(), rectangle.getMaxX(), |
| | | rectangle.getMinY(), rectangle.getMaxY(), pageMcsInformationDTO); |
| | | } else { |
| | | mcsInfos = this.baseMapper.pageH5McsInfo(page, null, null, null, null, pageMcsInformationDTO); |
| | | } |
| | | IPage<McsInformationVO> mcsInfos = this.baseMapper.pageH5McsInfo(page, pageMcsInformationDTO); |
| | | return R.ok(mcsInfos); |
| | | } |
| | | |
| | |
| | | import static java.util.Objects.isNull; |
| | | import static java.util.Objects.nonNull; |
| | | import static org.apache.commons.lang3.StringUtils.isBlank; |
| | | import static org.apache.commons.lang3.StringUtils.isNotEmpty; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Random; |
| | | import java.util.UUID; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.LoginWithPhoneDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PutUserInfoDTO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.IndexTopStatisticsVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsGameVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsLoginUserInfoVO; |
| | | import com.panzhihua.service_community.dao.McsInformationDAO; |
| | | import com.panzhihua.service_community.dao.McsOrderDao; |
| | | import com.panzhihua.service_community.entity.McsOrder; |
| | | import com.panzhihua.service_community.util.NearbyUtil; |
| | | import com.spatial4j.core.shape.Rectangle; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | import com.panzhihua.common.exceptions.ServiceException; |
| | | import com.panzhihua.common.model.dtos.community.convenient.DisableOrEnableConvenientMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.DisableOrEnableMcsMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.LoginWithPhoneDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PutUserInfoDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.IndexTopStatisticsVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsGameVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsLoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsMerchantVO; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.panzhihua.service_community.dao.McsConfigDAO; |
| | | import com.panzhihua.service_community.dao.McsGameDAO; |
| | | import com.panzhihua.service_community.dao.McsInformationDAO; |
| | | import com.panzhihua.service_community.dao.McsMerchantDAO; |
| | | import com.panzhihua.service_community.dao.McsOrderDao; |
| | | import com.panzhihua.service_community.entity.McsConfig; |
| | | import com.panzhihua.service_community.entity.McsMerchant; |
| | | import com.panzhihua.service_community.entity.McsOrder; |
| | | import com.panzhihua.service_community.service.McsMerchantService; |
| | | |
| | | /** |
| | |
| | | Page page = new Page<>(); |
| | | page.setSize(pageMcsMerchantDTO.getPageSize()); |
| | | page.setCurrent(pageMcsMerchantDTO.getPageNum()); |
| | | String lat = pageMcsMerchantDTO.getLat(); |
| | | String lon = pageMcsMerchantDTO.getLon(); |
| | | Integer distance = pageMcsMerchantDTO.getDistance(); |
| | | IPage<McsMerchantVO> mcsMerchants; |
| | | if (isNotEmpty(lat) && isNotEmpty(lon) && nonNull(distance)) { |
| | | Rectangle rectangle = new NearbyUtil().getRectangle(distance, Double.parseDouble(lon), Double.parseDouble(lat)); |
| | | mcsMerchants = this.baseMapper.pageH5McsMerchant(page, rectangle.getMinX(), rectangle.getMaxX(), |
| | | rectangle.getMinY(), rectangle.getMaxY(), pageMcsMerchantDTO); |
| | | } else { |
| | | mcsMerchants = this.baseMapper.pageH5McsMerchant(page, null, null, null, null, pageMcsMerchantDTO); |
| | | } |
| | | IPage<McsMerchantVO> mcsMerchants = this.baseMapper.pageH5McsMerchant(page, pageMcsMerchantDTO); |
| | | return R.ok(mcsMerchants); |
| | | } |
| | | |
| | |
| | | </select> |
| | | <select id="pageH5McsInfo" |
| | | resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.McsInformationVO"> |
| | | SELECT t1.id, t1.`name`, t1.publish_at, t1.`status`, t1.merchant_id, t1.lat, t1.lon, t1.cover, t2.`name` AS merchantName |
| | | FROM mcs_information 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 t3.`status` = 1 |
| | | <if test="pageMcsInformationDTO.keyword != null and pageMcsInformationDTO.keyword != """> |
| | | AND t1.`name` LIKE CONCAT(#{pageMcsInformationDTO.keyword}, '%') |
| | | SELECT * FROM ( |
| | | SELECT t1.id, t1.`name`, t1.publish_at, t1.`status`, t1.merchant_id, t1.lat, t1.lon, t1.cover, t2.`name` AS |
| | | merchantName, |
| | | ROUND(6378.138 * 2 * ASIN(SQRT(POW(SIN((t1.lat * PI() / 180 - #{pageMcsInformationDTO.lat} * PI() / 180) / 2),2) |
| | | + |
| | | COS(t1.lat * PI() / 180) * COS(#{pageMcsInformationDTO.lat} * PI() / 180) * POW(SIN((t1.lon * PI() / 180 - |
| | | #{pageMcsInformationDTO.lon} * PI() / 180) / 2),2))), 2) AS distance |
| | | FROM mcs_information 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 t3.`status` = 1 |
| | | <if test="pageMcsInformationDTO.keyword != null and pageMcsInformationDTO.keyword != """> |
| | | AND t1.`name` LIKE CONCAT(#{pageMcsInformationDTO.keyword}, '%') |
| | | </if> |
| | | <if test="pageMcsInformationDTO.merchantId != null"> |
| | | AND t1.merchant_id = #{pageMcsInformationDTO.merchantId} |
| | | </if> |
| | | ORDER BY t1.created_at DESC |
| | | ) temp WHERE 1=1 |
| | | <if test="pageMcsInformationDTO.distance != null"> |
| | | <if test="pageMcsInformationDTO.isMore != null and pageMcsInformationDTO.isMore ==1"> |
| | | AND distance > #{pageMcsInformationDTO.distance} |
| | | </if> |
| | | <if test="pageMcsInformationDTO.isMore == null"> |
| | | AND distance <= #{pageMcsInformationDTO.distance} |
| | | </if> |
| | | </if> |
| | | <if test="pageMcsInformationDTO.merchantId != null"> |
| | | AND t1.merchant_id = #{pageMcsInformationDTO.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 |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | </select> |
| | | <select id="pageH5McsMerchant" |
| | | resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.McsMerchantVO"> |
| | | SELECT t1.id, t1.`name`, t1.phone, t1.account, t1.`level`, t1.expire_at, t1.first_lit_at, t1.publish_limit, t1.introduction, t1.logo, |
| | | (POWER(MOD(ABS(t1.lon - #{pageMcsMerchantDTO.lon}),360),2) + POWER(ABS(t1.lat - #{pageMcsMerchantDTO.lat}),2)) AS distance |
| | | FROM mcs_merchant t1 |
| | | LEFT JOIN sys_user t2 ON t1.user_id = t2.user_id |
| | | <if test="pageMcsMerchantDTO.type != null and pageMcsMerchantDTO.type == 1"> |
| | | LEFT JOIN (SELECT * FROM mcs_game WHERE `status` = 2 GROUP BY merchant_id) t3 ON t1.id = t3.merchant_id |
| | | </if> |
| | | <if test="pageMcsMerchantDTO.type != null and pageMcsMerchantDTO.type == 2"> |
| | | LEFT JOIN (SELECT * FROM mcs_information WHERE `status` = 2 GROUP BY merchant_id) t3 ON t1.id = t3.merchant_id |
| | | </if> |
| | | WHERE t1.is_del = 0 AND t1.expire_at > NOW() AND t2.`status` = 1 |
| | | <if test="pageMcsMerchantDTO.type != null"> |
| | | AND t3.id IS NOT NULL |
| | | </if> |
| | | <if test="minX != null"> |
| | | SELECT * FROM ( |
| | | SELECT t1.id, t1.`name`, t1.phone, t1.account, t1.`level`, t1.expire_at, t1.first_lit_at, t1.publish_limit, |
| | | t1.introduction, t1.logo, |
| | | ROUND(6378.138 * 2 * ASIN(SQRT(POW(SIN((t1.lat * PI() / 180 - #{pageMcsMerchantDTO.lat} * PI() / 180) / 2),2) + |
| | | COS(t1.lat * PI() / 180) * COS(#{pageMcsMerchantDTO.lat} * PI() / 180) * POW(SIN((t1.lon * PI() / 180 - |
| | | #{pageMcsMerchantDTO.lon} * PI() / 180) / 2),2))), 2) AS distance |
| | | FROM mcs_merchant t1 |
| | | LEFT JOIN sys_user t2 ON t1.user_id = t2.user_id |
| | | <if test="pageMcsMerchantDTO.type != null and pageMcsMerchantDTO.type == 1">LEFT JOIN (SELECT * FROM mcs_game |
| | | WHERE `status` = 2 GROUP BY merchant_id) t3 ON t1.id = t3.merchant_id |
| | | </if> |
| | | <if test=" |
| | | pageMcsMerchantDTO.type != null and pageMcsMerchantDTO.type == 2">LEFT JOIN (SELECT * FROM mcs_information WHERE |
| | | `status` = 2 GROUP BY merchant_id) t3 ON t1.id = t3.merchant_id |
| | | </if> |
| | | WHERE t1.is_del = 0 AND t1.expire_at > NOW() AND t2.`status` = 1 |
| | | <if test="pageMcsMerchantDTO.type != null"> |
| | | AND t3.id IS NOT NULL |
| | | </if> |
| | | <if test="pageMcsMerchantDTO.keyword != null and pageMcsMerchantDTO.keyword != """> |
| | | AND t1.`name` LIKE CONCAT(#{pageMcsMerchantDTO.keyword}, '%') |
| | | </if> |
| | | ) temp WHERE 1=1 |
| | | <if test="pageMcsMerchantDTO.distance != null"> |
| | | <if test="pageMcsMerchantDTO.isMore != null and pageMcsMerchantDTO.isMore ==1"> |
| | | AND t1.lon > #{maxX} |
| | | AND t1.lat > #{maxY} |
| | | AND distance > #{pageMcsMerchantDTO.distance} |
| | | </if> |
| | | <if test="pageMcsMerchantDTO.isMore == null"> |
| | | AND (t1.lon BETWEEN #{minX} AND #{maxX}) |
| | | AND (t1.lat BETWEEN #{minY} AND #{maxY}) |
| | | AND distance <= #{pageMcsMerchantDTO.distance} |
| | | </if> |
| | | </if> |
| | | <if test="pageMcsMerchantDTO.keyword != null and pageMcsMerchantDTO.keyword != """> |
| | | AND t1.`name` LIKE CONCAT(#{pageMcsMerchantDTO.keyword}, '%') |
| | | </if> |
| | | ORDER BY distance ASC |
| | | </select> |