feat: 租户访客策略 SQL、访客邀约验证包、component-org 与发布脚本

- docs/sql: organization_* 与 tenant_* 访客楼层策略脚本
- docs/testing: 访客邀约页初始化验证、pack 脚本与 README(忽略 dist/__pycache__)
- maven-ninca-common-component-organization: CpImageStoreServiceImpl、starter、run-verify、releases 脚本与 javap 审计 JSON
- docs/superpowers: component-org 生产问题修复计划
- scripts/test-env/prepare-db.sh 更新

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
反编译工作区
2026-05-06 22:00:16 +08:00
parent 86cf41890e
commit 25db029859
24 changed files with 6016 additions and 27 deletions
@@ -0,0 +1,833 @@
/*
* 自 vendor cwos-component-organization-service-v2.9.2_xinghewan 反编译恢复;与现场逻辑一致。
* 原因为 reactor 曾排除 vendor jar 导致该 @Service 未打入 classpath。
*/
package cn.cloudwalk.service.organization.service;
import cn.cloudwalk.client.account.account.param.GeneralQueryBusinessParam;
import cn.cloudwalk.client.account.account.result.AcBusinessDTO;
import cn.cloudwalk.client.account.account.service.AcBusinessService;
import cn.cloudwalk.client.aggregate.application.param.ApplicationImageStoreQueryParam;
import cn.cloudwalk.client.aggregate.application.service.ApplicationImageStoreService;
import cn.cloudwalk.client.aggregate.common.enums.DelStatusEnum;
import cn.cloudwalk.client.aggregate.common.enums.SyncStatusEnum;
import cn.cloudwalk.client.aggregate.device.param.DeviceImageStoreQueryParam;
import cn.cloudwalk.client.aggregate.device.result.DeviceImageStoreQueryResult;
import cn.cloudwalk.client.aggregate.device.service.AggDeviceImageStoreService;
import cn.cloudwalk.client.aggregate.group.param.AgImageStoreAddParam;
import cn.cloudwalk.client.aggregate.group.param.AgImageStoreEditParam;
import cn.cloudwalk.client.aggregate.group.param.AgImageStoreKeyParam;
import cn.cloudwalk.client.aggregate.group.param.AgImageStoreQueryParam;
import cn.cloudwalk.client.aggregate.group.result.AgImageStoreResult;
import cn.cloudwalk.client.aggregate.group.service.AgImageStoreService;
import cn.cloudwalk.client.device.mgn.atomic.param.CoreDeviceQueryParam;
import cn.cloudwalk.client.device.mgn.atomic.result.AtomicDeviceGetResult;
import cn.cloudwalk.client.device.mgn.atomic.service.AtomicDeviceService;
import cn.cloudwalk.client.organization.common.enums.CpImageStoreMatchPatternEnum;
import cn.cloudwalk.client.organization.service.store.param.AddImageStoreParam;
import cn.cloudwalk.client.organization.service.store.param.AssociatedParam;
import cn.cloudwalk.client.organization.service.store.param.BaseImageStoreParam;
import cn.cloudwalk.client.organization.service.store.param.DelImageStoreParam;
import cn.cloudwalk.client.organization.service.store.param.DetailImageStoreParam;
import cn.cloudwalk.client.organization.service.store.param.EditImageStoreParam;
import cn.cloudwalk.client.organization.service.store.param.QueryImageStoreParam;
import cn.cloudwalk.client.organization.service.store.result.AssociatedResult;
import cn.cloudwalk.client.organization.service.store.result.DeviceInfoResult;
import cn.cloudwalk.client.organization.service.store.result.ImageStoreDetailResult;
import cn.cloudwalk.client.organization.service.store.result.ImageStoreResult;
import cn.cloudwalk.client.organization.service.store.result.ImgStorePersonResult;
import cn.cloudwalk.client.organization.service.store.result.LabelResult;
import cn.cloudwalk.client.organization.service.store.result.OrganizationResult;
import cn.cloudwalk.client.organization.service.store.result.PageImageStoreResult;
import cn.cloudwalk.client.organization.service.store.service.CpImageStoreService;
import cn.cloudwalk.client.resource.application.param.ApplicationBasicParam;
import cn.cloudwalk.client.resource.application.param.ApplicationQueryParam;
import cn.cloudwalk.client.resource.application.result.ApplicationResult;
import cn.cloudwalk.client.resource.application.service.ApplicationService;
import cn.cloudwalk.client.resource.common.en.CommonStatusEnum;
import cn.cloudwalk.cloud.annotation.CloudwalkParamsValidate;
import cn.cloudwalk.cloud.context.CloudwalkCallContext;
import cn.cloudwalk.cloud.exception.ServiceException;
import cn.cloudwalk.cloud.page.CloudwalkPageAble;
import cn.cloudwalk.cloud.page.CloudwalkPageInfo;
import cn.cloudwalk.cloud.result.CloudwalkResult;
import cn.cloudwalk.cloud.utils.BeanCopyUtils;
import cn.cloudwalk.cloud.utils.CloudwalkDateUtils;
import cn.cloudwalk.data.organization.dto.DelGroupPersonDTO;
import cn.cloudwalk.data.organization.dto.GetsImageStoreAssociatedDTO;
import cn.cloudwalk.data.organization.dto.ImageStoreCountDTO;
import cn.cloudwalk.data.organization.dto.ImgStorePersonQueryDto;
import cn.cloudwalk.data.organization.dto.OrganizationImageStoreQueryDTO;
import cn.cloudwalk.data.organization.dto.QueryGroupPersonDTO;
import cn.cloudwalk.data.organization.entity.ImgStorePerson;
import cn.cloudwalk.data.organization.entity.IsImageStoreAssociated;
import cn.cloudwalk.data.organization.mapper.GroupPersonRefMapper;
import cn.cloudwalk.data.organization.mapper.ImgStoreLabelMapper;
import cn.cloudwalk.data.organization.mapper.ImgStoreOrganizationMapper;
import cn.cloudwalk.data.organization.mapper.ImgStorePersonMapper;
import cn.cloudwalk.data.organization.mapper.IsImageStoreAssociatedMapper;
import cn.cloudwalk.data.organization.mapper.OrganizationImageStoreMapper;
import cn.cloudwalk.service.organization.common.AbstractImagStoreService;
import cn.cloudwalk.service.organization.common.JsonUtils;
import cn.cloudwalk.service.organization.service.CpImageStorePersonManager;
import cn.cloudwalk.service.organization.service.CpImageStorePersonSynManager;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Lists;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springside.modules.utils.Collections3;
@Service
@SuppressWarnings({"rawtypes", "unchecked"})
public class CpImageStoreServiceImpl
extends AbstractImagStoreService
implements CpImageStoreService {
@Autowired
private IsImageStoreAssociatedMapper isImageStoreAssociatedMapper;
@Autowired
private ImgStoreLabelMapper imgStoreLabelMapper;
@Autowired
private ImgStoreOrganizationMapper imgStoreOrganizationMapper;
@Autowired
private ImgStorePersonMapper personMapper;
@Autowired
private GroupPersonRefMapper groupPersonRefMapper;
@Autowired
private OrganizationImageStoreMapper organizationImageStoreMapper;
@Autowired
private AcBusinessService acBusinessService;
@Autowired
private ApplicationService applicationService;
@Autowired
private AgImageStoreService agImageStoreService;
@Autowired
private ApplicationImageStoreService applicationImageStoreService;
@Autowired
private AggDeviceImageStoreService deviceImageStoreService;
@Autowired
private CpImageStorePersonSynManager cpImageStorePersonSynManager;
@Resource
private CpImageStorePersonManager cpImageStorePersonManager;
@Resource
private AtomicDeviceService atomicDeviceService;
@Resource
private ApplicationImageStoreService appImageStoreService;
@Value(value="${cloudwalk.imagestore.person.searchSize:2}")
private int searchSize;
@Transactional(rollbackFor={Exception.class})
@CloudwalkParamsValidate
public CloudwalkResult<String> add(AddImageStoreParam param, CloudwalkCallContext context) throws ServiceException {
CloudwalkResult addResult;
List<IsImageStoreAssociated> imageStoreAssociatedList;
String imageStoreId = CloudwalkDateUtils.getUUID();
AgImageStoreAddParam addParam = new AgImageStoreAddParam();
addParam.setId(imageStoreId);
addParam.setName(param.getName());
addParam.setType(param.getType());
addParam.setBusinessId(param.getBusinessId());
addParam.setSourceApplicationId(param.getSourceApplicationId());
if (StringUtils.isBlank((CharSequence)param.getBusinessId())) {
addParam.setBusinessId(context.getCompany().getCompanyId());
}
if ((imageStoreAssociatedList = this.addBaseImageStore((BaseImageStoreParam)param, context, imageStoreId, addParam.getBusinessId())).size() > 0) {
this.isImageStoreAssociatedMapper.batchInsert(imageStoreAssociatedList);
}
if (!(addResult = this.agImageStoreService.add(addParam, context)).isSuccess()) {
throw new ServiceException(addResult.getCode(), addResult.getMessage());
}
this.cpImageStorePersonSynManager.addGroupPersonSynTask(Lists.newArrayList(imageStoreId), "isAll");
return CloudwalkResult.<String>success(imageStoreId);
}
@Transactional(rollbackFor={Exception.class})
@CloudwalkParamsValidate
public CloudwalkResult<Boolean> edit(EditImageStoreParam param, CloudwalkCallContext context) throws ServiceException {
CloudwalkResult editResult;
this.checkExistAndStatus(param.getImageStoreId());
AgImageStoreEditParam editParam = new AgImageStoreEditParam();
editParam.setId(param.getImageStoreId());
editParam.setName(param.getName());
String businessId = param.getBusinessId();
if (StringUtils.isBlank((CharSequence)businessId)) {
businessId = context.getCompany().getCompanyId();
}
List<IsImageStoreAssociated> imageStoreAssociatedList = this.addBaseImageStore((BaseImageStoreParam)param, context, param.getImageStoreId(), businessId);
if (this.checkAssociatedIsChange(param.getImageStoreId(), imageStoreAssociatedList)) {
this.isImageStoreAssociatedMapper.deleteAllByImageId(param.getImageStoreId());
if (imageStoreAssociatedList.size() > 0) {
this.isImageStoreAssociatedMapper.batchInsert(imageStoreAssociatedList);
}
editParam.setStatus(SyncStatusEnum.SYNC_WAIT.getCode());
}
if (!(editResult = this.agImageStoreService.edit(editParam, context)).isSuccess()) {
throw new ServiceException(editResult.getCode(), editResult.getMessage());
}
this.cpImageStorePersonSynManager.addGroupPersonSynTask(Lists.newArrayList(param.getImageStoreId()), "isAll");
return CloudwalkResult.<Boolean>success(Boolean.TRUE);
}
private boolean checkAssociatedIsChange(String imageStoreId, List<IsImageStoreAssociated> associatedListAfterUpdate) {
GetsImageStoreAssociatedDTO queryDTO = new GetsImageStoreAssociatedDTO();
queryDTO.setImageStoreId(imageStoreId);
List<IsImageStoreAssociated> associatedListBeforeUpdate =
(List<IsImageStoreAssociated>) (List) this.isImageStoreAssociatedMapper.gets(queryDTO);
if (CollectionUtils.isEmpty((Collection)associatedListBeforeUpdate) && CollectionUtils.isEmpty(associatedListAfterUpdate)) {
return false;
}
if (associatedListBeforeUpdate.size() != associatedListAfterUpdate.size()) {
return true;
}
HashSet<String> associatedStrBeforeUpdate = new HashSet<String>(associatedListBeforeUpdate.size());
for (IsImageStoreAssociated associateBefore : associatedListBeforeUpdate) {
String action = associateBefore.getAssociatedAction() != null ? String.valueOf(associateBefore.getAssociatedAction()) : "";
associatedStrBeforeUpdate.add(action + associateBefore.getAssociatedObjectIdType() + associateBefore.getAssociatedObjectId() + associateBefore.getExpiryBeginDate() + associateBefore.getExpiryEndDate() + associateBefore.getValidDateCron());
}
HashSet<String> associatedStrAfterUpdate = new HashSet<String>(associatedListAfterUpdate.size());
for (IsImageStoreAssociated associateBeforeAfter : associatedListAfterUpdate) {
String action = associateBeforeAfter.getAssociatedAction() != null ? String.valueOf(associateBeforeAfter.getAssociatedAction()) : "";
associatedStrAfterUpdate.add(action + associateBeforeAfter.getAssociatedObjectIdType() + associateBeforeAfter.getAssociatedObjectId() + associateBeforeAfter.getExpiryBeginDate() + associateBeforeAfter.getExpiryEndDate() + associateBeforeAfter.getValidDateCron());
}
associatedStrBeforeUpdate.removeAll(associatedStrAfterUpdate);
return !CollectionUtils.isEmpty(associatedStrBeforeUpdate);
}
@Transactional(rollbackFor={Exception.class})
@CloudwalkParamsValidate
public CloudwalkResult<Boolean> delete(DelImageStoreParam param, CloudwalkCallContext context) throws ServiceException {
this.checkAppRefByImageStoreIdForDelete(param.getId(), context);
this.checkExistAndStatus(param.getId());
QueryGroupPersonDTO queryDTO = new QueryGroupPersonDTO();
queryDTO.setImageStoreId(param.getId());
queryDTO.setIsDel(Short.valueOf(DelStatusEnum.NORAML.getCode()));
List groupPersonList = this.groupPersonRefMapper.query(queryDTO);
this.isImageStoreAssociatedMapper.deleteAllByImageId(param.getId());
DelGroupPersonDTO delGroupPersonDTO = new DelGroupPersonDTO();
delGroupPersonDTO.setImageStoreId(param.getId());
delGroupPersonDTO.setLastUpdateTime(Long.valueOf(System.currentTimeMillis()));
delGroupPersonDTO.setLastUpdateUserId(context.getUser().getCaller());
this.groupPersonRefMapper.logicDeleteByParam(delGroupPersonDTO);
CloudwalkResult delete = this.agImageStoreService.delete((AgImageStoreKeyParam)BeanCopyUtils.copyProperties((Object)param, AgImageStoreKeyParam.class), context);
if (!delete.isSuccess()) {
throw new ServiceException(delete.getCode(), delete.getMessage());
}
return CloudwalkResult.<Boolean>success(Boolean.TRUE);
}
private void checkAppRefByImageStoreIdForDelete(String imageStoreId, CloudwalkCallContext context) throws ServiceException {
ApplicationImageStoreQueryParam queryParam = new ApplicationImageStoreQueryParam();
queryParam.setImageStoreId(imageStoreId);
CloudwalkResult queryResult = this.applicationImageStoreService.query(queryParam, context);
if (!queryResult.isSuccess()) {
throw new ServiceException(queryResult.getCode(), queryResult.getMessage());
}
if (!CollectionUtils.isEmpty((Collection)((Collection)queryResult.getData()))) {
throw new ServiceException("53013545", this.getMessage("53013545"));
}
}
public CloudwalkResult<CloudwalkPageAble<PageImageStoreResult>> page(QueryImageStoreParam queryImageStoreParam, CloudwalkCallContext context) throws ServiceException {
CloudwalkResult agPageResult;
boolean isEnd = this.handleQueryParam(queryImageStoreParam);
if (isEnd) {
return CloudwalkResult.success(
new CloudwalkPageAble<PageImageStoreResult>(
new ArrayList<PageImageStoreResult>(),
new CloudwalkPageInfo(
queryImageStoreParam.getCurrentPage(), queryImageStoreParam.getRowsOfPage()),
0L));
}
AgImageStoreQueryParam queryParam = (AgImageStoreQueryParam)BeanCopyUtils.copyProperties((Object)queryImageStoreParam, AgImageStoreQueryParam.class);
if (StringUtils.isBlank((CharSequence)queryParam.getBusinessId())) {
queryParam.setBusinessId(context.getCompany().getCompanyId());
}
if (!(agPageResult = this.agImageStoreService.page(queryParam)).isSuccess()) {
return CloudwalkResult.fail((String)agPageResult.getCode(), (String)agPageResult.getMessage());
}
if (agPageResult.getData() == null) {
return CloudwalkResult.success(
new CloudwalkPageAble<PageImageStoreResult>(
new ArrayList<PageImageStoreResult>(),
new CloudwalkPageInfo(queryParam.getCurrentPage(), queryParam.getRowsOfPage()),
0L));
}
List<PageImageStoreResult> resultList = this.packageCpResult(((CloudwalkPageAble)agPageResult.getData()).getDatas(), queryParam.getBusinessId());
CloudwalkPageAble<?> pageData = (CloudwalkPageAble<?>) agPageResult.getData();
return CloudwalkResult.success(
new CloudwalkPageAble<PageImageStoreResult>(
resultList,
new CloudwalkPageInfo((int) pageData.getCurrentPage(), (int) pageData.getPageSize()),
pageData.getTotalRows()));
}
public CloudwalkResult<List<ImageStoreResult>> list(QueryImageStoreParam queryImageStoreParam, CloudwalkCallContext cloudwalkContext) throws ServiceException {
CloudwalkResult agQueryResult;
List<ImageStoreResult> resultList = new ArrayList<ImageStoreResult>();
boolean isEnd = this.handleQueryParam(queryImageStoreParam);
if (isEnd) {
return CloudwalkResult.success(resultList);
}
AgImageStoreQueryParam queryParam = (AgImageStoreQueryParam)BeanCopyUtils.copyProperties((Object)queryImageStoreParam, AgImageStoreQueryParam.class);
if (StringUtils.isBlank((CharSequence)queryParam.getBusinessId())) {
queryParam.setBusinessId(cloudwalkContext.getCompany().getCompanyId());
}
if (!(agQueryResult = this.agImageStoreService.query(queryParam)).isSuccess()) {
return CloudwalkResult.fail((String)agQueryResult.getCode(), (String)agQueryResult.getMessage());
}
if (!CollectionUtils.isEmpty((Collection)queryImageStoreParam.getLabelIds())) {
GetsImageStoreAssociatedDTO get = new GetsImageStoreAssociatedDTO();
get.setAssociatedObjectIds((Collection)queryImageStoreParam.getLabelIds());
get.setAssociatedObjectIdType(Integer.valueOf(2));
List<IsImageStoreAssociated> associateds =
(List<IsImageStoreAssociated>) (List) this.isImageStoreAssociatedMapper.gets(get);
if (CollectionUtils.isEmpty((Collection) associateds)) {
return CloudwalkResult.success(resultList);
}
List<String> imageStoreIds = Collections3.extractToList(associateds, "imageStoreId");
List<AgImageStoreResult> agList = (List<AgImageStoreResult>) agQueryResult.getData();
List<AgImageStoreResult> collect =
agList.stream().filter(a -> imageStoreIds.contains(a.getId())).collect(Collectors.toList());
agQueryResult.setData(collect);
}
resultList =
this.packageImageStoreResult(
(Collection<AgImageStoreResult>) agQueryResult.getData(), queryParam.getBusinessId());
return CloudwalkResult.success(resultList);
}
@CloudwalkParamsValidate
public CloudwalkResult<ImageStoreDetailResult> detail(DetailImageStoreParam param, CloudwalkCallContext context) {
AgImageStoreQueryParam queryParam = new AgImageStoreQueryParam();
queryParam.setId(param.getId());
CloudwalkResult queryResult = this.agImageStoreService.query(queryParam);
if (!queryResult.isSuccess()) {
return CloudwalkResult.fail((String)queryResult.getCode(), (String)queryResult.getMessage());
}
if (CollectionUtils.isEmpty((Collection)((Collection)queryResult.getData()))) {
return CloudwalkResult.fail((String)"53013502", (String)this.getMessage("53013502"));
}
AgImageStoreResult agImageStoreResult = (AgImageStoreResult)((List)queryResult.getData()).get(0);
ImageStoreDetailResult result = (ImageStoreDetailResult)BeanCopyUtils.copyProperties((Object)agImageStoreResult, ImageStoreDetailResult.class);
result.setPersonNum(this.getPersonNum(agImageStoreResult.getId()));
try {
result.setBusinessName(this.getBusinessName(result.getBusinessId()));
}
catch (ServiceException e) {
this.logger.error("\u67e5\u8be2\u4f01\u4e1a\u540d\u79f0\u9519\u8befe:{}", (Object)e.getMessage());
return CloudwalkResult.fail((String)e.getCode(), (String)e.getMessage());
}
try {
result.setSourceApplicationName(this.getSourceApplicationName(result.getSourceApplicationId()));
}
catch (ServiceException e) {
this.logger.error("\u67e5\u8be2\u6765\u6e90\u5e94\u7528\u540d\u79f0\u9519\u8befe:{}", (Object)e.getMessage());
return CloudwalkResult.fail((String)e.getCode(), (String)e.getMessage());
}
this.getAssociated(result);
DeviceImageStoreQueryParam deviceParam = new DeviceImageStoreQueryParam();
deviceParam.setImageStoreId(param.getId());
CloudwalkResult deviceResult = this.deviceImageStoreService.query(deviceParam, context);
if (deviceResult.isSuccess()) {
result.setDevices(this.getDeviceList((List)deviceResult.getData(), context));
} else {
this.logger.error("\u56fe\u5e93\u8be6\u60c5\u5173\u8054\u8bbe\u5907\u540d\u79f0\u83b7\u53d6\u5931\u8d25\uff0cresult:[{}]", (Object)JSONObject.toJSONString((Object)deviceResult));
}
ApplicationImageStoreQueryParam appParam = new ApplicationImageStoreQueryParam();
appParam.setImageStoreId(param.getId());
CloudwalkResult appResult = this.applicationImageStoreService.query(appParam, context);
if (appResult.isSuccess()) {
result.setApplicationNames(Collections3.extractToList((Collection)((Collection)appResult.getData()), (String)"applicationName"));
} else {
this.logger.error("\u56fe\u5e93\u8be6\u60c5\u5173\u8054\u5e94\u7528\u540d\u79f0\u83b7\u53d6\u5931\u8d25\uff0cresult:[{}]", (Object)JSONObject.toJSONString((Object)appResult));
}
return CloudwalkResult.success(result);
}
private List<DeviceInfoResult> getDeviceList(List<DeviceImageStoreQueryResult> resultList, CloudwalkCallContext context) {
List<DeviceInfoResult> list = Lists.newArrayListWithCapacity(resultList.size());
try {
List<String> deviceIds =
resultList.stream().map(DeviceImageStoreQueryResult::getDeviceId).collect(Collectors.toList());
CoreDeviceQueryParam param = new CoreDeviceQueryParam();
param.setIds(deviceIds);
param.setBusinessId(context.getCompany().getCompanyId());
CloudwalkResult deviceResult = this.atomicDeviceService.list(param, context);
Map<String, String> deviceMap = new HashMap<>();
if (deviceResult.isSuccess()) {
deviceMap =
(Map<String, String>)
((List<AtomicDeviceGetResult>) (List) deviceResult.getData())
.stream()
.collect(
Collectors.toMap(
device -> device.getId(),
device -> device.getDeviceCode()));
}
for (DeviceImageStoreQueryResult result : resultList) {
DeviceInfoResult dr = new DeviceInfoResult();
dr.setDeviceId(result.getDeviceId());
dr.setDeviceCode(deviceMap.get(result.getDeviceId()));
dr.setDeviceName(result.getDeviceName());
dr.setIdentifyType(result.getIdentifyType());
list.add(dr);
}
}
catch (Exception e) {
this.logger.error("exception:{}", e.getMessage());
}
return list;
}
private IsImageStoreAssociated getAssociated(String objectId, long time, String userId, String imageStoreId, Integer action, Integer objectType) {
IsImageStoreAssociated associated = new IsImageStoreAssociated();
associated.setId(this.getPrimaryId());
associated.setAssociatedAction(action);
associated.setAssociatedObjectId(objectId);
associated.setAssociatedObjectIdType(objectType);
associated.setCreateTime(Long.valueOf(time));
associated.setCreateUserId(userId);
associated.setImageStoreId(imageStoreId);
associated.setLastUpdateTime(Long.valueOf(time));
associated.setLastUpdateUserId(userId);
return associated;
}
private IsImageStoreAssociated getAssociated(AssociatedParam associatedParam, long time, String userId, String imageStoreId, Integer action, Integer objectType) {
IsImageStoreAssociated associated = this.getAssociated(associatedParam.getObjectId(), time, userId, imageStoreId, action, objectType);
associated.setExpiryBeginDate(associatedParam.getExpiryBeginDate());
associated.setExpiryEndDate(associatedParam.getExpiryEndDate());
associated.setValidDateCron(null);
if (!CollectionUtils.isEmpty((Collection)associatedParam.getValidDateCron())) {
associated.setValidDateCron(JSON.toJSONString((Object)associatedParam.getValidDateCron()));
}
return associated;
}
private List<IsImageStoreAssociated> addBaseImageStore(BaseImageStoreParam param, CloudwalkCallContext context, String imageStoreId, String businessId) throws ServiceException {
long time = System.currentTimeMillis();
List<String> includePersonIds =
CollectionUtils.isEmpty((Collection) param.getIncludePersons())
? new ArrayList<String>()
: param.getIncludePersons().stream()
.map(AssociatedParam::getObjectId)
.collect(Collectors.toList());
if (CollectionUtils.isEmpty((Collection)param.getIncludeOrganizations()) && CollectionUtils.isEmpty((Collection)param.getIncludeLabels()) && CollectionUtils.isEmpty(includePersonIds)) {
return new ArrayList<IsImageStoreAssociated>();
}
ArrayList<IsImageStoreAssociated> imageStoreAssociatedList = new ArrayList<IsImageStoreAssociated>();
if (CpImageStoreMatchPatternEnum.getByCode((String)param.getMatchPattern()) != null) {
imageStoreAssociatedList.add(this.getAssociated(param.getMatchPattern(), time, context.getUser().getCaller(), imageStoreId, null, (Integer)4));
} else {
imageStoreAssociatedList.add(this.getAssociated(CpImageStoreMatchPatternEnum.MERGE.getCode(), time, context.getUser().getCaller(), imageStoreId, null, (Integer)4));
}
AssociatedParam imageStoreAssociatedParam = new AssociatedParam();
imageStoreAssociatedParam.setObjectId(imageStoreId);
imageStoreAssociatedParam.setExpiryBeginDate(param.getExpiryBeginDate());
imageStoreAssociatedParam.setExpiryEndDate(param.getExpiryEndDate());
imageStoreAssociatedParam.setValidDateCron(param.getValidDateCron());
imageStoreAssociatedList.add(this.getAssociated(imageStoreAssociatedParam, time, context.getUser().getCaller(), imageStoreId, (Integer)0, (Integer)5));
if (!CollectionUtils.isEmpty((Collection)param.getIncludeOrganizations())) {
if (this.imgStoreOrganizationMapper.getOrgByIds(param.getIncludeOrganizations(), businessId).size() != param.getIncludeOrganizations().size()) {
throw new ServiceException("53013513", this.getMessage("53013513"));
}
for (Object objectId : param.getIncludeOrganizations()) {
imageStoreAssociatedList.add(this.getAssociated((String)objectId, time, context.getUser().getCaller(), imageStoreId, (Integer)0, (Integer)1));
}
}
if (!CollectionUtils.isEmpty((Collection)param.getIncludeLabels())) {
if (this.imgStoreLabelMapper.getLabelByIds(param.getIncludeLabels(), businessId).size() != param.getIncludeLabels().size()) {
throw new ServiceException("53013514", this.getMessage("53013514"));
}
for (Object objectId : param.getIncludeLabels()) {
imageStoreAssociatedList.add(this.getAssociated((String)objectId, time, context.getUser().getCaller(), imageStoreId, (Integer)0, (Integer)2));
}
}
if (!CollectionUtils.isEmpty(includePersonIds)) {
ImgStorePersonQueryDto personQuery = new ImgStorePersonQueryDto();
personQuery.setIds(includePersonIds);
personQuery.setBusinessId(businessId);
personQuery.setIsDel(DelStatusEnum.NORAML.getCode());
if (this.personMapper.gets(personQuery).size() != includePersonIds.size()) {
throw new ServiceException("53013515", this.getMessage("53013515"));
}
for (AssociatedParam associatedParam : param.getIncludePersons()) {
if (!(param.getNullDateIsLongTerm().booleanValue() || null != associatedParam.getExpiryBeginDate() && null != associatedParam.getExpiryEndDate())) {
associatedParam.setExpiryBeginDate(imageStoreAssociatedParam.getExpiryBeginDate());
associatedParam.setExpiryEndDate(imageStoreAssociatedParam.getExpiryEndDate());
associatedParam.setValidDateCron(imageStoreAssociatedParam.getValidDateCron());
}
imageStoreAssociatedList.add(this.getAssociated(associatedParam, time, context.getUser().getCaller(), imageStoreId, (Integer)0, (Integer)3));
}
}
if (!CollectionUtils.isEmpty((Collection)param.getExcludeLabels())) {
if (this.imgStoreLabelMapper.getLabelByIds(param.getExcludeLabels(), businessId).size() != param.getExcludeLabels().size()) {
throw new ServiceException("53013516", this.getMessage("53013516"));
}
for (Object objectId : param.getExcludeLabels()) {
imageStoreAssociatedList.add(this.getAssociated((String)objectId, time, context.getUser().getCaller(), imageStoreId, (Integer)1, (Integer)2));
}
}
if (!CollectionUtils.isEmpty((Collection) param.getExcludePersons())) {
ImgStorePersonQueryDto excludePersonQuery = new ImgStorePersonQueryDto();
excludePersonQuery.setIds((Collection) param.getExcludePersons());
excludePersonQuery.setBusinessId(businessId);
excludePersonQuery.setIsDel(DelStatusEnum.NORAML.getCode());
if (this.personMapper.gets(excludePersonQuery).size() != param.getExcludePersons().size()) {
throw new ServiceException("53013517", this.getMessage("53013517"));
}
for (String objectId : param.getExcludePersons()) {
imageStoreAssociatedList.add(this.getAssociated(objectId, time, context.getUser().getCaller(), imageStoreId, (Integer)1, (Integer)3));
}
}
return imageStoreAssociatedList;
}
private String getBusinessName(String businessId) throws ServiceException {
GeneralQueryBusinessParam generalQueryBusinessParam = new GeneralQueryBusinessParam();
generalQueryBusinessParam.setId(businessId);
CloudwalkResult cloudwalkResult = this.acBusinessService.generalQuery(generalQueryBusinessParam);
if (cloudwalkResult == null) {
throw new ServiceException("53013535", this.getMessage("53013535"));
}
if (!cloudwalkResult.isSuccess()) {
throw new ServiceException(cloudwalkResult.getCode(), cloudwalkResult.getMessage());
}
if (cloudwalkResult.getData() != null && ((List)cloudwalkResult.getData()).size() > 0) {
return ((AcBusinessDTO)((List)cloudwalkResult.getData()).get(0)).getName();
}
return null;
}
private String getSourceApplicationName(String sourceApplicationId) throws ServiceException {
if (StringUtils.isEmpty((CharSequence)sourceApplicationId)) {
return null;
}
ApplicationBasicParam applicationBasicParam = new ApplicationBasicParam();
applicationBasicParam.setIds(Arrays.asList(sourceApplicationId));
CloudwalkResult cloudwalkResult = this.applicationService.gets(applicationBasicParam);
if (cloudwalkResult == null) {
throw new ServiceException("53013547", this.getMessage("53013547"));
}
if (!cloudwalkResult.isSuccess()) {
throw new ServiceException(cloudwalkResult.getCode(), cloudwalkResult.getMessage());
}
if (cloudwalkResult.getData() != null && ((List)cloudwalkResult.getData()).size() > 0) {
return ((ApplicationResult)((List)cloudwalkResult.getData()).get(0)).getName();
}
return null;
}
private void checkExistAndStatus(String iamgeStoreId) throws ServiceException {
AgImageStoreQueryParam queryParam = new AgImageStoreQueryParam();
queryParam.setId(iamgeStoreId);
CloudwalkResult query = this.agImageStoreService.query(queryParam);
if (!query.isSuccess()) {
throw new ServiceException(query.getCode(), query.getMessage());
}
if (CollectionUtils.isEmpty((Collection)((Collection)query.getData()))) {
throw new ServiceException("53013502", this.getMessage("53013502"));
}
if (SyncStatusEnum.SYNC_ING.getCode().equals(((AgImageStoreResult)((List)query.getData()).get(0)).getStatus())) {
throw new ServiceException("53013512", this.getMessage("53013512"));
}
}
private Map<String, String> getBusinessNameMap() throws ServiceException {
CloudwalkResult listCloudwalkResult = this.acBusinessService.generalQuery(new GeneralQueryBusinessParam());
if (!listCloudwalkResult.isSuccess()) {
throw new ServiceException(listCloudwalkResult.getCode(), listCloudwalkResult.getMessage());
}
if (CollectionUtils.isEmpty((Collection)((Collection)listCloudwalkResult.getData()))) {
return new HashMap<String, String>();
}
return Collections3.extractToMap((Collection)((Collection)listCloudwalkResult.getData()), (String)"id", (String)"name");
}
private Map<String, String> getSourceApplicationNameMap(String businessId) throws ServiceException {
ApplicationQueryParam param = new ApplicationQueryParam();
param.setBusinessId(businessId);
param.setStatus(CommonStatusEnum.ENABLE.getCode());
CloudwalkResult listCloudwalkResult = this.applicationService.query(param);
if (!listCloudwalkResult.isSuccess()) {
throw new ServiceException(listCloudwalkResult.getCode(), listCloudwalkResult.getMessage());
}
if (CollectionUtils.isEmpty((Collection)((Collection)listCloudwalkResult.getData()))) {
return new HashMap<String, String>();
}
return Collections3.extractToMap((Collection)((Collection)listCloudwalkResult.getData()), (String)"id", (String)"name");
}
private void getAssociated(ImageStoreDetailResult result) {
GetsImageStoreAssociatedDTO get = new GetsImageStoreAssociatedDTO();
get.setImageStoreId(result.getId());
List<IsImageStoreAssociated> associateds =
(List<IsImageStoreAssociated>) (List) this.isImageStoreAssociatedMapper.gets(get);
String matchPattern = null;
List<String> includeLabelIds = new ArrayList<String>();
List<String> includeOrganizationIds = new ArrayList<String>();
List<String> includePersonIds = new ArrayList<String>();
Map<String, AssociatedResult> includePersonMap = new HashMap<String, AssociatedResult>();
List<String> excludeLabelIds = new ArrayList<String>();
List<String> excludePersonIds = new ArrayList<String>();
String businessId = result.getBusinessId();
for (IsImageStoreAssociated associated : associateds) {
if (4 == associated.getAssociatedObjectIdType()) {
matchPattern = associated.getAssociatedObjectId();
continue;
}
if (0 == associated.getAssociatedAction()) {
if (1 == associated.getAssociatedObjectIdType()) {
includeOrganizationIds.add(associated.getAssociatedObjectId());
continue;
}
if (2 == associated.getAssociatedObjectIdType()) {
includeLabelIds.add(associated.getAssociatedObjectId());
continue;
}
if (3 == associated.getAssociatedObjectIdType()) {
includePersonIds.add(associated.getAssociatedObjectId());
AssociatedResult associatedResult = new AssociatedResult();
BeanCopyUtils.copyProperties((Object)associated, (Object)associatedResult);
associatedResult.setObjectId(associated.getAssociatedObjectId());
includePersonMap.put(associated.getAssociatedObjectId(), associatedResult);
continue;
}
if (5 != associated.getAssociatedObjectIdType()) continue;
result.setExpiryBeginDate(associated.getExpiryBeginDate());
result.setExpiryEndDate(associated.getExpiryEndDate());
result.setValidDateCron(JsonUtils.toStrList((String)associated.getValidDateCron()));
continue;
}
if (1 != associated.getAssociatedAction()) continue;
if (2 == associated.getAssociatedObjectIdType()) {
excludeLabelIds.add(associated.getAssociatedObjectId());
continue;
}
if (3 != associated.getAssociatedObjectIdType()) continue;
excludePersonIds.add(associated.getAssociatedObjectId());
}
result.setMatchPattern(matchPattern);
if (!CollectionUtils.isEmpty(includeLabelIds)) {
result.setIncludeLabels(BeanCopyUtils.copy((Collection)this.imgStoreLabelMapper.getLabelByIds(includeLabelIds, businessId), LabelResult.class));
} else {
result.setIncludeLabels(new ArrayList());
}
if (!CollectionUtils.isEmpty(includeOrganizationIds)) {
result.setIncludeOrganizations(BeanCopyUtils.copy((Collection)this.imgStoreOrganizationMapper.getOrgByIds(includeOrganizationIds, businessId), OrganizationResult.class));
} else {
result.setIncludeOrganizations(new ArrayList());
}
ImgStorePersonQueryDto getDTO = new ImgStorePersonQueryDto();
if (!CollectionUtils.isEmpty(includePersonIds)) {
getDTO.setIds(includePersonIds);
getDTO.setIsDel(DelStatusEnum.NORAML.getCode());
List<ImgStorePerson> personList = this.personMapper.gets(getDTO);
List<ImgStorePersonResult> includePersons = new ArrayList<ImgStorePersonResult>();
personList.forEach(imgStorePerson -> {
ImgStorePersonResult imgStorePersonResult = new ImgStorePersonResult();
BeanCopyUtils.copyProperties((Object)imgStorePerson, (Object)imgStorePersonResult);
AssociatedResult associatedResult = (AssociatedResult)includePersonMap.get(imgStorePerson.getId());
BeanCopyUtils.copyProperties((Object)associatedResult, (Object)imgStorePersonResult);
imgStorePersonResult.setValidDateCron(JsonUtils.toStrList((String)associatedResult.getValidDateCron()));
includePersons.add(imgStorePersonResult);
});
result.setIncludePersons(includePersons);
} else {
result.setIncludePersons(new ArrayList());
}
if (!CollectionUtils.isEmpty(excludeLabelIds)) {
result.setExcludeLabels(BeanCopyUtils.copy((Collection)this.imgStoreLabelMapper.getLabelByIds(excludeLabelIds, businessId), LabelResult.class));
} else {
result.setExcludeLabels(new ArrayList());
}
if (!CollectionUtils.isEmpty(excludePersonIds)) {
getDTO.setIds(excludePersonIds);
getDTO.setIsDel(DelStatusEnum.NORAML.getCode());
result.setExcludePersons(BeanCopyUtils.copy((Collection)this.personMapper.gets(getDTO), ImgStorePersonResult.class));
} else {
result.setExcludePersons(new ArrayList());
}
}
private boolean handleQueryParam(QueryImageStoreParam queryParam) {
List imageStoreIds;
if (StringUtils.isNotBlank((CharSequence)queryParam.getOrgId()) || !CollectionUtils.isEmpty((Collection)queryParam.getOrgIds())) {
List orgImageStoreList = this.organizationImageStoreMapper.query((OrganizationImageStoreQueryDTO)BeanCopyUtils.copyProperties((Object)queryParam, OrganizationImageStoreQueryDTO.class));
GetsImageStoreAssociatedDTO orgParam = new GetsImageStoreAssociatedDTO();
orgParam.setAssociatedObjectIdType(Integer.valueOf(1));
ArrayList<String> orgIds = new ArrayList<String>(500);
if (StringUtils.isNotBlank((CharSequence)queryParam.getOrgId())) {
orgIds.add(queryParam.getOrgId());
}
if (!CollectionUtils.isEmpty((Collection)queryParam.getOrgIds())) {
orgIds.addAll(queryParam.getOrgIds());
}
orgParam.setAssociatedObjectIds(orgIds);
List orgResultList = this.isImageStoreAssociatedMapper.gets(orgParam);
if (CollectionUtils.isEmpty((Collection)orgImageStoreList) && CollectionUtils.isEmpty((Collection)orgResultList)) {
return true;
}
List imageStoreIds2 = Collections3.extractToList((Collection)orgImageStoreList, (String)"imageStoreId");
imageStoreIds2.addAll(Collections3.extractToList((Collection)orgResultList, (String)"imageStoreId"));
if (StringUtils.isNotBlank((CharSequence)queryParam.getId())) {
if (!imageStoreIds2.contains(queryParam.getId())) {
return true;
}
} else if (!CollectionUtils.isEmpty((Collection)queryParam.getIds())) {
imageStoreIds2.retainAll(queryParam.getIds());
}
if (CollectionUtils.isEmpty((Collection)imageStoreIds2)) {
return true;
}
queryParam.setIds(imageStoreIds2);
}
if (!CollectionUtils.isEmpty((Collection)queryParam.getPersonIds())) {
QueryGroupPersonDTO queryGroupPersonDTO = (QueryGroupPersonDTO)BeanCopyUtils.copyProperties((Object)queryParam, QueryGroupPersonDTO.class);
queryGroupPersonDTO.setIsDel(DelStatusEnum.NORAML.getCode());
List queryResult = this.groupPersonRefMapper.query(queryGroupPersonDTO);
if (CollectionUtils.isEmpty((Collection)queryResult)) {
return true;
}
imageStoreIds = Collections3.extractToList((Collection)queryResult, (String)"imageStoreId");
if (StringUtils.isNotBlank((CharSequence)queryParam.getId())) {
if (!imageStoreIds.contains(queryParam.getId())) {
return true;
}
} else if (!CollectionUtils.isEmpty((Collection)queryParam.getIds())) {
imageStoreIds.retainAll(queryParam.getIds());
}
if (CollectionUtils.isEmpty((Collection)imageStoreIds)) {
return true;
}
queryParam.setIds(imageStoreIds);
}
if (!CollectionUtils.isEmpty((Collection)queryParam.getLabelIds())) {
GetsImageStoreAssociatedDTO labelParam = new GetsImageStoreAssociatedDTO();
labelParam.setAssociatedObjectIdType(Integer.valueOf(2));
labelParam.setAssociatedObjectIds((Collection)queryParam.getLabelIds());
List labelResultList = this.isImageStoreAssociatedMapper.gets(labelParam);
if (CollectionUtils.isEmpty((Collection)labelResultList)) {
return true;
}
imageStoreIds = Collections3.extractToList((Collection)labelResultList, (String)"imageStoreId");
if (StringUtils.isNotBlank((CharSequence)queryParam.getId())) {
if (!imageStoreIds.contains(queryParam.getId())) {
return true;
}
} else if (!CollectionUtils.isEmpty((Collection)queryParam.getIds())) {
imageStoreIds.retainAll(queryParam.getIds());
}
if (CollectionUtils.isEmpty((Collection)imageStoreIds)) {
return true;
}
queryParam.setIds(imageStoreIds);
}
return false;
}
private List<ImageStoreResult> packageImageStoreResult(Collection<AgImageStoreResult> agDatas, String businessId) throws ServiceException {
if (CollectionUtils.isEmpty(agDatas)) {
return new ArrayList<ImageStoreResult>();
}
List<String> imageIds = agDatas.stream().map(AgImageStoreResult::getId).collect(Collectors.toList());
long startTime = System.currentTimeMillis();
List<ImageStoreCountDTO> countByImageStoreIds =
new ArrayList<ImageStoreCountDTO>(imageIds.size());
List<List<String>> partition = Lists.partition(imageIds, this.searchSize);
partition.stream()
.forEach(
p -> {
List<ImageStoreCountDTO> list =
this.groupPersonRefMapper.getCountByImageStoreIds(p);
if (!CollectionUtils.isEmpty(list)) {
countByImageStoreIds.addAll(list);
}
});
long endTime = System.currentTimeMillis();
this.logger.info("\u56fe\u5e93\u5206\u9875\u67e5\u8be2\u8017\u65f6:[{}],searchSize:[{}]", (Object)(endTime - startTime), (Object)this.searchSize);
Map<String, Integer> countMap =
countByImageStoreIds.stream()
.filter(imageStoreCountDTO -> null != imageStoreCountDTO)
.collect(
Collectors.toMap(
ImageStoreCountDTO::getId,
ImageStoreCountDTO::getCount,
(k1, k2) -> k1));
Map<String, String> businessNameMap = this.getBusinessNameMap();
Map<String, String> sourceApplicationNameMap = this.getSourceApplicationNameMap(businessId);
List<ImageStoreResult> resultList = new ArrayList<ImageStoreResult>(agDatas.size());
for (AgImageStoreResult agData : agDatas) {
ImageStoreResult temp = (ImageStoreResult)BeanCopyUtils.copyProperties((Object)agData, ImageStoreResult.class);
temp.setBusinessName(businessNameMap.get(temp.getBusinessId()));
temp.setSourceApplicationName(sourceApplicationNameMap.get(temp.getSourceApplicationId()));
temp.setPersonNum(countMap.containsKey(agData.getId()) ? countMap.get(agData.getId()) : Integer.valueOf(0));
this.getAssociated((ImageStoreDetailResult)temp);
resultList.add(temp);
}
return resultList;
}
private List<PageImageStoreResult> packageCpResult(Collection<AgImageStoreResult> agDatas, String businessId) throws ServiceException {
if (CollectionUtils.isEmpty(agDatas)) {
return new ArrayList<PageImageStoreResult>();
}
List<String> imageIds = agDatas.stream().map(AgImageStoreResult::getId).collect(Collectors.toList());
long startTime = System.currentTimeMillis();
List<ImageStoreCountDTO> countByImageStoreIds =
new ArrayList<ImageStoreCountDTO>(imageIds.size());
List<List<String>> partition = Lists.partition(imageIds, this.searchSize);
partition.stream()
.forEach(
p -> {
List<ImageStoreCountDTO> list =
this.groupPersonRefMapper.getCountByImageStoreIds(p);
if (!CollectionUtils.isEmpty(list)) {
countByImageStoreIds.addAll(list);
}
});
long endTime = System.currentTimeMillis();
this.logger.info("\u56fe\u5e93\u5206\u9875\u67e5\u8be2\u8017\u65f6:[{}],searchSize:[{}]", (Object)(endTime - startTime), (Object)this.searchSize);
Map<String, Integer> countMap =
countByImageStoreIds.stream()
.filter(imageStoreCountDTO -> null != imageStoreCountDTO)
.collect(
Collectors.toMap(
ImageStoreCountDTO::getId,
ImageStoreCountDTO::getCount,
(k1, k2) -> k1));
Map<String, String> businessNameMap = this.getBusinessNameMap();
Map<String, String> sourceApplicationNameMap = this.getSourceApplicationNameMap(businessId);
List<PageImageStoreResult> resultList = new ArrayList<PageImageStoreResult>(agDatas.size());
for (AgImageStoreResult agData : agDatas) {
PageImageStoreResult temp = (PageImageStoreResult)BeanCopyUtils.copyProperties((Object)agData, PageImageStoreResult.class);
temp.setBusinessName(businessNameMap.get(temp.getBusinessId()));
temp.setSourceApplicationName(sourceApplicationNameMap.get(temp.getSourceApplicationId()));
temp.setPersonNum(countMap.containsKey(agData.getId()) ? countMap.get(agData.getId()) : Integer.valueOf(0));
resultList.add(temp);
}
return resultList;
}
private Integer getPersonNum(String id) {
List countByImageStoreIds = this.groupPersonRefMapper.getCountByImageStoreIds((List)Lists.newArrayList((Object[])new String[]{id}));
if (CollectionUtils.isEmpty((Collection)countByImageStoreIds) || countByImageStoreIds.get(0) == null) {
return 0;
}
return ((ImageStoreCountDTO)countByImageStoreIds.get(0)).getCount();
}
}
@@ -0,0 +1,176 @@
# =============================================================================
# 组织组件本地/测试启动覆盖配置
# 加载顺序:classpathjar 内公共 application.properties)→ 本目录(见 run-verify.sh,仅 application 名,不含 application-node
# 现场部署参考:部署包/.../application-node.properties + start.sh
# =============================================================================
# --- 本地/测试强制覆盖 ---
spring.application.name=ninca-common-component-organization
server.port=17026
server.instance-id=component-organization-verify-local
spring.datasource.username=root
spring.datasource.password=123456
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://192.168.3.12:3307/component-organization?useSSL=false&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
eureka.client.enabled=false
spring.cloud.consul.enabled=false
spring.cloud.consul.discovery.enabled=false
spring.redis.host=127.0.0.1
spring.redis.port=6380
spring.redis.password=1qaz!QAZ
spring.redis.database=6
spring.redis.timeout=5000
spring.redis.pool.max-wait=-1
spring.redis.pool.max-active=200
spring.redis.pool.min-idle=0
spring.redis.pool.max-idle=8
logging.path=/tmp/ninca-component-org-verify-logs
logging.level.root=INFO
# 日志实现由 run-verify.sh 传入 --logging.config=file:…/recognition-logback.xml(勿在此处写 classpath:recognition-logback.xml,以免覆盖失效)
# --- Spring 通用(与部署包一致)---
spring.jackson.time-zone=GMT+8
spring.http.encoding.charset=UTF-8
spring.http.encoding.enabled=true
spring.http.encoding.force=true
# --- i18nBOOT-INF 同名)---
spring.messages.basename=messages_zh_CN,component-account/messages_zh_CN,component-resource/messages_zh_CN,core-aggregate/messages_zh_CN,core-device/messages_zh_CN,devicesdk/messages_zh_CN,component-org/messages_zh_CN
# --- 上传限制 ---
cloudwalk.multipart.maxFileSize=50MB
cloudwalk.multipart.maxRequestSize=50MB
# --- Quartz(占位符引用当前数据源)---
quartz.driver=${spring.datasource.driver-class-name}
quartz.url=${spring.datasource.url}
quartz.user=${spring.datasource.username}
quartz.password=${spring.datasource.password}
quartz.maxConnections=20
quartz.schedulerName=${spring.application.name}
quartz.clustered=true
quartz.strategy=local
quartz.lazyStart=120
quartz.pool-type=druid
# --- 注册照质量分 ---
imageQualityScore=0.65
# --- 本机验证路径(替代部署包 /data/cwos/…)---
cloudwalk.common-app.download.downDir=/tmp/ninca-component-org-verify/download
cloudwalk.component.file.urlPrefix=http://127.0.0.1:${server.port}/ninca-common-component-organization/file/imgByPath?path=
qr.code.url=http://127.0.0.1:${server.port}/general-person-h5/#/register?businessId=
# --- Feign 服务名(与部署包一致;上游需注册或可改 ribbon list---
feign.davinci-portal.name=cwos-portal
feign.resource.name=cwos-portal
feign.portal.name=cwos-portal
feign.device.name=cwos-portal
feign.pineapple.name=cloudwalk-pineapple-manager
# --- 定时任务 cron ---
cloudwalk.imageStore.person.cron=0 */2 * * * ?
cloudwalk.imageStore.imageSync.cron=0 */2 * * * ?
# --- 导出限制(部署包数值)---
cloudwalk.common-app.download.excelMaxRows=10000
cloudwalk.common-app.download.exportAllCount=100000
cloudwalk.common-app.download.shardingSize=31457280
cloudwalk.common-app.download.compressionType=.zip
# --- Kafka(测试环境:未起 Kafka 时可改为本机或注释依赖;此处保留部署包结构便于对齐)---
cloudwalk.component-organization.kafka.service-code=imgstoreApp
cloudwalk.component-organization.kafka.producer.groupId=component-organization
cloudwalk.component-organization.kafka.consumer.groupId=component-organization
# 覆盖 BOOT-INF 内网地址:可按 env.sh / Docker 修改
cloudwalk.component-organization.kafka.producer.bootstrapServers=127.0.0.1:9092
cloudwalk.component-organization.kafka.consumer.bootstrapServers=127.0.0.1:9092
person.name.space=componentOrg
# --- Management(与部署包规律:业务端口 +100)---
management.port=17126
management.context-path=/actuator
management.security.enabled=false
endpoints.enabled=false
endpoints.info.enabled=true
endpoints.health.enabled=true
endpoints.prometheus.enabled=true
# --- 图库同步(线程池取部署包「根目录」application.properties 较大规格,便于压测对齐)---
group-person.syn.config.task_is_all.threshold=100
group-person.syn.config.lock-handle-syn-task-second=150
ninca.group.person.syn.pool.corePoolSize=40
ninca.group.person.syn.pool.maxPoolSize=80
ninca.group.person.syn.pool.queueCapacity=1000
ninca.group.person.syn.pool.keepAliveSeconds=150
ninca.group.person.syn.pool.allowCoreThreadTimeOut=true
group-person.delete.keep.days=7
device.report.thread.corePoolSize=20
device.report.thread.maxPoolSize=40
device.report.thread.queueCapacity=500
device.report.thread.keepAliveSeconds=150
device.report.thread.allowCoreThreadTimeOut=true
device.group.change.thread.corePoolSize=20
device.group.change.thread.maxPoolSize=40
device.group.change.thread.queueCapacity=500
device.group.change.thread.keepAliveSeconds=150
device.group.change.thread.allowCoreThreadTimeOut=true
handle.image.thread.corePoolSize=40
handle.image.thread.maxPoolSize=160
handle.image.thread.queueCapacity=2000
handle.image.thread.keepAliveSeconds=150
handle.image.thread.allowCoreThreadTimeOut=true
ninca.picture.revision.pool.corePoolSize=5
ninca.picture.revision.pool.maxPoolSize=5
ninca.picture.revision.pool.queueCapacity=100000
ninca.picture.revision.pool.keepAliveSeconds=150
ninca.picture.revision.pool.allowCoreThreadTimeOut=true
device.report.approach.time.diff.milliseconds=1000
device.person.sync.time.diff.minutes=60
cwos.image.store.sync.log=false
device.group.pull.time.diff.minutes=10
ribbon.ReadTimeout=10000
ribbon.ConnectTimeout=10000
# --- 图片 / 人脸像素限制 ---
image.size.min=10240
image.size.max=3145728
image.width.min=30
image.width.max=400
image.height.min=30
image.height.max=400
face.width.min=100
face.width.max=400
face.height.min=100
face.height.max=400
revision.engine.port=20010
group-person.syn.config.delay-add-validate-data=false
group-person.syn.config.delay-add-validate-hour=48
group-person.syn.config.delay-handle-validate.cron=1 0 0 /1 * ? *
group-person.syn.config.handle-group-face-exception.cron=0 */5 * * * ?
# --- 星河湾业务常量(与部署包根目录 application.properties 一致)---
xhwId=21474e012cd14e26bc62771873b22562
xhwDefaultFloorId=605560547135455232
xhwSixFloorId=605560541473144832
support.muti.group.device.type=CW-IS1330,-8,MTD8
# --- cloudwalk-common-serialUUIDSerial / Snowflake;与电梯应用一致)---
cloudwalk.serial.enabled=true
cloudwalk.serial.serial-length=8
cloudwalk.serial.serial-type=redis
cloudwalk.serial.serial-redis-key=CLOUDWALK-ACS-SERIAL-KEY
@@ -0,0 +1,23 @@
#!/usr/bin/env bash
# 配置顺序:classpathfat jar 内公共 application.properties
# → 本目录 application.properties(本地 MySQL/Redis、关 Consul)。
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "$SCRIPT_DIR/../../../../" && pwd)"
source "$REPO_ROOT/scripts/test-env/config/env.sh" 2>/dev/null || true
JAR="$SCRIPT_DIR/../../target/ninca-common-component-organization-2.9.4-xinghewan.jar"
JAVA_BIN="${JAVA_HOME:-/usr/lib/jvm/java-8-openjdk-amd64}/bin/java"
if [[ ! -f "$JAR" ]]; then
echo "Missing $JAR — run: mvn -pl cwos-component-organization-starter -am package -DskipTests" >&2
exit 1
fi
exec "$JAVA_BIN" -jar "$JAR" \
--spring.config.location="classpath:/,classpath:/config/,file:${SCRIPT_DIR}/" \
--spring.config.name=application \
--spring.cloud.bootstrap.location="file:${SCRIPT_DIR}/bootstrap.properties" \
--logging.config="file:${SCRIPT_DIR}/recognition-logback.xml" \
--spring.main.banner-mode=off \
"$@"
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.cloudwalk.ninca</groupId>
<artifactId>ninca-common-component-organization-reactor</artifactId>
<version>2.9.4-xinghewan</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>cwos-component-organization-starter</artifactId>
<name>cwos-component-organization-starter</name>
<description>可执行聚合层:Spring Boot repackage,与现场 MANIFEST Start-Class / PropertiesLauncherlayout=ZIP)对齐</description>
<dependencies>
<!-- 与现场嵌入式 pom 一致:starter 依赖 web,由 service 经 all-lib 提供运行时栈 -->
<dependency>
<groupId>cn.cloudwalk.ninca</groupId>
<artifactId>cwos-component-organization-web</artifactId>
</dependency>
</dependencies>
<build>
<finalName>ninca-common-component-organization-${project.version}</finalName>
<plugins>
<!-- 使用 2.7.x 插件以支持 includeSystemScope,将大量 system/all-lib 打入 fat jar -->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.7.18</version>
<configuration>
<mainClass>cn.cloudwalk.starter.organization.OrganizationServer</mainClass>
<layout>ZIP</layout>
<includeSystemScope>true</includeSystemScope>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
@@ -0,0 +1,90 @@
# `releases/` 发布目录
## 目的
`releases/` 用于存放 **可交付的发布包(release bundle**:从本 reactor 构建的 **Spring Boot fat JAR**、与现场/部署包一致的 **配置文件**、**启动脚本** 与 **校验信息(SHA256** 的固定组合。
该目录是 **对外或运维交付的“落盘点”**,与单纯的 Maven `target/` 构建输出区分开。
## 目录命名规范
每个发布包为一个子目录,命名格式:
```text
ninca-common-component-organization-<maven-version>-<YYYYMMDD>/
```
- **`<maven-version>`**:反应堆根 `pom.xml``<artifactId>ninca-common-component-organization-reactor</artifactId>` 对应的 `<version>`(例如 `2.9.4-xinghewan`)。
- **`<YYYYMMDD>`**:发布日期戳;默认取构建当日 `date +%Y%m%d`,也可用环境变量覆盖(见脚本说明)。
示例:`ninca-common-component-organization-2.9.4-xinghewan-YYYYMMDD/`
## 每个 bundle 应包含的内容
| 内容 | 说明 |
|------|------|
| **Fat JAR** | 从 `cwos-component-organization-starter/target/` 拷贝的可执行 fat JAR(由 `spring-boot-maven-plugin` repackage`finalName``ninca-common-component-organization-${project.version}.jar`)。 |
| **`application-node.properties`** | 节点差异(Consul 主机、instance-id、management-suffix 等);公共项在 fat jar 内 `application.properties`。从 **`部署包/`** 模板目录复制(见下文)。 |
| **`bootstrap.properties`** | 引导配置;来源同上。 |
| **`sql/`** | 租户访客策略脚本(与 **`源码/docs/sql`** 一致):电梯库 `tenant_visitor_floor_policy*` + 组织库 **`organization_tenant_visitor_floor_policy*`**(含 **`organization_tenant_visitor_floor_policy_full_install.sql`** 一站式);内含 **`README.txt`**。 |
| **`start.sh`** | 启动脚本:**`--spring.config.location=classpath:/,file:<发布目录>/`** + **`--spring.config.name=application,application-node`** + **`--logging.path=<发布目录>/logs`**。 |
| **可选符号链接** | 运维友好别名:`ninca-common-component-organization-V<主版本三元组>_<YYYYMMDD>.jar` → 实际 fat JAR(例如 `V2.9.4_20260506` 对应版本 `2.9.4-xinghewan`)。 |
| **`RELEASE.txt`** | 发布说明:版本、目录名、构建命令、文件清单、fat JAR 的 **SHA256**。 |
其中 `application-node.properties` / `bootstrap.properties` 的「权威模板」通常来自现场 **部署包** 目录(与运维目录对齐),路径示例:
`星河湾星中星/部署包/ninca_common_component_organization_01-ninca_common_component_organization/`
若该路径下不存在对应文件,脚本会 **告警并跳过**,不会中断构建(仍可从别处手工放入同名文件)。
## 前置条件
- **JDK 8**:与本 reactor 一致;默认使用 `/usr/lib/jvm/java-8-openjdk-amd64`(可通过 `JAVA_HOME` 覆盖)。
- **`all-lib/`**:反应堆依赖的本地扁平库目录必须存在且齐全,否则 `mvn package` 可能失败(根 `pom.xml``all-lib.dir` 指向 `${maven.multiModuleProjectDirectory}/all-lib`)。
## JDK / `JAVA_HOME` 说明
- 脚本默认使用 **`/usr/lib/jvm/java-8-openjdk-amd64`** 进行 **`mvn clean package`**。
- 若交互式环境中 **`JAVA_HOME` 已指向 JDK 11+**,仅写 `JAVA_HOME:-默认值` **不会**覆盖已导出变量;脚本会检测并在非 JDK 8 时 **发出 WARN 并强制改用上述 JDK8 路径**,以保证与本 reactor 一致。
- 若需使用其他 JDK 8 安装路径,请先 **`export JAVA_HOME=/path/to/jdk8`**(确保 `java -version` 为 1.8),再执行脚本。
## 自动生成脚本
使用 **`create-release-bundle.sh`**(位于本目录,可执行)从反应堆根执行 **`mvn clean package -DskipTests`**,并生成符合上述规范的目录与 `RELEASE.txt`
用法示例:
```bash
cd /path/to/maven-ninca-common-component-organization
./releases/create-release-bundle.sh
RELEASE_DATE=20260506 ./releases/create-release-bundle.sh
```
环境变量(可选):
- **`RELEASE_DATE`**:目录后缀 `YYYYMMDD`,默认当天。
- **`DEPLOY_TEMPLATE_ROOT`**:覆盖部署包模板目录(默认见上文「配置文件来源」)。
- **`DOCS_SQL_ROOT`**:覆盖 **`sql/`** 脚本来源目录(默认 **`源码/docs/sql`**,即反应堆上一级目录下的 `docs/sql`)。
## 与 `deploy-implementation-package/` 的关系
构建产物路径、制品暂存等说明见同仓库:
**[../deploy-implementation-package/README.md](../deploy-implementation-package/README.md)**
(若该文件不存在,请以反应堆根 `pom.xml` 与 starter 模块 `target/` 为准。)
## Git 与大文件
本目录下的 **`ninca-common-component-organization-*/` 发布子目录**(含 fat jar)通过 **`releases/.gitignore`** 忽略,避免将大体积二进制提交入库;**`README.md`** 与 **`create-release-bundle.sh`** 仍正常跟踪。
## 手工 `java -jar`(不用 start.sh)时
若从其它工作目录直接启动,请显式指定配置目录与可写日志路径,例如:
`--spring.config.location=file:<发布包绝对路径>/``--logging.path=<同目录下 logs 或 /tmp/...>`
仅写 `--spring.config.location` 时若未覆盖 `logging.path`,且 `application.properties` 仍指向生产路径 `/data/cwos/...`,会因无法创建目录导致 **Logback 初始化失败**
---
**English (short):** `releases/` holds versioned, deployable bundles (fat JAR + config + `start.sh` + `RELEASE.txt` + optional symlink), named `ninca-common-component-organization-<maven-version>-<YYYYMMDD>/`. Build requires JDK 8 and `all-lib/`. Use `create-release-bundle.sh` to reproduce bundles consistently.
@@ -0,0 +1,189 @@
#!/usr/bin/env bash
# 从反应堆根构建 fat JAR,并在 releases/ 下生成发布目录。
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REACTOR_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
DEFAULT_JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64"
export JAVA_HOME="${JAVA_HOME:-$DEFAULT_JAVA_HOME}"
# 若登录 shell 已将 JAVA_HOME 设为 JDK 11+:- 默认值不会生效;发布编译仍须 JDK 8
if ! "${JAVA_HOME}/bin/java" -version 2>&1 | grep -qE 'version "1\.8\.|java version "1\.8\.'; then
echo "WARN: 当前 JAVA_HOME${JAVA_HOME})不是 JDK 8;发布构建将改用 ${DEFAULT_JAVA_HOME}" >&2
export JAVA_HOME="$DEFAULT_JAVA_HOME"
fi
# 默认:顶层部署包中的组件模板目录(application-node.properties / bootstrap.properties
DEFAULT_DEPLOY_TEMPLATE="/media/zebra/9e8fa357-7db6-4d70-88ed-d5de5a059a663/星河湾星中星/部署包/ninca_common_component_organization_01-ninca_common_component_organization"
DEPLOY_TEMPLATE="${DEPLOY_TEMPLATE_ROOT:-$DEFAULT_DEPLOY_TEMPLATE}"
# 与租户访客策略相关的 SQL 权威源(与电梯 prepare-db / release-cw-elevator 共用 docs/sql
DEFAULT_DOCS_SQL="$(cd "${SCRIPT_DIR}/../../docs/sql" 2>/dev/null && pwd)" || true
if [[ -z "${DEFAULT_DOCS_SQL}" || ! -d "${DEFAULT_DOCS_SQL}" ]]; then
DEFAULT_DOCS_SQL="/media/zebra/9e8fa357-7db6-4d70-88ed-d5de5a059a663/星河湾星中星/源码/docs/sql"
fi
DOCS_SQL="${DOCS_SQL_ROOT:-$DEFAULT_DOCS_SQL}"
RELEASE_DATE="${RELEASE_DATE:-$(date +%Y%m%d)}"
die() { echo "ERROR: $*" >&2; exit 1; }
read_version_from_pom() {
local pom="${REACTOR_ROOT}/pom.xml"
[[ -f "$pom" ]] || die "找不到反应堆 pom.xml: $pom"
awk '
/<artifactId>ninca-common-component-organization-reactor<\/artifactId>/ { inr=1 }
inr && /<version>/ {
sub(/.*<version>/, "")
sub(/<\/version>.*/, "")
print
exit
}
' "$pom"
}
read_version_mvn() {
# 备用:mvn help:evaluate(部分环境 -q 会吞掉 stdout,故解析最后一行语义化版本)
(cd "$REACTOR_ROOT" && mvn -DforceStdout help:evaluate -Dexpression=project.version -f pom.xml 2>/dev/null \
| grep -E '^[0-9]' | tail -1) || true
}
if [[ ! -x "${JAVA_HOME}/bin/java" ]]; then
die "JAVA_HOME 无效或缺少 java 可执行文件: ${JAVA_HOME}/bin/java"
fi
if [[ ! -d "${REACTOR_ROOT}/all-lib" ]]; then
echo "WARN: 未找到 all-lib/${REACTOR_ROOT}/all-lib)。打包可能失败;请先准备本地扁平依赖库。" >&2
fi
VERSION="$(read_version_from_pom)"
if [[ -z "${VERSION}" ]]; then
VERSION="$(read_version_mvn)"
fi
[[ -n "${VERSION}" ]] || die "无法从 pom.xml 解析反应堆版本"
SEMVER="${VERSION%%-*}"
JAR_BASENAME="ninca-common-component-organization-${VERSION}.jar"
SOURCE_JAR="${REACTOR_ROOT}/cwos-component-organization-starter/target/${JAR_BASENAME}"
BUNDLE_NAME="ninca-common-component-organization-${VERSION}-${RELEASE_DATE}"
OUT_DIR="${SCRIPT_DIR}/${BUNDLE_NAME}"
SYMLINK_NAME="ninca-common-component-organization-V${SEMVER}_${RELEASE_DATE}.jar"
echo "==> Reactor: ${REACTOR_ROOT}"
echo "==> Version: ${VERSION}"
echo "==> Release date: ${RELEASE_DATE}"
echo "==> Output dir: ${OUT_DIR}"
(cd "$REACTOR_ROOT" && mvn clean package -DskipTests)
[[ -f "$SOURCE_JAR" ]] || die "未找到构建产物: ${SOURCE_JAR}(请先确认 starter 已成功 repackage"
mkdir -p "$OUT_DIR"
cp -f "$SOURCE_JAR" "${OUT_DIR}/${JAR_BASENAME}"
copy_if_exists() {
local src="$1" dest="$2"
if [[ -f "$src" ]]; then
cp -f "$src" "$dest"
echo "==> 已复制: $(basename "$src") <- ${src}"
else
echo "WARN: 跳过(文件不存在): $src" >&2
fi
}
copy_if_exists "${DEPLOY_TEMPLATE}/application-node.properties" "${OUT_DIR}/application-node.properties"
copy_if_exists "${DEPLOY_TEMPLATE}/bootstrap.properties" "${OUT_DIR}/bootstrap.properties"
# 可选:与 jar 内 logging.config=classpath:recognition-logback.xml 搭配外置覆盖时使用
copy_if_exists "${REACTOR_ROOT}/cwos-component-organization-starter/src/main/resources/recognition-logback.xml" "${OUT_DIR}/recognition-logback.xml"
# 组织组件交付包内附带与策略表相关的 SQL(执行库以脚本注释为准;多为 cw-elevator-application_init 含 component-organization 主数据 id
SQL_DIR="${OUT_DIR}/sql"
mkdir -p "${SQL_DIR}"
SQL_NAMES=(
tenant_visitor_floor_policy.sql
tenant_visitor_floor_policy_v2.sql
tenant_visitor_floor_policy_migrate_org_id.sql
tenant_visitor_floor_policy_init_guangfa_fund.sql
tenant_visitor_floor_policy_init_property_mgmt_6f.sql
organization_tenant_visitor_floor_policy.sql
organization_tenant_visitor_floor_policy_v2.sql
organization_tenant_visitor_floor_policy_init_guangfa_fund.sql
organization_tenant_visitor_floor_policy_init_property_mgmt_6f.sql
organization_tenant_visitor_floor_policy_full_install.sql
)
for base in "${SQL_NAMES[@]}"; do
copy_if_exists "${DOCS_SQL}/${base}" "${SQL_DIR}/${base}"
done
if [[ -d "${SQL_DIR}" ]] && [[ -n "$(find "${SQL_DIR}" -maxdepth 1 -name '*.sql' -print -quit)" ]]; then
cat > "${SQL_DIR}/README.txt" << 'EOSQL'
本目录 SQL 与源码 docs/sql 下权威文件一致,随组织组件发布包一并交付。
说明(概要):
- tenant_visitor_floor_policy.sql:电梯库,先 DROP 再 CREATE(含 org_id 最终结构);见各 init 文件头。
- organization_tenant_visitor_floor_policy*.sql:组织库 component-organizationDDL/full_install 会先 DROP 策略表再重建。
- tenant_visitor_floor_policy_migrate_org_id.sql:迁移/运维说明(注释为主)。
- *_init_*.sql:种子数据(DML),org_id 需与 cw_is_organization 一致。
执行顺序与现网是否已有表有关,实施前请对照 docs/business 下设计文档。
EOSQL
echo "==> 已写入: sql/README.txt"
fi
cat > "${OUT_DIR}/start.sh" << EOF
#!/usr/bin/env bash
set -euo pipefail
DIR="\$(cd "\$(dirname "\${BASH_SOURCE[0]}")" && pwd)"
cd "\${DIR}"
JAR_NAME="${JAR_BASENAME}"
# classpath 加载 jar 内公共 application.propertiesfile 加载本目录 application-node + bootstrap
exec "\${JAVA_HOME:-/usr/lib/jvm/java-8-openjdk-amd64}/bin/java" -jar "\${DIR}/\${JAR_NAME}" \\
--spring.config.location="classpath:/,file:\${DIR}/" \\
--spring.config.name=application,application-node \\
--logging.path="\${DIR}/logs" \\
"\$@"
EOF
chmod +x "${OUT_DIR}/start.sh"
(cd "$OUT_DIR" && ln -sf "${JAR_BASENAME}" "${SYMLINK_NAME}")
SHA256="$(sha256sum "${OUT_DIR}/${JAR_BASENAME}" | awk '{ print $1 }')"
ABS_OUT="$(cd "$OUT_DIR" && pwd)"
ABS_JAR="${ABS_OUT}/${JAR_BASENAME}"
{
echo "Component: ninca-common-component-organization (starter fat jar)"
echo "Reactor version (pom.xml): ${VERSION}"
echo "Release bundle: ${BUNDLE_NAME}"
echo "Date stamp: ${RELEASE_DATE}"
echo ""
echo "Build command:"
echo " export JAVA_HOME=${JAVA_HOME}"
echo " cd \"${REACTOR_ROOT}\""
echo " mvn clean package -DskipTests"
echo ""
echo "Fat jar artifact:"
echo " ${ABS_JAR}"
echo "SHA256:"
echo " ${SHA256}"
echo ""
echo "Files in this directory:"
echo " - sql/(租户访客策略相关脚本,来自 docs/sql;含 README.txt"
echo " - application-node.properties(节点 Consul/instance-id;若部署包模板存在则已复制)"
echo " - bootstrap.properties (若部署包模板存在则已复制)"
echo " - ${JAR_BASENAME}"
echo " - ${SYMLINK_NAME}"
echo " - RELEASE.txt"
echo " - start.sh"
echo ""
echo "Symlink (ops naming):"
echo " ${SYMLINK_NAME} -> ${JAR_BASENAME}"
echo ""
echo "Start:"
echo " bash \"${ABS_OUT}/start.sh\""
} > "${OUT_DIR}/RELEASE.txt"
echo ""
echo "========================================"
echo "Release bundle: ${ABS_OUT}"
echo "SHA256 (${JAR_BASENAME}):"
echo " ${SHA256}"
echo "========================================"
File diff suppressed because it is too large Load Diff