Browse Source

fix bug

release_toaliyun_real
xiaohanzi 5 years ago
parent
commit
bd2d39039b
2 changed files with 6 additions and 4 deletions
  1. +0
    -3
      mallinkCApi/src/main/java/com/iformall/controller/WxCuserFloatingLayerController.java
  2. +6
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxCuserFloatingLayerServiceImpl.java

+ 0
- 3
mallinkCApi/src/main/java/com/iformall/controller/WxCuserFloatingLayerController.java View File

@@ -37,9 +37,6 @@ public class WxCuserFloatingLayerController extends BaseController {
@ApiImplicitParam(name = "openId", value = "openId", dataType = "String", paramType = "query", required = true),
@ApiImplicitParam(name = "appId", value = "appId", dataType = "String", paramType = "query", required = true)})
public ResultData getAppIcon(String openId, String appId) {
if (StringUtils.isBlank(openId)) {
return new ResultData(Result.UNLOGIN, "用户openId不能为空", null);
}
WxFloatingLayer wxFloatingLayer = wxCuserFloatingLayerService.getFloatingLayer(openId, appId);
return new ResultData(Result.SUCCESS, "查询成功", wxFloatingLayer);
}


+ 6
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxCuserFloatingLayerServiceImpl.java View File

@@ -13,6 +13,8 @@ import com.iformall.mapper.WxCUserMapper;
import com.iformall.mapper.WxCuserFloatingLayerMapper;
import com.iformall.mapper.WxFloatingLayerMapper;
import com.iformall.service.WxCuserFloatingLayerService;

import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -43,13 +45,16 @@ public class WxCuserFloatingLayerServiceImpl implements WxCuserFloatingLayerServ
@Override
public WxFloatingLayer getFloatingLayer(String openId, String appId) {
WxAppinfo appinfo = appinfoMapper.findByAppId(appId);
if (StringUtils.isBlank(openId)) {
return getWxFloatingLayer(appinfo.getTenantInfo());
}
//1 查看是否存在用户,用户不存在 直接返回浮层信息
WxCUser user = new WxCUser();
user.setOpenId(openId);
user.setAppId(appId);
user.updateTenantInfo(appinfo);
WxCUser byOpenId = wxCUserMapper.findByOpenId(user);
logger.info("appinfo.gettenantinfo"+appinfo.getTenantInfo());
logger.info("appinfo.gettenantinfo"+appinfo.getTenantInfo().getTenantId());
if (byOpenId == null) {
return getWxFloatingLayer(appinfo.getTenantInfo());
}


Loading…
Cancel
Save