| @@ -75,11 +75,9 @@ public class BaseController { | |||||
| Session session = SecurityUtils.getSubject().getSession(); | Session session = SecurityUtils.getSubject().getSession(); | ||||
| String tenantId = (String)session.getAttribute(UserSession.tenantId); | String tenantId = (String)session.getAttribute(UserSession.tenantId); | ||||
| String parentTenantId = (String)session.getAttribute(UserSession.parentTenantId); | String parentTenantId = (String)session.getAttribute(UserSession.parentTenantId); | ||||
| boolean isChildMall = (boolean)session.getAttribute(Constant.IS_CHILD_MALL); | |||||
| TenantEntity tenantEntity = new TenantEntity(); | TenantEntity tenantEntity = new TenantEntity(); | ||||
| tenantEntity.setTenantId(tenantId); | tenantEntity.setTenantId(tenantId); | ||||
| tenantEntity.setParentTenantId(parentTenantId); | tenantEntity.setParentTenantId(parentTenantId); | ||||
| tenantEntity.setChildMall(isChildMall); | |||||
| return tenantEntity; | return tenantEntity; | ||||
| } | } | ||||
| @@ -24,23 +24,8 @@ public class CurrentTenantInterceptor extends HandlerInterceptorAdapter { | |||||
| @Override | @Override | ||||
| public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { | ||||
| //集团版中针对某一商场的业务需要传递mallTenantId | |||||
| String mallTenantId = request.getHeader("mallTenantId"); | |||||
| if(StringUtils.isBlank(mallTenantId)){ | |||||
| mallTenantId = request.getParameter("mallTenantId"); | |||||
| } | |||||
| String tenantId = (String)request.getSession().getAttribute(UserSession.tenantId); | String tenantId = (String)request.getSession().getAttribute(UserSession.tenantId); | ||||
| String parenTenantId = (String)request.getSession().getAttribute(UserSession.parentTenantId); | String parenTenantId = (String)request.getSession().getAttribute(UserSession.parentTenantId); | ||||
| boolean isChildMall = false; | |||||
| // if (StringUtils.isNotBlank(mallTenantId) && (!mallTenantId.equals(tenantId))) { | |||||
| // parenTenantId = tenantId; | |||||
| // tenantId = mallTenantId; | |||||
| // isChildMall = true; | |||||
| // } | |||||
| // request.getSession().setAttribute(UserSession.tenantId,tenantId); | |||||
| // request.getSession().setAttribute(UserSession.parentTenantId,parenTenantId); | |||||
| request.getSession().setAttribute(Constant.IS_CHILD_MALL,isChildMall); | |||||
| TenantThreadLocal.setCurrentThreadTenant(tenantId, parenTenantId); | TenantThreadLocal.setCurrentThreadTenant(tenantId, parenTenantId); | ||||
| @@ -285,7 +285,7 @@ public class WxCouponOrderController extends BaseController { | |||||
| } | } | ||||
| @TenantIgnore | @TenantIgnore | ||||
| @ApiOperation(value = "核销接口", notes = "{\"couponOrderId\":\"string\"}") | |||||
| @ApiOperation(value = "核销接口", notes = "{\"couponOrderId\":\"string\",\"couponTenantId\":\"string\"}") | |||||
| @PostMapping("verify") | @PostMapping("verify") | ||||
| public ResultData verify(@RequestBody Map<String, String> paramMap) { | public ResultData verify(@RequestBody Map<String, String> paramMap) { | ||||
| logger.info("couponOrderController.verify:" + paramMap.toString()); | logger.info("couponOrderController.verify:" + paramMap.toString()); | ||||
| @@ -319,14 +319,16 @@ public class WxCouponOrderController extends BaseController { | |||||
| TenantEntity tenantEntity = getTenantInfo(); | TenantEntity tenantEntity = getTenantInfo(); | ||||
| WxCouponOrderCVo wxCouponOrderCVo = null; | WxCouponOrderCVo wxCouponOrderCVo = null; | ||||
| if (tenantEntity.isChildMall()) { | |||||
| //查询父 | |||||
| TenantEntity parentTenant = new TenantEntity(); | |||||
| parentTenant.setTenantId(tenantEntity.getParentTenantId()); | |||||
| parentTenant.setParentTenantId(null); | |||||
| wxCouponOrderCVo = wxCouponOrderService.detailCUserVo(couponOrderIdStr,parentTenant); | |||||
| }else { | |||||
| String couponTenantId = paramMap.get("couponTenantId"); | |||||
| TenantEntity parentTenantEntity = null; | |||||
| if (StringUtils.isBlank(couponTenantId) || "null".equals(couponTenantId) || "NULL".equals(couponTenantId)) { | |||||
| wxCouponOrderCVo = wxCouponOrderService.detailCUserVo(couponOrderIdStr,tenantEntity); | wxCouponOrderCVo = wxCouponOrderService.detailCUserVo(couponOrderIdStr,tenantEntity); | ||||
| }else { | |||||
| //查询父 | |||||
| parentTenantEntity = new TenantEntity(); | |||||
| parentTenantEntity.setTenantId(couponTenantId); | |||||
| parentTenantEntity.setParentTenantId(null); | |||||
| wxCouponOrderCVo = wxCouponOrderService.detailCUserVo(couponOrderIdStr,parentTenantEntity); | |||||
| } | } | ||||
| if (wxCouponOrderCVo == null) | if (wxCouponOrderCVo == null) | ||||
| @@ -368,8 +370,8 @@ public class WxCouponOrderController extends BaseController { | |||||
| } | } | ||||
| WxCouponOrder wxCouponOrder = null; | WxCouponOrder wxCouponOrder = null; | ||||
| if (tenantEntity.isChildMall()) { | |||||
| wxCouponOrder = wxCouponOrderService.getById(couponOrderId,tenantEntity.getParentTenantId()); | |||||
| if (null != parentTenantEntity ) { | |||||
| wxCouponOrder = wxCouponOrderService.getById(couponOrderId,parentTenantEntity.getTenantId()); | |||||
| }else { | }else { | ||||
| wxCouponOrder = wxCouponOrderService.getById(couponOrderId,tenantEntity.getTenantId()); | wxCouponOrder = wxCouponOrderService.getById(couponOrderId,tenantEntity.getTenantId()); | ||||
| } | } | ||||
| @@ -27,10 +27,6 @@ public class TenantEntity extends BaseEntity { | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| protected String finalTenantId; | protected String finalTenantId; | ||||
| @io.swagger.annotations.ApiModelProperty(value="是否是集团统一小程序版本下的子广场",name="isChildMall") | |||||
| @TableField(exist = false) | |||||
| protected boolean isChildMall; | |||||
| @JsonIgnore | @JsonIgnore | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| protected String shardTableSuffix; | protected String shardTableSuffix; | ||||
| @@ -102,12 +98,4 @@ public class TenantEntity extends BaseEntity { | |||||
| this.tenantIdList = tenantIdList; | this.tenantIdList = tenantIdList; | ||||
| } | } | ||||
| public boolean isChildMall() { | |||||
| return isChildMall; | |||||
| } | |||||
| public void setChildMall(boolean isChildMall) { | |||||
| this.isChildMall = isChildMall; | |||||
| } | |||||
| } | } | ||||
| @@ -64,7 +64,6 @@ public class Constant { | |||||
| public static final String APP_Id = "APP_Id"; | public static final String APP_Id = "APP_Id"; | ||||
| public static final String APP_NAME = "APP_NAME"; | public static final String APP_NAME = "APP_NAME"; | ||||
| public static final String APP_INFO = "APPINFO"; | public static final String APP_INFO = "APPINFO"; | ||||
| public static final String IS_CHILD_MALL = "IS_CHILD_MALL"; | |||||
| public static final String LOGIN_B_USER_KEY = "LOGIN_B_USER_KEY"; | public static final String LOGIN_B_USER_KEY = "LOGIN_B_USER_KEY"; | ||||