| @@ -1,6 +1,5 @@ | |||||
| package com.iformall.controller; | package com.iformall.controller; | ||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.common.ErrorCode; | import com.iformall.common.ErrorCode; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.dto.WxMerchantDto; | import com.iformall.domain.dto.WxMerchantDto; | ||||
| @@ -21,7 +20,6 @@ import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| import java.util.HashMap; | import java.util.HashMap; | ||||
| import java.util.List; | |||||
| /** | /** | ||||
| * @author Stormeye | * @author Stormeye | ||||
| @@ -341,4 +341,12 @@ public class WxMerchant extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value="楼层号",name="floor") | @io.swagger.annotations.ApiModelProperty(value="楼层号",name="floor") | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private Long floor; | private Long floor; | ||||
| @io.swagger.annotations.ApiModelProperty(value="经度",name="longitude") | |||||
| @TableField(exist = false) | |||||
| private Float longitude; | |||||
| @io.swagger.annotations.ApiModelProperty(value="纬度",name="latitude") | |||||
| @TableField(exist = false) | |||||
| private Float latitude; | |||||
| } | } | ||||
| @@ -1,5 +1,6 @@ | |||||
| package com.iformall.domain.vo; | package com.iformall.domain.vo; | ||||
| import com.baomidou.mybatisplus.annotation.TableField; | |||||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||||
| import com.iformall.domain.po.WxMerchant; | import com.iformall.domain.po.WxMerchant; | ||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| @@ -98,6 +99,14 @@ public class WxMerchantVo extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value = "置顶时间", name = "topTime") | @io.swagger.annotations.ApiModelProperty(value = "置顶时间", name = "topTime") | ||||
| private Date topTime; | private Date topTime; | ||||
| @io.swagger.annotations.ApiModelProperty(value="经度",name="longitude") | |||||
| @TableField(exist = false) | |||||
| private Float longitude; | |||||
| @io.swagger.annotations.ApiModelProperty(value="纬度",name="latitude") | |||||
| @TableField(exist = false) | |||||
| private Float latitude; | |||||
| public void initByMerchant(WxMerchant m) { | public void initByMerchant(WxMerchant m) { | ||||
| this.id = m.getId(); | this.id = m.getId(); | ||||
| @@ -117,5 +126,7 @@ public class WxMerchantVo extends TenantEntity { | |||||
| this.actionDesc = m.getActionDesc(); | this.actionDesc = m.getActionDesc(); | ||||
| this.linkLinePhone = m.getLinkLinePhone(); | this.linkLinePhone = m.getLinkLinePhone(); | ||||
| this.topTime = m.getTopTime(); | this.topTime = m.getTopTime(); | ||||
| this.longitude = m.getLongitude(); | |||||
| this.latitude = m.getLatitude(); | |||||
| } | } | ||||
| } | } | ||||
| @@ -1225,7 +1225,21 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| } | } | ||||
| List<Long> merchantIds = wxCouponMerchantMapper.findMerchantByProductIds(tenantEntity.getTenantId(), couponIds); | List<Long> merchantIds = wxCouponMerchantMapper.findMerchantByProductIds(tenantEntity.getTenantId(), couponIds); | ||||
| if(null != merchantIds && merchantIds.size() > 0 ) { | if(null != merchantIds && merchantIds.size() > 0 ) { | ||||
| WxMerchant merchantQ = new WxMerchant(); | |||||
| TtMerchantPoi poiQ = new TtMerchantPoi(); | |||||
| poiQ.updateTenantInfo(tenantEntity); | |||||
| poiQ.setIds(merchantIds); | |||||
| List<TtMerchantPoi> poiList = ttMerchantPoiMapper.findList(poiQ); | |||||
| Map<Long,TtMerchantPoi> poiMap = new HashMap<Long,TtMerchantPoi>(); | |||||
| if(null != poiList){ | |||||
| for (int i = 0 ; i < poiList.size() ; i++) { | |||||
| TtMerchantPoi p = poiList.get(i); | |||||
| if (null != p) { | |||||
| poiMap.put(p.getId(), p); | |||||
| } | |||||
| } | |||||
| } | |||||
| WxMerchant merchantQ = new WxMerchant(); | |||||
| merchantQ.updateTenantInfo(tenantEntity); | merchantQ.updateTenantInfo(tenantEntity); | ||||
| merchantQ.setIds(merchantIds); | merchantQ.setIds(merchantIds); | ||||
| List<WxMerchant> merchantList = wxMerchantMapper.findList(merchantQ); | List<WxMerchant> merchantList = wxMerchantMapper.findList(merchantQ); | ||||
| @@ -1234,7 +1248,12 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| for (int i = 0 ; i < merchantList.size() ; i++) { | for (int i = 0 ; i < merchantList.size() ; i++) { | ||||
| WxMerchant m = merchantList.get(i); | WxMerchant m = merchantList.get(i); | ||||
| if (null != m) { | if (null != m) { | ||||
| merchantMap.put(m.getId(), m); | |||||
| TtMerchantPoi poi = poiMap.get(m.getId()); | |||||
| if(null != poi){ | |||||
| m.setLongitude(poi.getLongitude()); | |||||
| m.setLatitude(poi.getLatitude()); | |||||
| } | |||||
| merchantMap.put(m.getId(), m); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -1297,6 +1316,8 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| if (hasShop && null != merchantShopVoList) { | if (hasShop && null != merchantShopVoList) { | ||||
| vo.setShopVoList(merchantShopVoList.get(vo.getId())); | vo.setShopVoList(merchantShopVoList.get(vo.getId())); | ||||
| } | } | ||||
| vo.setLongitude(m.getLongitude()); | |||||
| vo.setLatitude(m.getLatitude()); | |||||
| return vo; | return vo; | ||||
| } | } | ||||