xhxu 5 лет назад
Родитель
Сommit
73d5f0d4ac
4 измененных файлов: 33 добавлений и 47 удалений
  1. +0
    -2
      mallinkService/src/main/java/com/iformall/service/WxMerchantService.java
  2. +2
    -20
      mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java
  3. +31
    -0
      mallinkTTCApi/src/main/java/com/iformall/controller/WxBusinessController.java
  4. +0
    -25
      mallinkTTCApi/src/main/java/com/iformall/controller/WxMerchantController.java

+ 0
- 2
mallinkService/src/main/java/com/iformall/service/WxMerchantService.java Просмотреть файл

@@ -161,6 +161,4 @@ public interface WxMerchantService {
List<Long> getMerchantShopIds(Long merchantId); List<Long> getMerchantShopIds(Long merchantId);


@Async
void followMerchern(TenantEntity tenantInfo, Long memberId, Long id);
} }

+ 2
- 20
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.*;
import com.iformall.domain.po.base.BaseEntity; import com.iformall.domain.po.base.BaseEntity;
import com.iformall.domain.po.base.TenantEntity; import com.iformall.domain.po.base.TenantEntity;
import com.iformall.domain.po.tt.TtUserFollow;
import com.iformall.domain.vo.*; import com.iformall.domain.vo.*;
import com.iformall.enums.*; import com.iformall.enums.*;
import com.iformall.exception.MallinkException; import com.iformall.exception.MallinkException;
@@ -24,6 +23,7 @@ import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation; import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Propagation;
@@ -85,6 +85,7 @@ public class WxMerchantServiceImpl implements WxMerchantService {
WxCouponMerchantMapper wxCouponMerchantMapper; WxCouponMerchantMapper wxCouponMerchantMapper;


@Autowired @Autowired
@Lazy
WxRentContractService wxRentContractService; WxRentContractService wxRentContractService;


@Autowired @Autowired
@@ -102,9 +103,6 @@ public class WxMerchantServiceImpl implements WxMerchantService {
@Autowired @Autowired
WxPropertyContractService wxPropertyContractService; WxPropertyContractService wxPropertyContractService;


@Autowired
TtUserFollowMapper ttUserFollowMapper;

@Override @Override
public PageInfo<WxMerchant> listAsPage(WxMerchant record, Integer pageIndex, Integer pageSize) { public PageInfo<WxMerchant> listAsPage(WxMerchant record, Integer pageIndex, Integer pageSize) {
PageHelper.startPage(pageIndex, pageSize); PageHelper.startPage(pageIndex, pageSize);
@@ -944,20 +942,4 @@ public class WxMerchantServiceImpl implements WxMerchantService {
return wxMerchantShopMapper.findShopIds(merchantId); 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();
}
}
} }

+ 31
- 0
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));
}

}

+ 0
- 25
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();
}

} }

Загрузка…
Отмена
Сохранить