| @@ -19,6 +19,7 @@ public interface WxCouponMerchantMapper extends CommonMapper<WxCouponMerchant, L | |||||
| List<WxMerchantVo> findMerchantBaseList(@Param("productId")Long productId,@Param("tenantId")String tenantId); | List<WxMerchantVo> findMerchantBaseList(@Param("productId")Long productId,@Param("tenantId")String tenantId); | ||||
| List<WxMerchantProductVo> findMerchantProduct(@Param("tenantId")String tenantId,@Param("merchantIdList")List<Long> merchantIdList); | List<WxMerchantProductVo> findMerchantProduct(@Param("tenantId")String tenantId,@Param("merchantIdList")List<Long> merchantIdList); | ||||
| List<Long> findMerchantProductIds(@Param("tenantId")String tenantId,@Param("merchantIdList")List<Long> merchantIdList,@Param("status")Integer status); | List<Long> findMerchantProductIds(@Param("tenantId")String tenantId,@Param("merchantIdList")List<Long> merchantIdList,@Param("status")Integer status); | ||||
| List<Long> findOneMerchantProductIds(@Param("tenantId")String tenantId,@Param("merchantId")Long merchantIdList); | |||||
| List<Long> findOneMerchantProductIds(@Param("tenantId")String tenantId,@Param("merchantId")Long merchantId); | |||||
| List<Long> findMerchantByProductIds(@Param("tenantId")String tenantId,@Param("productIds")List<Long> productIds); | List<Long> findMerchantByProductIds(@Param("tenantId")String tenantId,@Param("productIds")List<Long> productIds); | ||||
| List<Long> findMerchantByProductId(@Param("tenantId")String tenantId,@Param("productId")Long productId); | |||||
| } | } | ||||
| @@ -10,4 +10,6 @@ public interface WxMallBuildingMapper extends CommonMapper<WxMallBuilding, Strin | |||||
| void deleteByTenantId(String tenantId); | void deleteByTenantId(String tenantId); | ||||
| List<WxMallBuilding> findIdAndName(String tenantId); | |||||
| } | } | ||||
| @@ -11,4 +11,6 @@ public interface WxMallFloorMapper extends CommonMapper<WxMallFloor, String> { | |||||
| int deleteByBuildingId(Long buildingId); | int deleteByBuildingId(Long buildingId); | ||||
| void deleteByTenantId(String tenantId); | void deleteByTenantId(String tenantId); | ||||
| List<WxMallFloor> findIdAndName(String tenantId); | |||||
| } | } | ||||
| @@ -63,4 +63,6 @@ public interface WxMerchantMapper extends CommonMapper<WxMerchant, Long> { | |||||
| List<Map<String, Object>> findMerchantByShop(@Param("shopId")Long shopId); | List<Map<String, Object>> findMerchantByShop(@Param("shopId")Long shopId); | ||||
| List<Map<String, Object>> detailByShopId(@Param("tenantInfo")TenantEntity tenantInfo,@Param("shopId") Long shopId); | List<Map<String, Object>> detailByShopId(@Param("tenantInfo")TenantEntity tenantInfo,@Param("shopId") Long shopId); | ||||
| List<WxMerchantVo> newFindListCVo(@Param("tenantId")String tenantId, @Param("merchantIds")List<Long> merchantIds); | |||||
| } | } | ||||
| @@ -49,4 +49,6 @@ public interface WxShopMapper extends CommonMapper<WxShop, String> { | |||||
| List<Map<String, Object>> detailBySid(WxShop wxShop); | List<Map<String, Object>> detailBySid(WxShop wxShop); | ||||
| List<WxShopVo> newFindShopVoList(@Param("tenantId")String tenantId, @Param("shopIds")List<Long> shopIds); | |||||
| } | } | ||||
| @@ -7,6 +7,8 @@ import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.domain.po.WxMallBuilding; | import com.iformall.domain.po.WxMallBuilding; | ||||
| import com.iformall.domain.po.WxMallFloor; | import com.iformall.domain.po.WxMallFloor; | ||||
| import java.util.Map; | |||||
| public interface WxMallBuildingService { | public interface WxMallBuildingService { | ||||
| /** | /** | ||||
| @@ -71,4 +73,6 @@ public interface WxMallBuildingService { | |||||
| void deleteByTenantId(String tenantId); | void deleteByTenantId(String tenantId); | ||||
| void saveFloorImg(WxMallFloor floor); | void saveFloorImg(WxMallFloor floor); | ||||
| Map<Long, String> getBuildingMap(TenantEntity tenantInfo); | |||||
| } | } | ||||
| @@ -5,6 +5,8 @@ import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.domain.po.WxMallFloor; | import com.iformall.domain.po.WxMallFloor; | ||||
| import java.util.Map; | |||||
| public interface WxMallFloorService { | public interface WxMallFloorService { | ||||
| /** | /** | ||||
| @@ -45,4 +47,6 @@ public interface WxMallFloorService { | |||||
| void deleteByBuildingId(Long buildingId); | void deleteByBuildingId(Long buildingId); | ||||
| void deleteByTenantId(String tenantId); | void deleteByTenantId(String tenantId); | ||||
| Map<Long, String> getFloorMap(TenantEntity tenantInfo); | |||||
| } | } | ||||
| @@ -187,4 +187,6 @@ public interface WxMerchantService { | |||||
| Map<String,Object> findMerchantByShop(Long shopId); | Map<String,Object> findMerchantByShop(Long shopId); | ||||
| Map<String, Object> detailByShopId(TenantEntity tenantInfo, Long shopId); | Map<String, Object> detailByShopId(TenantEntity tenantInfo, Long shopId); | ||||
| List<WxMerchantVo> newFindByCouponId(TenantEntity tenantInfo, Long couponId); | |||||
| } | } | ||||
| @@ -9,6 +9,7 @@ import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.WxShop; | import com.iformall.domain.po.WxShop; | ||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.domain.vo.WxShopVo; | |||||
| import javax.servlet.http.HttpServletRequest; | import javax.servlet.http.HttpServletRequest; | ||||
| import javax.servlet.http.HttpServletResponse; | import javax.servlet.http.HttpServletResponse; | ||||
| @@ -86,4 +87,11 @@ public interface WxShopService { | |||||
| Map<String,Object> detailBySid(TenantEntity tenantInfo, String sid); | Map<String,Object> detailBySid(TenantEntity tenantInfo, String sid); | ||||
| /** | |||||
| * 无楼层信息.楼层信息单独处理 | |||||
| * @param tenantId | |||||
| * @param merchantId | |||||
| * @return | |||||
| */ | |||||
| List<WxShopVo> newFindByMerchantId(String tenantId, Long merchantId); | |||||
| } | } | ||||
| @@ -110,6 +110,9 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||||
| @Autowired | @Autowired | ||||
| WxCouponMapper wxCouponMapper; | WxCouponMapper wxCouponMapper; | ||||
| @Autowired | |||||
| WxMerchantService wxMerchantService; | |||||
| @Lazy | @Lazy | ||||
| @Autowired | @Autowired | ||||
| WxAppinfoService wxAppinfoService; | WxAppinfoService wxAppinfoService; | ||||
| @@ -640,6 +643,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||||
| cvo.setPickEndDate(coupon.getPickEndDate()); | cvo.setPickEndDate(coupon.getPickEndDate()); | ||||
| cvo.setAutoRefund(coupon.getAutoRefund()); | cvo.setAutoRefund(coupon.getAutoRefund()); | ||||
| } | } | ||||
| cvo.setMerchantVoList(wxMerchantService.newFindByCouponId(cvo,cvo.getCouponId())); | |||||
| return cvo; | return cvo; | ||||
| } catch (IllegalAccessException | InvocationTargetException e) { | } catch (IllegalAccessException | InvocationTargetException e) { | ||||
| logger.error("getCouponOrderCVo error.",e); | logger.error("getCouponOrderCVo error.",e); | ||||
| @@ -231,5 +231,12 @@ public class WxMallBuildingServiceImpl implements WxMallBuildingService { | |||||
| wxMallFloorMapper.updateById(mallFloor); | wxMallFloorMapper.updateById(mallFloor); | ||||
| } | } | ||||
| @Override | |||||
| public Map<Long, String> getBuildingMap(TenantEntity tenantInfo) { | |||||
| List<WxMallBuilding> idAndNameS = wxMallBuildingMapper.findIdAndName(tenantInfo.getTenantId()); | |||||
| Map<Long, String> maps = idAndNameS.stream().collect(Collectors.toMap(WxMallBuilding::getId, WxMallBuilding::getBuildingName, (key1, key2) -> key2)); | |||||
| return maps; | |||||
| } | |||||
| } | } | ||||
| @@ -1,6 +1,8 @@ | |||||
| package com.iformall.service.impl; | package com.iformall.service.impl; | ||||
| import java.util.*; | import java.util.*; | ||||
| import java.util.stream.Collectors; | |||||
| import com.github.pagehelper.PageHelper; | import com.github.pagehelper.PageHelper; | ||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| @@ -16,6 +18,7 @@ import com.iformall.common.IdWorker; | |||||
| @Service | @Service | ||||
| public class WxMallFloorServiceImpl implements WxMallFloorService { | public class WxMallFloorServiceImpl implements WxMallFloorService { | ||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | private final Logger logger = LoggerFactory.getLogger(this.getClass()); | ||||
| @Autowired | @Autowired | ||||
| @@ -73,5 +76,12 @@ public class WxMallFloorServiceImpl implements WxMallFloorService { | |||||
| wxMallFloorMapper.deleteByTenantId(tenantId); | wxMallFloorMapper.deleteByTenantId(tenantId); | ||||
| } | } | ||||
| @Override | |||||
| public Map<Long, String> getFloorMap(TenantEntity tenantInfo) { | |||||
| List<WxMallFloor> idAndNameS = wxMallFloorMapper.findIdAndName(tenantInfo.getTenantId()); | |||||
| Map<Long, String> maps = idAndNameS.stream().collect(Collectors.toMap(WxMallFloor::getId, WxMallFloor::getFloorName, (key1, key2) -> key2)); | |||||
| return maps; | |||||
| } | |||||
| } | } | ||||
| @@ -107,12 +107,20 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| @Autowired | @Autowired | ||||
| WxMallService wxMallService; | WxMallService wxMallService; | ||||
| @Autowired | |||||
| WxShopService wxShopService; | |||||
| @Autowired | @Autowired | ||||
| TtCouponMapper ttCouponMapper; | TtCouponMapper ttCouponMapper; | ||||
| @Autowired | @Autowired | ||||
| TtUserFollowMapper ttUserFollowMapper; | TtUserFollowMapper ttUserFollowMapper; | ||||
| @Autowired | |||||
| WxMallFloorService wxMallFloorService; | |||||
| @Autowired | |||||
| WxMallBuildingService wxMallBuildingService; | |||||
| @Autowired | @Autowired | ||||
| private QrCodeService qrCodeService; | private QrCodeService qrCodeService; | ||||
| @@ -1188,4 +1196,29 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| return null; | return null; | ||||
| } | } | ||||
| @Override | |||||
| public List<WxMerchantVo> newFindByCouponId(TenantEntity tenantInfo, Long couponId) { | |||||
| List<Long> merchantIds = wxCouponMerchantMapper.findMerchantByProductId(tenantInfo.getTenantId(), couponId); | |||||
| List<WxMerchantVo> wxMerchantVoList = wxMerchantMapper.newFindListCVo(tenantInfo.getTenantId(),merchantIds); | |||||
| handleShopVo(tenantInfo,wxMerchantVoList); | |||||
| return wxMerchantVoList; | |||||
| } | |||||
| private void handleShopVo(TenantEntity tenantInfo,List<WxMerchantVo> wxMerchantVoList){ | |||||
| if(wxMerchantVoList != null && wxMerchantVoList.size() > 0){ | |||||
| Map<Long,String> floorMap = wxMallFloorService.getFloorMap(tenantInfo); | |||||
| Map<Long,String> buildingMap = wxMallBuildingService.getBuildingMap(tenantInfo); | |||||
| for (WxMerchantVo wv:wxMerchantVoList) { | |||||
| List<WxShopVo> shopVoList = wxShopService.newFindByMerchantId(tenantInfo.getTenantId(),wv.getId()); | |||||
| if(shopVoList != null && shopVoList.size() > 0){ | |||||
| for (WxShopVo sv:shopVoList) { | |||||
| sv.setBuildingName(buildingMap.get(sv.getBuilding())); | |||||
| sv.setFloorName(floorMap.get(sv.getFloor())); | |||||
| } | |||||
| } | |||||
| wv.setShopVoList(shopVoList); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | } | ||||
| @@ -260,4 +260,11 @@ public class WxShopServiceImpl implements WxShopService { | |||||
| } | } | ||||
| return null; | return null; | ||||
| } | } | ||||
| @Override | |||||
| public List<WxShopVo> newFindByMerchantId(String tenantId, Long merchantId) { | |||||
| List<Long> shopIds = wxMerchantShopMapper.findShopIds(merchantId); | |||||
| List<WxShopVo> shopVoList = wxShopMapper.newFindShopVoList(tenantId,shopIds); | |||||
| return shopVoList; | |||||
| } | |||||
| } | } | ||||
| @@ -200,5 +200,17 @@ | |||||
| </foreach> | </foreach> | ||||
| </if> | </if> | ||||
| </select> | </select> | ||||
| <select id = "findMerchantByProductId" parameterType="java.util.Map" resultType="Long"> | |||||
| SELECT merchant_id | |||||
| FROM wx_coupon_merchant | |||||
| WHERE STATUS = 0 | |||||
| <if test=" null != tenantId and '' != tenantId"> | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != productId"> | |||||
| and product_id = #{productId} | |||||
| </if> | |||||
| </select> | |||||
| </mapper> | </mapper> | ||||
| @@ -78,8 +78,13 @@ | |||||
| <delete id="deleteByTenantId"> | <delete id="deleteByTenantId"> | ||||
| delete from wx_mall_building where `tenant_id` = #{tenantId} | delete from wx_mall_building where `tenant_id` = #{tenantId} | ||||
| </delete> | </delete> | ||||
| <select id="findIdAndName" resultMap="BaseResultMap"> | |||||
| select | |||||
| `id`,`building_name` | |||||
| from wx_mall_building | |||||
| where `tenant_id` = #{tenantId} | |||||
| </select> | |||||
| </mapper> | </mapper> | ||||
| @@ -84,5 +84,11 @@ | |||||
| delete from wx_mall_floor where `tenant_id` = #{tenantId} | delete from wx_mall_floor where `tenant_id` = #{tenantId} | ||||
| </delete> | </delete> | ||||
| <select id="findIdAndName" resultMap="BaseResultMap"> | |||||
| select | |||||
| `id`,`floor_name` | |||||
| from wx_mall_floor | |||||
| where `tenant_id` = #{tenantId} | |||||
| </select> | |||||
| </mapper> | </mapper> | ||||
| @@ -753,4 +753,22 @@ | |||||
| and s.`id` = #{shopId} | and s.`id` = #{shopId} | ||||
| </select> | </select> | ||||
| <select id="newFindListCVo" parameterType="hashmap" resultType="com.iformall.domain.vo.WxMerchantVo"> | |||||
| select | |||||
| id,img_url imgUrl,name,link_phone linkPhone,status,business_id businessId | |||||
| FROM wx_merchant | |||||
| where is_del=0 | |||||
| <if test=" null != tenantId and '' != tenantId"> | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != merchantIds "> | |||||
| and id in | |||||
| <foreach collection="merchantIds" index="index" item="idItem" open="(" separator="," close=")"> | |||||
| #{idItem} | |||||
| </foreach> | |||||
| </if> | |||||
| order by top_time desc | |||||
| </select> | |||||
| </mapper> | </mapper> | ||||
| @@ -619,7 +619,8 @@ | |||||
| <select id="findShopVoList" parameterType="java.util.Map" resultMap="ShopVoResultMap"> | <select id="findShopVoList" parameterType="java.util.Map" resultMap="ShopVoResultMap"> | ||||
| select s.id,s.shop_number,b.building_name,f.floor_name,s.addr,s.baidu_poi,s.manager_phone,s.manager | select s.id,s.shop_number,b.building_name,f.floor_name,s.addr,s.baidu_poi,s.manager_phone,s.manager | ||||
| from wx_shop s left join wx_merchant_shop ms on ms.shop_id=s.id | |||||
| from wx_shop s | |||||
| left join wx_merchant_shop ms on ms.shop_id=s.id | |||||
| left join wx_merchant m on ms.merchant_id=m.id | left join wx_merchant m on ms.merchant_id=m.id | ||||
| left join wx_mall_building b on s.building=b.id | left join wx_mall_building b on s.building=b.id | ||||
| left join wx_mall_floor f on s.floor=f.id | left join wx_mall_floor f on s.floor=f.id | ||||
| @@ -730,4 +731,20 @@ | |||||
| and s.`parent_tenant_id` = #{parentTenantId} | and s.`parent_tenant_id` = #{parentTenantId} | ||||
| </if> | </if> | ||||
| </select> | </select> | ||||
| <select id="findShopVoList" parameterType="java.util.Map" resultType="com.iformall.domain.vo.WxShopVo"> | |||||
| select id,shop_number shopNumber,addr,building,floor | |||||
| from wx_shop | |||||
| where is_del=0 | |||||
| <if test=" null != tenantId and '' != tenantId"> | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != shopIds "> | |||||
| and id in | |||||
| <foreach collection="shopIds" index="index" item="idItem" open="(" separator="," close=")"> | |||||
| #{idItem} | |||||
| </foreach> | |||||
| </if> | |||||
| </select> | |||||
| </mapper> | </mapper> | ||||