From 73d5f0d4ace7a8fe3c4ea4c81f45d5a4f15e09fe Mon Sep 17 00:00:00 2001 From: xhxu Date: Mon, 24 May 2021 14:55:38 +0800 Subject: [PATCH] tt --- .../iformall/service/WxMerchantService.java | 2 -- .../service/impl/WxMerchantServiceImpl.java | 22 ++----------- .../controller/WxBusinessController.java | 31 +++++++++++++++++++ .../controller/WxMerchantController.java | 25 --------------- 4 files changed, 33 insertions(+), 47 deletions(-) create mode 100644 mallinkTTCApi/src/main/java/com/iformall/controller/WxBusinessController.java diff --git a/mallinkService/src/main/java/com/iformall/service/WxMerchantService.java b/mallinkService/src/main/java/com/iformall/service/WxMerchantService.java index 8f74a22c3..ff75194a9 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxMerchantService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxMerchantService.java @@ -161,6 +161,4 @@ public interface WxMerchantService { List getMerchantShopIds(Long merchantId); - @Async - void followMerchern(TenantEntity tenantInfo, Long memberId, Long id); } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java index c18b86ddf..73a729fdc 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java @@ -12,7 +12,6 @@ import com.iformall.domain.dto.WxMerchantDto; import com.iformall.domain.po.*; import com.iformall.domain.po.base.BaseEntity; import com.iformall.domain.po.base.TenantEntity; -import com.iformall.domain.po.tt.TtUserFollow; import com.iformall.domain.vo.*; import com.iformall.enums.*; import com.iformall.exception.MallinkException; @@ -24,6 +23,7 @@ import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Isolation; import org.springframework.transaction.annotation.Propagation; @@ -85,6 +85,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { WxCouponMerchantMapper wxCouponMerchantMapper; @Autowired + @Lazy WxRentContractService wxRentContractService; @Autowired @@ -102,9 +103,6 @@ public class WxMerchantServiceImpl implements WxMerchantService { @Autowired WxPropertyContractService wxPropertyContractService; - @Autowired - TtUserFollowMapper ttUserFollowMapper; - @Override public PageInfo listAsPage(WxMerchant record, Integer pageIndex, Integer pageSize) { PageHelper.startPage(pageIndex, pageSize); @@ -944,20 +942,4 @@ public class WxMerchantServiceImpl implements WxMerchantService { return wxMerchantShopMapper.findShopIds(merchantId); } - @Override - public void followMerchern(TenantEntity tenantEntity, Long memberId, Long id) { - final IdWorker idWorker = IdWorker.get(); - TtUserFollow userFollow = new TtUserFollow(); - userFollow.setId(idWorker.nextId()); - userFollow.updateTenantInfo(tenantEntity); - userFollow.setUserId(memberId); - userFollow.setMerchernId(id); - userFollow.setCreateDate(new Date()); - userFollow.setUpdateDate(new Date()); - try { - ttUserFollowMapper.insert(userFollow); - } catch (Exception e) { -// e.printStackTrace(); - } - } } diff --git a/mallinkTTCApi/src/main/java/com/iformall/controller/WxBusinessController.java b/mallinkTTCApi/src/main/java/com/iformall/controller/WxBusinessController.java new file mode 100644 index 000000000..870298919 --- /dev/null +++ b/mallinkTTCApi/src/main/java/com/iformall/controller/WxBusinessController.java @@ -0,0 +1,31 @@ +package com.iformall.controller; + +import com.iformall.annotation.RedisCache; +import com.iformall.common.ResultData; +import com.iformall.service.WxBusinessService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/api/wxBusiness") +@Api(description = "业态查询接口") +public class WxBusinessController extends BaseController { + private final Logger logger = LoggerFactory.getLogger(this.getClass()); + + @Autowired + private WxBusinessService wxBusinessService; + + @RedisCache + @ApiOperation("业态全列表接口") + @GetMapping("listAll") + public ResultData listAll(Integer filter) { + return new ResultData(wxBusinessService.findListAll(getTenantInfo(),filter)); + } + +} diff --git a/mallinkTTCApi/src/main/java/com/iformall/controller/WxMerchantController.java b/mallinkTTCApi/src/main/java/com/iformall/controller/WxMerchantController.java index 1bc37ce8d..4f75a17d3 100644 --- a/mallinkTTCApi/src/main/java/com/iformall/controller/WxMerchantController.java +++ b/mallinkTTCApi/src/main/java/com/iformall/controller/WxMerchantController.java @@ -71,29 +71,4 @@ public class WxMerchantController extends BaseController { } - - - @ApiOperation("关注") - @GetMapping("/collectCoupon") - @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) - public ResultData collectCoupon(@RequestParam Long id) { - logger.debug("[" + getIpAddr() + "] WxMerchantController::collectCoupon"); - if (id == null) { - return new ResultData(ResultData.ERROR, "缺少id"); - } - WxMerchant byId = wxMerchantService.getById(id); - if(byId == null){ - return new ResultData(ErrorCode.SYS_PARAMETER_ERROR,"找不到数据"); - } - Long memberId; - try { - memberId = getMemberId(); - } catch (MallinkException e) { - return new ResultData(e.getErrorCode(), e.getMessage()); - } - - wxMerchantService.followMerchern(getTenantInfo(),memberId,byId.getId()); - return new ResultData(); - } - }