| @@ -134,12 +134,9 @@ public class WxMallServiceImpl implements WxMallService { | |||||
| return mall; | return mall; | ||||
| } | } | ||||
| // 不存在,从数据库中获取 | // 不存在,从数据库中获取 | ||||
| WxMall q = new WxMall() {{ | |||||
| setTenantId(tenantEntity.getTenantId()); | |||||
| }}; | |||||
| WxMall mall = null; | WxMall mall = null; | ||||
| try { | try { | ||||
| mall = wxMallMapper.selectOne(new QueryWrapper<>(q)); | |||||
| mall = wxMallMapper.getByTenantId(tenantEntity.getTenantId()); | |||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error(e.getMessage()); | logger.error(e.getMessage()); | ||||
| } | } | ||||
| @@ -336,7 +336,7 @@ public class MallUserInfoController extends BaseController { | |||||
| } | } | ||||
| WxMsgValidationcode wxMsgValidationcode = new WxMsgValidationcode(); | WxMsgValidationcode wxMsgValidationcode = new WxMsgValidationcode(); | ||||
| wxMsgValidationcode.setTenantId(user.getTenantId()); | |||||
| wxMsgValidationcode.updateTenantInfo(getTenantInfo()); | |||||
| wxMsgValidationcode.setPhone(user.getPhone()); | wxMsgValidationcode.setPhone(user.getPhone()); | ||||
| wxMsgValidationcode.setType(type); | wxMsgValidationcode.setType(type); | ||||
| return wxMsgValidationcodeService.sendvalidationcode(wxMsgValidationcode); | return wxMsgValidationcodeService.sendvalidationcode(wxMsgValidationcode); | ||||
| @@ -13,6 +13,7 @@ import com.iformall.common.ResultData; | |||||
| import com.iformall.config.AwsProperty; | import com.iformall.config.AwsProperty; | ||||
| import com.iformall.controller.base.BaseController; | import com.iformall.controller.base.BaseController; | ||||
| import com.iformall.domain.po.MallResource; | import com.iformall.domain.po.MallResource; | ||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.service.MallResourceService; | import com.iformall.service.MallResourceService; | ||||
| import com.iformall.utils.Constant; | import com.iformall.utils.Constant; | ||||
| import com.iformall.utils.ImgUtil; | import com.iformall.utils.ImgUtil; | ||||
| @@ -1,13 +1,9 @@ | |||||
| package com.iformall.controller.sys; | package com.iformall.controller.sys; | ||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.common.Result; | |||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.controller.base.BaseController; | import com.iformall.controller.base.BaseController; | ||||
| import com.iformall.domain.po.WxAdminLog; | import com.iformall.domain.po.WxAdminLog; | ||||
| import com.iformall.service.WxAdminLogService; | import com.iformall.service.WxAdminLogService; | ||||
| import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiImplicitParams; | |||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| @@ -26,8 +22,7 @@ public class WxAdminLogController extends BaseController { | |||||
| @PostMapping("pvlog") | @PostMapping("pvlog") | ||||
| public ResultData pvLog(@RequestBody WxAdminLog wxAdminLog) { | public ResultData pvLog(@RequestBody WxAdminLog wxAdminLog) { | ||||
| logger.debug("[" + getIpAddr() + "] WxAdminLogController::pvLog"); | logger.debug("[" + getIpAddr() + "] WxAdminLogController::pvLog"); | ||||
| String tenantId = getTenantId(); | |||||
| wxAdminLog.setTenantId(tenantId); | |||||
| wxAdminLog.updateTenantInfo(getTenantInfo()); | |||||
| wxAdminLogService.saveLogCount(wxAdminLog); | wxAdminLogService.saveLogCount(wxAdminLog); | ||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @@ -82,12 +82,27 @@ public class BaseController { | |||||
| return user; | return user; | ||||
| } | } | ||||
| @Deprecated | |||||
| public String getTenantId() { | public String getTenantId() { | ||||
| HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); | HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); | ||||
| String tenantId = (String) request.getAttribute(AuthHandshakeInterceptor.TENANT_ID); | String tenantId = (String) request.getAttribute(AuthHandshakeInterceptor.TENANT_ID); | ||||
| return tenantId; | return tenantId; | ||||
| } | } | ||||
| /** | |||||
| * 返回租户信息 | |||||
| * @return | |||||
| */ | |||||
| public TenantEntity getTenantInfo(){ | |||||
| HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); | |||||
| String tenantId = (String)request.getAttribute(AuthHandshakeInterceptor.TENANT_ID); | |||||
| TenantEntity tenantEntity = new TenantEntity(){{ | |||||
| setTenantId(tenantId); | |||||
| }}; | |||||
| return tenantEntity; | |||||
| } | |||||
| public WxAppinfo getAppInfo(String appId) { | public WxAppinfo getAppInfo(String appId) { | ||||
| return wxAppinfoService.getByAppId(appId); | return wxAppinfoService.getByAppId(appId); | ||||
| } | } | ||||