|
|
|
@@ -628,17 +628,20 @@ public class WxProjectConfigController extends BaseController { |
|
|
|
@PostMapping("/init/submall") |
|
|
|
@SystemControllerLog(description = "子广场-更新") |
|
|
|
@TenantIgnore |
|
|
|
public ResultData initSubmall(@RequestBody WxMall wxMall) { |
|
|
|
public ResultData initSubmall(@RequestBody Map<String, Object> map) { |
|
|
|
logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initSubmall"); |
|
|
|
try { |
|
|
|
if(StringUtils.isBlank(wxMall.getTenantId())){ |
|
|
|
String tenantId = (String) map.get("tenantId"); |
|
|
|
String[] subTenantIds = (String[]) map.get("subTenantIds"); |
|
|
|
|
|
|
|
if(StringUtils.isBlank(tenantId)){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); |
|
|
|
} |
|
|
|
if(StringUtils.isBlank(wxMall.getParentTenantId())){ |
|
|
|
if(subTenantIds == null || subTenantIds.length == 0){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); |
|
|
|
} |
|
|
|
TenantEntity TenantEntity = new TenantEntity(){{ |
|
|
|
setTenantId(wxMall.getParentTenantId()); |
|
|
|
setTenantId(tenantId); |
|
|
|
}}; |
|
|
|
WxMall parentWxMall = wxMallService.getByTenantInfo(TenantEntity); |
|
|
|
if(parentWxMall == null || parentWxMall.getSaleType() != 100 |
|
|
|
@@ -646,8 +649,7 @@ public class WxProjectConfigController extends BaseController { |
|
|
|
|| StringUtils.isNotBlank(parentWxMall.getParentTenantId())){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); |
|
|
|
} |
|
|
|
String[] tenantIds = wxMall.getTenantId().split(","); |
|
|
|
wxProjectConfigService.initSubmall(wxMall.getParentTenantId(),tenantIds); |
|
|
|
wxProjectConfigService.initSubmall(tenantId,subTenantIds); |
|
|
|
|
|
|
|
return new ResultData(); |
|
|
|
}catch (Exception e){ |
|
|
|
@@ -660,17 +662,20 @@ public class WxProjectConfigController extends BaseController { |
|
|
|
@PostMapping("/init/after/group") |
|
|
|
@SystemControllerLog(description = "商场-数据更新") |
|
|
|
@TenantIgnore |
|
|
|
public ResultData initAfterGroup(@RequestBody WxMall wxMall) { |
|
|
|
public ResultData initAfterGroup(@RequestBody Map<String, Object> map) { |
|
|
|
logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initAfterGroup"); |
|
|
|
try { |
|
|
|
if(StringUtils.isBlank(wxMall.getTenantId())){ |
|
|
|
String tenantId = (String) map.get("tenantId"); |
|
|
|
String[] subTenantIds = (String[]) map.get("subTenantIds"); |
|
|
|
|
|
|
|
if(StringUtils.isBlank(tenantId)){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); |
|
|
|
} |
|
|
|
if(StringUtils.isBlank(wxMall.getParentTenantId())){ |
|
|
|
if(subTenantIds == null || subTenantIds.length == 0){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); |
|
|
|
} |
|
|
|
TenantEntity TenantEntity = new TenantEntity(){{ |
|
|
|
setTenantId(wxMall.getParentTenantId()); |
|
|
|
setTenantId(tenantId); |
|
|
|
}}; |
|
|
|
WxMall parentWxMall = wxMallService.getByTenantInfo(TenantEntity); |
|
|
|
if(parentWxMall == null || parentWxMall.getSaleType() != 100 |
|
|
|
@@ -687,7 +692,9 @@ public class WxProjectConfigController extends BaseController { |
|
|
|
}else{ |
|
|
|
openRedisTemplate.opsForValue().set(key,"1",3000, TimeUnit.SECONDS); |
|
|
|
} |
|
|
|
wxProjectConfigService.initAfterGroup(wxMall.getParentTenantId(),wxMall.getTenantId()); |
|
|
|
|
|
|
|
String join = StringUtils.join(subTenantIds, ','); |
|
|
|
wxProjectConfigService.initAfterGroup(tenantId,join); |
|
|
|
|
|
|
|
return new ResultData(); |
|
|
|
}catch (Exception e){ |
|
|
|
|