|
|
|
@@ -14,7 +14,6 @@ import com.iformall.enums.EnumInvestUserType; |
|
|
|
import com.iformall.enums.EnumUserAdmin; |
|
|
|
import com.iformall.service.*; |
|
|
|
import com.iformall.shiro.PasswordHelper; |
|
|
|
import com.iformall.sms.EnumSMSChannel; |
|
|
|
import com.iformall.utils.Constant; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
@@ -25,7 +24,6 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.beans.factory.annotation.Qualifier; |
|
|
|
import org.springframework.data.redis.core.RedisTemplate; |
|
|
|
import org.springframework.util.Assert; |
|
|
|
import org.springframework.web.bind.WebDataBinder; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
import java.util.*; |
|
|
|
@@ -179,15 +177,18 @@ public class WxProjectConfigController extends BaseController { |
|
|
|
}else{ |
|
|
|
wxMall.setGroupSupport(EnumGroupSupport.NOT_SUPPORT.getCode()); |
|
|
|
} |
|
|
|
if(StringUtils.isBlank(wxMall.getBusinessHours())){ |
|
|
|
if(wxMall.getId() == null && StringUtils.isBlank(wxMall.getBusinessHours())){ |
|
|
|
wxMall.setBusinessHours("[]"); |
|
|
|
} |
|
|
|
if(StringUtils.isBlank(wxMall.getIntroduction())){ |
|
|
|
if(wxMall.getId() == null && StringUtils.isBlank(wxMall.getIntroduction())){ |
|
|
|
wxMall.setIntroduction(""); |
|
|
|
} |
|
|
|
if(StringUtils.isBlank(wxMall.getImg())){ |
|
|
|
if(wxMall.getId() == null && StringUtils.isBlank(wxMall.getImg())){ |
|
|
|
wxMall.setImg(""); |
|
|
|
} |
|
|
|
if(wxMall.getId() == null && StringUtils.isBlank(wxMall.getWeapNote())){ |
|
|
|
wxMall.setWeapNote("{}"); |
|
|
|
} |
|
|
|
wxProjectConfigService.initMall(wxMall); |
|
|
|
|
|
|
|
return new ResultData(); |
|
|
|
@@ -288,26 +289,26 @@ public class WxProjectConfigController extends BaseController { |
|
|
|
wxAuthorizerInfo.updateTenantInfo(wxAppinfo); |
|
|
|
wxAuthorizerInfo.setType(wxAppinfo.getType()); |
|
|
|
wxAuthorizerInfo.setAuthorizerAppid(wxAppinfo.getAppId()); |
|
|
|
if(wxAuthorizerInfo.getAuthorizationStatus() == null){ |
|
|
|
if(wxAppinfo.getId() == null && wxAuthorizerInfo.getAuthorizationStatus() == null){ |
|
|
|
wxAuthorizerInfo.setAuthorizationStatus(0);//授权状态,0为已授权,1为已取消授权 |
|
|
|
wxAuthorizerInfo.setAuthTime(new Date()); |
|
|
|
} |
|
|
|
if(wxAuthorizerInfo.getBaseStatus() == null){ |
|
|
|
if(wxAppinfo.getId() == null && wxAuthorizerInfo.getBaseStatus() == null){ |
|
|
|
wxAuthorizerInfo.setBaseStatus(0);//微信基础版本设置状态,0为已设置,1为设置失败 |
|
|
|
wxAuthorizerInfo.setBaseTime(new Date()); |
|
|
|
} |
|
|
|
if(wxAuthorizerInfo.getDomainStatus() == null){ |
|
|
|
if(wxAppinfo.getId() == null && wxAuthorizerInfo.getDomainStatus() == null){ |
|
|
|
wxAuthorizerInfo.setDomainStatus(0);//服务器域名设置状态,0为已设置,1为设置失败 |
|
|
|
wxAuthorizerInfo.setDomainTime(new Date()); |
|
|
|
} |
|
|
|
if(wxAuthorizerInfo.getWebdomainStatus() == null){ |
|
|
|
if(wxAppinfo.getId() == null && wxAuthorizerInfo.getWebdomainStatus() == null){ |
|
|
|
wxAuthorizerInfo.setWebdomainStatus(0);//服务器业务域名设置状态,0为已设置,1为设置失败 |
|
|
|
wxAuthorizerInfo.setWebdomainTime(new Date()); |
|
|
|
} |
|
|
|
if(StringUtils.isBlank(wxAuthorizerInfo.getRefreshToken())){ |
|
|
|
if(wxAppinfo.getId() == null && StringUtils.isBlank(wxAuthorizerInfo.getRefreshToken())){ |
|
|
|
wxAuthorizerInfo.setRefreshToken(""); |
|
|
|
} |
|
|
|
if(StringUtils.isBlank(wxAuthorizerInfo.getAccessToken())){ |
|
|
|
if(wxAppinfo.getId() == null && StringUtils.isBlank(wxAuthorizerInfo.getAccessToken())){ |
|
|
|
wxAuthorizerInfo.setAccessToken(""); |
|
|
|
} |
|
|
|
wxAuthorizerInfoService.saveOrUpdate(wxAuthorizerInfo); |
|
|
|
@@ -447,19 +448,19 @@ public class WxProjectConfigController extends BaseController { |
|
|
|
if(wxPark.getNumber() == null){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); |
|
|
|
} |
|
|
|
if(StringUtils.isBlank(wxPark.getVendorParams())){ |
|
|
|
if(wxPark.getId() == null && StringUtils.isBlank(wxPark.getVendorParams())){ |
|
|
|
wxPark.setVendorParams("{}"); |
|
|
|
} |
|
|
|
if(wxPark.getVendorType() == null){ |
|
|
|
if(wxPark.getId() == null && wxPark.getVendorType() == null){ |
|
|
|
wxPark.setVendorType(0); |
|
|
|
} |
|
|
|
if(StringUtils.isBlank(wxPark.getParkId())){ |
|
|
|
if(wxPark.getId() == null && StringUtils.isBlank(wxPark.getParkId())){ |
|
|
|
wxPark.setParkId("0"); |
|
|
|
} |
|
|
|
if(StringUtils.isBlank(wxPark.getStopFee())){ |
|
|
|
if(wxPark.getId() == null && StringUtils.isBlank(wxPark.getStopFee())){ |
|
|
|
wxPark.setStopFee(""); |
|
|
|
} |
|
|
|
if(wxPark.getEntryExit() == null){ |
|
|
|
if(wxPark.getId() == null && wxPark.getEntryExit() == null){ |
|
|
|
wxPark.setEntryExit(1); |
|
|
|
} |
|
|
|
wxParkService.saveOrUpdate(wxPark); |
|
|
|
@@ -628,17 +629,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())){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); |
|
|
|
} |
|
|
|
if(StringUtils.isBlank(wxMall.getParentTenantId())){ |
|
|
|
String tenantId = (String) map.get("tenantId"); |
|
|
|
List<String> subTenantIds = (List<String>) map.get("subTenantIds"); |
|
|
|
|
|
|
|
if(StringUtils.isBlank(tenantId)){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); |
|
|
|
} |
|
|
|
// 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 +650,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 +663,23 @@ 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"); |
|
|
|
List<String> subTenantIds = (List<String>) map.get("subTenantIds"); |
|
|
|
String subTenantIdStrs = null; |
|
|
|
|
|
|
|
if(StringUtils.isBlank(tenantId)){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); |
|
|
|
} |
|
|
|
if(StringUtils.isBlank(wxMall.getParentTenantId())){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); |
|
|
|
if(subTenantIds == null || subTenantIds.size() == 0){ |
|
|
|
//return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); |
|
|
|
}else{ |
|
|
|
subTenantIdStrs = StringUtils.join(subTenantIds, ','); |
|
|
|
} |
|
|
|
TenantEntity TenantEntity = new TenantEntity(){{ |
|
|
|
setTenantId(wxMall.getParentTenantId()); |
|
|
|
setTenantId(tenantId); |
|
|
|
}}; |
|
|
|
WxMall parentWxMall = wxMallService.getByTenantInfo(TenantEntity); |
|
|
|
if(parentWxMall == null || parentWxMall.getSaleType() != 100 |
|
|
|
@@ -687,7 +696,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,subTenantIdStrs); |
|
|
|
|
|
|
|
return new ResultData(); |
|
|
|
}catch (Exception e){ |
|
|
|
|