Browse Source

fix bug

release_toaliyun_real
winter 3 years ago
parent
commit
4cbe9f4f13
5 changed files with 12 additions and 40 deletions
  1. +0
    -2
      mallinkAdmin/src/main/java/com/iformall/controller/base/BaseController.java
  2. +0
    -15
      mallinkAdmin/src/main/java/com/iformall/interceptor/CurrentTenantInterceptor.java
  3. +12
    -10
      mallinkBApi/src/main/java/com/iformall/controller/WxCouponOrderController.java
  4. +0
    -12
      mallinkService/src/main/java/com/iformall/domain/po/base/TenantEntity.java
  5. +0
    -1
      mallinkService/src/main/java/com/iformall/utils/Constant.java

+ 0
- 2
mallinkAdmin/src/main/java/com/iformall/controller/base/BaseController.java View File

@@ -75,11 +75,9 @@ public class BaseController {
Session session = SecurityUtils.getSubject().getSession();
String tenantId = (String)session.getAttribute(UserSession.tenantId);
String parentTenantId = (String)session.getAttribute(UserSession.parentTenantId);
boolean isChildMall = (boolean)session.getAttribute(Constant.IS_CHILD_MALL);
TenantEntity tenantEntity = new TenantEntity();
tenantEntity.setTenantId(tenantId);
tenantEntity.setParentTenantId(parentTenantId);
tenantEntity.setChildMall(isChildMall);
return tenantEntity;
}



+ 0
- 15
mallinkAdmin/src/main/java/com/iformall/interceptor/CurrentTenantInterceptor.java View File

@@ -24,23 +24,8 @@ public class CurrentTenantInterceptor extends HandlerInterceptorAdapter {
@Override
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 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);


+ 12
- 10
mallinkBApi/src/main/java/com/iformall/controller/WxCouponOrderController.java View File

@@ -285,7 +285,7 @@ public class WxCouponOrderController extends BaseController {
}

@TenantIgnore
@ApiOperation(value = "核销接口", notes = "{\"couponOrderId\":\"string\"}")
@ApiOperation(value = "核销接口", notes = "{\"couponOrderId\":\"string\",\"couponTenantId\":\"string\"}")
@PostMapping("verify")
public ResultData verify(@RequestBody Map<String, String> paramMap) {
logger.info("couponOrderController.verify:" + paramMap.toString());
@@ -319,14 +319,16 @@ public class WxCouponOrderController extends BaseController {
TenantEntity tenantEntity = getTenantInfo();
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);
}else {
//查询父
parentTenantEntity = new TenantEntity();
parentTenantEntity.setTenantId(couponTenantId);
parentTenantEntity.setParentTenantId(null);
wxCouponOrderCVo = wxCouponOrderService.detailCUserVo(couponOrderIdStr,parentTenantEntity);
}
if (wxCouponOrderCVo == null)
@@ -368,8 +370,8 @@ public class WxCouponOrderController extends BaseController {
}

WxCouponOrder wxCouponOrder = null;
if (tenantEntity.isChildMall()) {
wxCouponOrder = wxCouponOrderService.getById(couponOrderId,tenantEntity.getParentTenantId());
if (null != parentTenantEntity ) {
wxCouponOrder = wxCouponOrderService.getById(couponOrderId,parentTenantEntity.getTenantId());
}else {
wxCouponOrder = wxCouponOrderService.getById(couponOrderId,tenantEntity.getTenantId());
}


+ 0
- 12
mallinkService/src/main/java/com/iformall/domain/po/base/TenantEntity.java View File

@@ -27,10 +27,6 @@ public class TenantEntity extends BaseEntity {
@TableField(exist = false)
protected String finalTenantId;
@io.swagger.annotations.ApiModelProperty(value="是否是集团统一小程序版本下的子广场",name="isChildMall")
@TableField(exist = false)
protected boolean isChildMall;

@JsonIgnore
@TableField(exist = false)
protected String shardTableSuffix;
@@ -102,12 +98,4 @@ public class TenantEntity extends BaseEntity {
this.tenantIdList = tenantIdList;
}

public boolean isChildMall() {
return isChildMall;
}

public void setChildMall(boolean isChildMall) {
this.isChildMall = isChildMall;
}
}

+ 0
- 1
mallinkService/src/main/java/com/iformall/utils/Constant.java View File

@@ -64,7 +64,6 @@ public class Constant {
public static final String APP_Id = "APP_Id";
public static final String APP_NAME = "APP_NAME";
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";



Loading…
Cancel
Save