mirror of
https://github.com/hpd840321/starRiverProperty.git
synced 2026-06-09 08:20:31 +08:00
fix: auto-fix decompile type errors in component-org service module
- Delete 5 duplicate Java files in wrong nested cn/ directory - Fix 15 raw List declarations with generic type params in OrganizationServiceImpl - Apply (CloudwalkResult) raw cast to 107 fail() + 165 success() calls across all 46 service files via ast-grep - Remaining: 106 Object->cast and other manual-context errors
This commit is contained in:
+28
-28
@@ -75,24 +75,24 @@ implements AreaService {
|
|||||||
getsAreaDTO.setId(param.getParentId());
|
getsAreaDTO.setId(param.getParentId());
|
||||||
List list = this.imgStoreAreaMapper.gets(getsAreaDTO);
|
List list = this.imgStoreAreaMapper.gets(getsAreaDTO);
|
||||||
if (CollectionUtils.isEmpty((Collection)list)) {
|
if (CollectionUtils.isEmpty((Collection)list)) {
|
||||||
return CloudwalkResult.fail((String)"53015100", (String)this.getMessage("53015100"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
Area area = (Area)list.get(0);
|
Area area = (Area)list.get(0);
|
||||||
AreaType areaType = this.imgStoreAreaTypeMapper.selectByPrimaryKey(area.getTypeId());
|
AreaType areaType = this.imgStoreAreaTypeMapper.selectByPrimaryKey(area.getTypeId());
|
||||||
if (areaType != null && areaType.getHasLowerLevel() != 1) {
|
if (areaType != null && areaType.getHasLowerLevel() != 1) {
|
||||||
return CloudwalkResult.fail((String)"53015101", (String)this.getMessage("53015101"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
List parent = this.imgStoreAreaMapper.getParentNode(businessId);
|
List parent = this.imgStoreAreaMapper.getParentNode(businessId);
|
||||||
if (!CollectionUtils.isEmpty((Collection)parent)) {
|
if (!CollectionUtils.isEmpty((Collection)parent)) {
|
||||||
return CloudwalkResult.fail((String)"53015102", (String)this.getMessage("53015102"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
getsAreaDTO.setId(null);
|
getsAreaDTO.setId(null);
|
||||||
getsAreaDTO.setName(param.getName());
|
getsAreaDTO.setName(param.getName());
|
||||||
List names = this.imgStoreAreaMapper.gets(getsAreaDTO);
|
List names = this.imgStoreAreaMapper.gets(getsAreaDTO);
|
||||||
if (!CollectionUtils.isEmpty((Collection)names)) {
|
if (!CollectionUtils.isEmpty((Collection)names)) {
|
||||||
return CloudwalkResult.fail((String)"53015103", (String)this.getMessage("53015103"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
long time = System.currentTimeMillis();
|
long time = System.currentTimeMillis();
|
||||||
Area area = (Area)BeanCopyUtils.copyProperties((Object)param, Area.class);
|
Area area = (Area)BeanCopyUtils.copyProperties((Object)param, Area.class);
|
||||||
@@ -106,7 +106,7 @@ implements AreaService {
|
|||||||
area.setParentId(param.getParentId());
|
area.setParentId(param.getParentId());
|
||||||
area.setBusinessId(businessId);
|
area.setBusinessId(businessId);
|
||||||
this.imgStoreAreaMapper.insertSelective(area);
|
this.imgStoreAreaMapper.insertSelective(area);
|
||||||
return CloudwalkResult.success((Object)area.getId());
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
@CloudwalkParamsValidate
|
@CloudwalkParamsValidate
|
||||||
@@ -118,7 +118,7 @@ implements AreaService {
|
|||||||
getsAreaDTO.setIsDel(Short.valueOf((short)0));
|
getsAreaDTO.setIsDel(Short.valueOf((short)0));
|
||||||
List areaList = this.imgStoreAreaMapper.gets(getsAreaDTO);
|
List areaList = this.imgStoreAreaMapper.gets(getsAreaDTO);
|
||||||
if (CollectionUtils.isEmpty((Collection)areaList)) {
|
if (CollectionUtils.isEmpty((Collection)areaList)) {
|
||||||
return CloudwalkResult.fail((String)"53015104", (String)this.getMessage("53015104"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
List res = null;
|
List res = null;
|
||||||
Area old = (Area)areaList.get(0);
|
Area old = (Area)areaList.get(0);
|
||||||
@@ -127,7 +127,7 @@ implements AreaService {
|
|||||||
if (!StringUtils.isEmpty((CharSequence)param.getParentId())) {
|
if (!StringUtils.isEmpty((CharSequence)param.getParentId())) {
|
||||||
Area parent = this.imgStoreAreaMapper.selectByPrimaryKey(param.getParentId());
|
Area parent = this.imgStoreAreaMapper.selectByPrimaryKey(param.getParentId());
|
||||||
if (parent == null || parent.getIsDel() == 1 || !businessId.equals(parent.getBusinessId())) {
|
if (parent == null || parent.getIsDel() == 1 || !businessId.equals(parent.getBusinessId())) {
|
||||||
return CloudwalkResult.fail((String)"53015100", (String)this.getMessage("53015100"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
res = BeanCopyUtils.copy((Collection)this.imgStoreAreaMapper.getAllArea(businessId), TreeAreaResult.class);
|
res = BeanCopyUtils.copy((Collection)this.imgStoreAreaMapper.getAllArea(businessId), TreeAreaResult.class);
|
||||||
TreeAreaResult currentNode = null;
|
TreeAreaResult currentNode = null;
|
||||||
@@ -151,7 +151,7 @@ implements AreaService {
|
|||||||
this.judgeTreeNode(currentNode.getChildren(), values);
|
this.judgeTreeNode(currentNode.getChildren(), values);
|
||||||
values.add(param.getId());
|
values.add(param.getId());
|
||||||
if (values.contains(param.getParentId())) {
|
if (values.contains(param.getParentId())) {
|
||||||
return CloudwalkResult.fail((String)"53015105", (String)this.getMessage("53015105"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
edit.setParentId(param.getParentId());
|
edit.setParentId(param.getParentId());
|
||||||
@@ -162,14 +162,14 @@ implements AreaService {
|
|||||||
}
|
}
|
||||||
for (TreeAreaResult org : res) {
|
for (TreeAreaResult org : res) {
|
||||||
if (!org.getName().equals(param.getName()) || org.getId().equals(param.getId())) continue;
|
if (!org.getName().equals(param.getName()) || org.getId().equals(param.getId())) continue;
|
||||||
return CloudwalkResult.fail((String)"53015103", (String)this.getMessage("53015103"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
edit.setName(param.getName());
|
edit.setName(param.getName());
|
||||||
}
|
}
|
||||||
edit.setLastUpdateUserId(context.getUser().getCaller());
|
edit.setLastUpdateUserId(context.getUser().getCaller());
|
||||||
edit.setLastUpdateTime(Long.valueOf(System.currentTimeMillis()));
|
edit.setLastUpdateTime(Long.valueOf(System.currentTimeMillis()));
|
||||||
this.imgStoreAreaMapper.updateByPrimaryKeySelective(edit);
|
this.imgStoreAreaMapper.updateByPrimaryKeySelective(edit);
|
||||||
return CloudwalkResult.success((Object)Boolean.TRUE);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
@CloudwalkParamsValidate
|
@CloudwalkParamsValidate
|
||||||
@@ -177,15 +177,15 @@ implements AreaService {
|
|||||||
String businessId = StringUtils.isNotBlank((CharSequence)param.getBusinessId()) ? param.getBusinessId() : context.getCompany().getCompanyId();
|
String businessId = StringUtils.isNotBlank((CharSequence)param.getBusinessId()) ? param.getBusinessId() : context.getCompany().getCompanyId();
|
||||||
if (!CollectionUtils.isEmpty((Collection)param.getIds())) {
|
if (!CollectionUtils.isEmpty((Collection)param.getIds())) {
|
||||||
if (this.imgStoreAreaMapper.getAreaByIds(param.getIds(), businessId).size() != param.getIds().size()) {
|
if (this.imgStoreAreaMapper.getAreaByIds(param.getIds(), businessId).size() != param.getIds().size()) {
|
||||||
return CloudwalkResult.fail((String)"53060411", (String)this.getMessage("53060411"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
if (!CollectionUtils.isEmpty((Collection)this.imgStoreAreaMapper.getParentIdIsNull(param.getIds()))) {
|
if (!CollectionUtils.isEmpty((Collection)this.imgStoreAreaMapper.getParentIdIsNull(param.getIds()))) {
|
||||||
return CloudwalkResult.fail((String)"53015106", (String)this.getMessage("53015106"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
this.imgStoreAreaMapper.batchDel(param.getIds(), System.currentTimeMillis(), context.getUser().getCaller(), businessId);
|
this.imgStoreAreaMapper.batchDel(param.getIds(), System.currentTimeMillis(), context.getUser().getCaller(), businessId);
|
||||||
this.imgStoreUnitAreaMapper.deleteByAreaIds(param.getIds());
|
this.imgStoreUnitAreaMapper.deleteByAreaIds(param.getIds());
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)Boolean.TRUE);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -231,7 +231,7 @@ implements AreaService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return CloudwalkResult.fail((String)"53015107", (String)this.getMessage("53015107"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
TreeAreaResult result = (TreeAreaResult)BeanCopyUtils.copyProperties((Object)area, TreeAreaResult.class);
|
TreeAreaResult result = (TreeAreaResult)BeanCopyUtils.copyProperties((Object)area, TreeAreaResult.class);
|
||||||
result.setChildren(null);
|
result.setChildren(null);
|
||||||
@@ -240,7 +240,7 @@ implements AreaService {
|
|||||||
result.setType(areaType.getName());
|
result.setType(areaType.getName());
|
||||||
result.setHasLowerLevel(areaType.getHasLowerLevel());
|
result.setHasLowerLevel(areaType.getHasLowerLevel());
|
||||||
tree.add(result);
|
tree.add(result);
|
||||||
return CloudwalkResult.success(tree);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
res = res.stream().filter(ToolUtil.distinctByKey(TreeAreaResult::getId)).collect(Collectors.toList());
|
res = res.stream().filter(ToolUtil.distinctByKey(TreeAreaResult::getId)).collect(Collectors.toList());
|
||||||
} else {
|
} else {
|
||||||
@@ -263,7 +263,7 @@ implements AreaService {
|
|||||||
tree.add(nodeX);
|
tree.add(nodeX);
|
||||||
}
|
}
|
||||||
this.addLevel(tree, 1);
|
this.addLevel(tree, 1);
|
||||||
return CloudwalkResult.success(tree);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<TreeAreaResult> getTreeByParentId(String parentId, String businessId) {
|
private List<TreeAreaResult> getTreeByParentId(String parentId, String businessId) {
|
||||||
@@ -346,31 +346,31 @@ implements AreaService {
|
|||||||
nextTreeAreaResult.setHasLowerLevel(null);
|
nextTreeAreaResult.setHasLowerLevel(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)res);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
@CloudwalkParamsValidate
|
@CloudwalkParamsValidate
|
||||||
public CloudwalkResult<Boolean> addUnit(AddUnitAreaParam unitAreaParam, CloudwalkCallContext context) {
|
public CloudwalkResult<Boolean> addUnit(AddUnitAreaParam unitAreaParam, CloudwalkCallContext context) {
|
||||||
if (CollectionUtils.isEmpty((Collection)unitAreaParam.getUnitIds())) {
|
if (CollectionUtils.isEmpty((Collection)unitAreaParam.getUnitIds())) {
|
||||||
return CloudwalkResult.fail((String)"53060411", (String)this.getMessage("53060411"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
Area unitArea = this.imgStoreAreaMapper.selectByPrimaryKey(unitAreaParam.getAreaId());
|
Area unitArea = this.imgStoreAreaMapper.selectByPrimaryKey(unitAreaParam.getAreaId());
|
||||||
if (unitArea == null || unitArea.getIsDel() == 1 || !context.getCompany().getCompanyId().equals(unitArea.getBusinessId())) {
|
if (unitArea == null || unitArea.getIsDel() == 1 || !context.getCompany().getCompanyId().equals(unitArea.getBusinessId())) {
|
||||||
return CloudwalkResult.fail((String)"53015104", (String)this.getMessage("53015104"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
List unitIds = this.imgStoreAreaMapper.getUnitIdInRef((AddUnitAreaDTO)BeanCopyUtils.copyProperties((Object)unitAreaParam, AddUnitAreaDTO.class));
|
List unitIds = this.imgStoreAreaMapper.getUnitIdInRef((AddUnitAreaDTO)BeanCopyUtils.copyProperties((Object)unitAreaParam, AddUnitAreaDTO.class));
|
||||||
if (!CollectionUtils.isEmpty((Collection)unitIds)) {
|
if (!CollectionUtils.isEmpty((Collection)unitIds)) {
|
||||||
unitAreaParam.getUnitIds().removeAll(unitIds);
|
unitAreaParam.getUnitIds().removeAll(unitIds);
|
||||||
}
|
}
|
||||||
if (CollectionUtils.isEmpty((Collection)unitAreaParam.getUnitIds())) {
|
if (CollectionUtils.isEmpty((Collection)unitAreaParam.getUnitIds())) {
|
||||||
return CloudwalkResult.success((Object)Boolean.TRUE);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
GetsOrganizationDTO dto = new GetsOrganizationDTO();
|
GetsOrganizationDTO dto = new GetsOrganizationDTO();
|
||||||
dto.setIds(unitAreaParam.getUnitIds());
|
dto.setIds(unitAreaParam.getUnitIds());
|
||||||
dto.setBusinessId(StringUtils.isEmpty((CharSequence)unitAreaParam.getBusinessId()) ? context.getCompany().getCompanyId() : unitAreaParam.getBusinessId());
|
dto.setBusinessId(StringUtils.isEmpty((CharSequence)unitAreaParam.getBusinessId()) ? context.getCompany().getCompanyId() : unitAreaParam.getBusinessId());
|
||||||
dto.setIsDel(DelStatusEnum.NORAML.getCode());
|
dto.setIsDel(DelStatusEnum.NORAML.getCode());
|
||||||
if (this.organizationMapper.gets(dto).size() != unitAreaParam.getUnitIds().size()) {
|
if (this.organizationMapper.gets(dto).size() != unitAreaParam.getUnitIds().size()) {
|
||||||
return CloudwalkResult.fail((String)"53015108", (String)this.getMessage("53015108"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
ArrayList<ImgStoreUnitArea> list = new ArrayList<ImgStoreUnitArea>();
|
ArrayList<ImgStoreUnitArea> list = new ArrayList<ImgStoreUnitArea>();
|
||||||
long time = System.currentTimeMillis();
|
long time = System.currentTimeMillis();
|
||||||
@@ -390,7 +390,7 @@ implements AreaService {
|
|||||||
batchUpdateDTO.setIds(unitAreaParam.getUnitIds());
|
batchUpdateDTO.setIds(unitAreaParam.getUnitIds());
|
||||||
batchUpdateDTO.setLastUpdateTime(Long.valueOf(System.currentTimeMillis()));
|
batchUpdateDTO.setLastUpdateTime(Long.valueOf(System.currentTimeMillis()));
|
||||||
this.organizationMapper.updateBatchByIds(batchUpdateDTO);
|
this.organizationMapper.updateBatchByIds(batchUpdateDTO);
|
||||||
return CloudwalkResult.success((Object)Boolean.TRUE);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
@CloudwalkParamsValidate
|
@CloudwalkParamsValidate
|
||||||
@@ -401,7 +401,7 @@ implements AreaService {
|
|||||||
getsAreaDTO.setBusinessId(businessId);
|
getsAreaDTO.setBusinessId(businessId);
|
||||||
List areaList = this.imgStoreAreaMapper.gets(getsAreaDTO);
|
List areaList = this.imgStoreAreaMapper.gets(getsAreaDTO);
|
||||||
if (CollectionUtils.isEmpty((Collection)areaList)) {
|
if (CollectionUtils.isEmpty((Collection)areaList)) {
|
||||||
return CloudwalkResult.fail((String)"53015104", (String)this.getMessage("53015104"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
if (!CollectionUtils.isEmpty((Collection)delUnitAreaParam.getUnitIds())) {
|
if (!CollectionUtils.isEmpty((Collection)delUnitAreaParam.getUnitIds())) {
|
||||||
this.organizationMapper.batchDel(delUnitAreaParam.getUnitIds(), System.currentTimeMillis(), context.getUser().getCaller(), businessId);
|
this.organizationMapper.batchDel(delUnitAreaParam.getUnitIds(), System.currentTimeMillis(), context.getUser().getCaller(), businessId);
|
||||||
@@ -410,7 +410,7 @@ implements AreaService {
|
|||||||
batchUpdateDTO.setLastUpdateTime(Long.valueOf(System.currentTimeMillis()));
|
batchUpdateDTO.setLastUpdateTime(Long.valueOf(System.currentTimeMillis()));
|
||||||
this.organizationMapper.updateBatchByIds(batchUpdateDTO);
|
this.organizationMapper.updateBatchByIds(batchUpdateDTO);
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)Boolean.TRUE);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<List<AreaResult>> getList(QueryAreaParam param, CloudwalkCallContext context) {
|
public CloudwalkResult<List<AreaResult>> getList(QueryAreaParam param, CloudwalkCallContext context) {
|
||||||
@@ -461,7 +461,7 @@ implements AreaService {
|
|||||||
result.setHasLowerLevel(null);
|
result.setHasLowerLevel(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)resultList);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<CloudwalkPageAble<AreaResult>> getPage(QueryAreaParam param, CloudwalkPageInfo page, CloudwalkCallContext context) {
|
public CloudwalkResult<CloudwalkPageAble<AreaResult>> getPage(QueryAreaParam param, CloudwalkPageInfo page, CloudwalkCallContext context) {
|
||||||
@@ -513,7 +513,7 @@ implements AreaService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
CloudwalkPageAble pageAble = new CloudwalkPageAble((Collection)resultList, page, pageData.getTotal());
|
CloudwalkPageAble pageAble = new CloudwalkPageAble((Collection)resultList, page, pageData.getTotal());
|
||||||
return CloudwalkResult.success((Object)pageAble);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<AreaResult> detail(QueryAreaParam param, CloudwalkCallContext context) {
|
public CloudwalkResult<AreaResult> detail(QueryAreaParam param, CloudwalkCallContext context) {
|
||||||
@@ -521,7 +521,7 @@ implements AreaService {
|
|||||||
getsAreaDTO.setIsDel(Short.valueOf((short)0));
|
getsAreaDTO.setIsDel(Short.valueOf((short)0));
|
||||||
List resultData = this.imgStoreAreaMapper.gets(getsAreaDTO);
|
List resultData = this.imgStoreAreaMapper.gets(getsAreaDTO);
|
||||||
if (CollectionUtils.isEmpty((Collection)resultData)) {
|
if (CollectionUtils.isEmpty((Collection)resultData)) {
|
||||||
return CloudwalkResult.success(null);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
Area area = (Area)resultData.get(0);
|
Area area = (Area)resultData.get(0);
|
||||||
String areaId = area.getId();
|
String areaId = area.getId();
|
||||||
@@ -544,7 +544,7 @@ implements AreaService {
|
|||||||
if (result.getParentId() == null) {
|
if (result.getParentId() == null) {
|
||||||
result.setLevel(Integer.valueOf(1));
|
result.setLevel(Integer.valueOf(1));
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)result);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addLevel(List<TreeAreaResult> tree, int level) {
|
private void addLevel(List<TreeAreaResult> tree, int level) {
|
||||||
|
|||||||
+6
-6
@@ -101,7 +101,7 @@ implements AreaTypeService {
|
|||||||
this.areaTypePropertiesMapper.insertSelective(property);
|
this.areaTypePropertiesMapper.insertSelective(property);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)uuid);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(rollbackFor={Exception.class})
|
@Transactional(rollbackFor={Exception.class})
|
||||||
@@ -239,7 +239,7 @@ implements AreaTypeService {
|
|||||||
this.areaTypePropertiesMapper.insertSelective(areaTypeProperties);
|
this.areaTypePropertiesMapper.insertSelective(areaTypeProperties);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)Boolean.TRUE);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(rollbackFor={Exception.class})
|
@Transactional(rollbackFor={Exception.class})
|
||||||
@@ -276,7 +276,7 @@ implements AreaTypeService {
|
|||||||
this.areaTypePropertiesMapper.updateByTypeKey(record);
|
this.areaTypePropertiesMapper.updateByTypeKey(record);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)Boolean.TRUE);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<CloudwalkPageAble<AreaTypeListResult>> page(QueryAreaTypeParam param, CloudwalkPageInfo page, CloudwalkCallContext context) throws ServiceException {
|
public CloudwalkResult<CloudwalkPageAble<AreaTypeListResult>> page(QueryAreaTypeParam param, CloudwalkPageInfo page, CloudwalkCallContext context) throws ServiceException {
|
||||||
@@ -309,7 +309,7 @@ implements AreaTypeService {
|
|||||||
results.add(typeResult);
|
results.add(typeResult);
|
||||||
}
|
}
|
||||||
CloudwalkPageAble pageAble = new CloudwalkPageAble(results, page, gets.getTotal());
|
CloudwalkPageAble pageAble = new CloudwalkPageAble(results, page, gets.getTotal());
|
||||||
return CloudwalkResult.success((Object)pageAble);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
this.logger.error("分页查询区域类型信息失败,原因:", e);
|
this.logger.error("分页查询区域类型信息失败,原因:", e);
|
||||||
@@ -365,7 +365,7 @@ implements AreaTypeService {
|
|||||||
results.add(typeResult);
|
results.add(typeResult);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success(results);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<AreaTypeResult> detail(QueryAreaTypeParam param, CloudwalkCallContext cloudwalkContext) throws ServiceException {
|
public CloudwalkResult<AreaTypeResult> detail(QueryAreaTypeParam param, CloudwalkCallContext cloudwalkContext) throws ServiceException {
|
||||||
@@ -378,7 +378,7 @@ implements AreaTypeService {
|
|||||||
proQuery.setAreaTypeId(param.getId());
|
proQuery.setAreaTypeId(param.getId());
|
||||||
List typeProperties = this.areaTypePropertiesMapper.select(proQuery);
|
List typeProperties = this.areaTypePropertiesMapper.select(proQuery);
|
||||||
result.setProperties(BeanCopyUtils.copy((Collection)typeProperties, AreaTypePropertyParam.class));
|
result.setProperties(BeanCopyUtils.copy((Collection)typeProperties, AreaTypePropertyParam.class));
|
||||||
return CloudwalkResult.success((Object)result);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getCode(Set<String> codeSet) {
|
private String getCode(Set<String> codeSet) {
|
||||||
|
|||||||
+15
-15
@@ -86,28 +86,28 @@ implements IPersonRegistryHandler {
|
|||||||
} else {
|
} else {
|
||||||
this.insert(param, context);
|
this.insert(param, context);
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)true);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
private CloudwalkResult<Boolean> validateParams(AddPersonRegistryParam param, CloudwalkCallContext context) throws ServiceException {
|
private CloudwalkResult<Boolean> validateParams(AddPersonRegistryParam param, CloudwalkCallContext context) throws ServiceException {
|
||||||
if (Objects.equals(param.getDeviceStatus(), StatusEnum.CLOSE.getValue()) && StringUtils.isBlank((CharSequence)param.getOrganizationIds()) && StringUtils.isBlank((CharSequence)param.getLabelIds())) {
|
if (Objects.equals(param.getDeviceStatus(), StatusEnum.CLOSE.getValue()) && StringUtils.isBlank((CharSequence)param.getOrganizationIds()) && StringUtils.isBlank((CharSequence)param.getLabelIds())) {
|
||||||
this.logger.warn("人证注册审核关闭,注册默认组织/注册默认标签需要二选一,身份证属性:[{}]", (Object)JSON.toJSONString((Object)param.getPropertyList()));
|
this.logger.warn("人证注册审核关闭,注册默认组织/注册默认标签需要二选一,身份证属性:[{}]", (Object)JSON.toJSONString((Object)param.getPropertyList()));
|
||||||
return CloudwalkResult.fail((String)"53014529", (String)this.getMessage("53014529"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
if (CollectionUtils.isEmpty((Collection)param.getPropertyList())) {
|
if (CollectionUtils.isEmpty((Collection)param.getPropertyList())) {
|
||||||
this.logger.warn("身份证属性未设置,身份证属性:[{}]", (Object)JSON.toJSONString((Object)param.getPropertyList()));
|
this.logger.warn("身份证属性未设置,身份证属性:[{}]", (Object)JSON.toJSONString((Object)param.getPropertyList()));
|
||||||
return CloudwalkResult.fail((String)"53014525", (String)this.getMessage("53014525"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
Optional<BindPropertyParam> optionalCardId = param.getPropertyList().stream().filter(propertyParam -> Objects.equals(propertyParam.getProperty(), CertPropertyEnum.CARD_ID.getValue())).findFirst();
|
Optional<BindPropertyParam> optionalCardId = param.getPropertyList().stream().filter(propertyParam -> Objects.equals(propertyParam.getProperty(), CertPropertyEnum.CARD_ID.getValue())).findFirst();
|
||||||
if (!optionalCardId.isPresent() || optionalCardId.isPresent() && StringUtils.isBlank((CharSequence)optionalCardId.get().getBindPropertyId())) {
|
if (!optionalCardId.isPresent() || optionalCardId.isPresent() && StringUtils.isBlank((CharSequence)optionalCardId.get().getBindPropertyId())) {
|
||||||
this.logger.warn("身份证号未选择关联属性,身份证属性:[{}]", (Object)JSON.toJSONString((Object)param.getPropertyList()));
|
this.logger.warn("身份证号未选择关联属性,身份证属性:[{}]", (Object)JSON.toJSONString((Object)param.getPropertyList()));
|
||||||
return CloudwalkResult.fail((String)"53014526", (String)this.getMessage("53014526"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
Optional<BindPropertyParam> optionalName = param.getPropertyList().stream().filter(propertyParam -> Objects.equals(propertyParam.getProperty(), CertPropertyEnum.NAME.getValue())).findFirst();
|
Optional<BindPropertyParam> optionalName = param.getPropertyList().stream().filter(propertyParam -> Objects.equals(propertyParam.getProperty(), CertPropertyEnum.NAME.getValue())).findFirst();
|
||||||
if (optionalName.isPresent()) {
|
if (optionalName.isPresent()) {
|
||||||
if (StringUtils.isBlank((CharSequence)optionalName.get().getBindPropertyId())) {
|
if (StringUtils.isBlank((CharSequence)optionalName.get().getBindPropertyId())) {
|
||||||
this.logger.warn("姓名未正确关联属性,身份证属性:[{}]", (Object)JSON.toJSONString((Object)param.getPropertyList()));
|
this.logger.warn("姓名未正确关联属性,身份证属性:[{}]", (Object)JSON.toJSONString((Object)param.getPropertyList()));
|
||||||
return CloudwalkResult.fail((String)"53014527", (String)this.getMessage("53014527"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
ImgStorePersonProperties queryPersonPro = new ImgStorePersonProperties();
|
ImgStorePersonProperties queryPersonPro = new ImgStorePersonProperties();
|
||||||
queryPersonPro.setBusinessId(param.getBusinessId());
|
queryPersonPro.setBusinessId(param.getBusinessId());
|
||||||
@@ -116,7 +116,7 @@ implements IPersonRegistryHandler {
|
|||||||
List personPropertyList = this.imgStorePersonPropertiesMapper.select(queryPersonPro);
|
List personPropertyList = this.imgStorePersonPropertiesMapper.select(queryPersonPro);
|
||||||
if (CollectionUtils.isEmpty((Collection)personPropertyList) || !Objects.equals(((ImgStorePersonProperties)personPropertyList.get(0)).getCode(), "name")) {
|
if (CollectionUtils.isEmpty((Collection)personPropertyList) || !Objects.equals(((ImgStorePersonProperties)personPropertyList.get(0)).getCode(), "name")) {
|
||||||
this.logger.warn("姓名未正确关联属性,身份证属性:[{}]", (Object)JSON.toJSONString((Object)param.getPropertyList()));
|
this.logger.warn("姓名未正确关联属性,身份证属性:[{}]", (Object)JSON.toJSONString((Object)param.getPropertyList()));
|
||||||
return CloudwalkResult.fail((String)"53014527", (String)this.getMessage("53014527"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HashSet propertySet = Sets.newHashSet();
|
HashSet propertySet = Sets.newHashSet();
|
||||||
@@ -127,12 +127,12 @@ implements IPersonRegistryHandler {
|
|||||||
});
|
});
|
||||||
if (propertySet.size() < param.getPropertyList().size() || bindPropertySet.size() < param.getPropertyList().size()) {
|
if (propertySet.size() < param.getPropertyList().size() || bindPropertySet.size() < param.getPropertyList().size()) {
|
||||||
this.logger.warn("身份证属性和人员属性为一对一关系,不能一对多,身份证属性:[{}]", (Object)JSON.toJSONString((Object)param.getPropertyList()));
|
this.logger.warn("身份证属性和人员属性为一对一关系,不能一对多,身份证属性:[{}]", (Object)JSON.toJSONString((Object)param.getPropertyList()));
|
||||||
return CloudwalkResult.fail((String)"53014528", (String)this.getMessage("53014528"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
this.commonPersonRegistryService.validateOrg(param);
|
this.commonPersonRegistryService.validateOrg(param);
|
||||||
this.commonPersonRegistryService.validateLabel(param);
|
this.commonPersonRegistryService.validateLabel(param);
|
||||||
this.commonPersonRegistryService.validateDevice(param, context);
|
this.commonPersonRegistryService.validateDevice(param, context);
|
||||||
return CloudwalkResult.success((Object)true);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
private CloudwalkResult<Boolean> insert(AddPersonRegistryParam param, CloudwalkCallContext context) throws ServiceException {
|
private CloudwalkResult<Boolean> insert(AddPersonRegistryParam param, CloudwalkCallContext context) throws ServiceException {
|
||||||
@@ -140,14 +140,14 @@ implements IPersonRegistryHandler {
|
|||||||
this.commonPersonRegistryService.insertPersonRegistry(id, param, context);
|
this.commonPersonRegistryService.insertPersonRegistry(id, param, context);
|
||||||
this.commonPersonRegistryService.batchInsertPersonRegistryProperty(id, param);
|
this.commonPersonRegistryService.batchInsertPersonRegistryProperty(id, param);
|
||||||
this.commonPersonRegistryService.batchInsertPersonRegistryDevice(id, param, context, true);
|
this.commonPersonRegistryService.batchInsertPersonRegistryDevice(id, param, context, true);
|
||||||
return CloudwalkResult.success((Object)true);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
private CloudwalkResult<Boolean> update(AddPersonRegistryParam param, CloudwalkCallContext context) throws ServiceException {
|
private CloudwalkResult<Boolean> update(AddPersonRegistryParam param, CloudwalkCallContext context) throws ServiceException {
|
||||||
this.commonPersonRegistryService.updatePersonRegistry(param, context);
|
this.commonPersonRegistryService.updatePersonRegistry(param, context);
|
||||||
this.commonPersonRegistryService.batchUpdatePersonRegistryProperty(param);
|
this.commonPersonRegistryService.batchUpdatePersonRegistryProperty(param);
|
||||||
this.commonPersonRegistryService.batchUpdatePersonRegistryDevice(param, context, true);
|
this.commonPersonRegistryService.batchUpdatePersonRegistryDevice(param, context, true);
|
||||||
return CloudwalkResult.success((Object)true);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<PersonRegistryResult> detail(QueryPersonRegistryParam param, CloudwalkCallContext context) throws ServiceException {
|
public CloudwalkResult<PersonRegistryResult> detail(QueryPersonRegistryParam param, CloudwalkCallContext context) throws ServiceException {
|
||||||
@@ -210,7 +210,7 @@ implements IPersonRegistryHandler {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)result);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<List<PersonPropertiesResult>> getRegistryPropertyList(QueryPersonRegistryParam param, CloudwalkCallContext context) throws ServiceException {
|
public CloudwalkResult<List<PersonPropertiesResult>> getRegistryPropertyList(QueryPersonRegistryParam param, CloudwalkCallContext context) throws ServiceException {
|
||||||
@@ -220,7 +220,7 @@ implements IPersonRegistryHandler {
|
|||||||
}
|
}
|
||||||
PersonRegistry dbPersonRegistry = (PersonRegistry)this.commonPersonRegistryService.getResultByBusinessAndType(businessId, RegistryTypeEnum.CERT_REGISTRY.getValue()).getData();
|
PersonRegistry dbPersonRegistry = (PersonRegistry)this.commonPersonRegistryService.getResultByBusinessAndType(businessId, RegistryTypeEnum.CERT_REGISTRY.getValue()).getData();
|
||||||
this.commonPersonRegistryService.validateDevice(param, dbPersonRegistry);
|
this.commonPersonRegistryService.validateDevice(param, dbPersonRegistry);
|
||||||
return CloudwalkResult.success(this.getPersonPropertyList(dbPersonRegistry, true));
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<List<PersonPropertiesResult>> getAuditPropertyList(QueryPersonRegistryParam param, CloudwalkCallContext context) throws ServiceException {
|
public CloudwalkResult<List<PersonPropertiesResult>> getAuditPropertyList(QueryPersonRegistryParam param, CloudwalkCallContext context) throws ServiceException {
|
||||||
@@ -239,7 +239,7 @@ implements IPersonRegistryHandler {
|
|||||||
property.setValue(String.valueOf(Optional.ofNullable(value).orElse("")));
|
property.setValue(String.valueOf(Optional.ofNullable(value).orElse("")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success(propertyList);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<PersonPropertiesResult> getPersonPropertyList(PersonRegistry personRegistry, boolean isChecked) {
|
private List<PersonPropertiesResult> getPersonPropertyList(PersonRegistry personRegistry, boolean isChecked) {
|
||||||
@@ -274,7 +274,7 @@ implements IPersonRegistryHandler {
|
|||||||
List<PersonPropertiesResult> propertyList = this.getPersonPropertyList(dbPersonRegistry, true);
|
List<PersonPropertiesResult> propertyList = this.getPersonPropertyList(dbPersonRegistry, true);
|
||||||
AtomicReference result = new AtomicReference();
|
AtomicReference result = new AtomicReference();
|
||||||
propertyList.stream().filter(property -> Objects.equals(CertPropertyEnum.CARD_ID.getValue(), property.getBindProp())).findFirst().ifPresent(personPropertiesResult -> result.set(personPropertiesResult));
|
propertyList.stream().filter(property -> Objects.equals(CertPropertyEnum.CARD_ID.getValue(), property.getBindProp())).findFirst().ifPresent(personPropertiesResult -> result.set(personPropertiesResult));
|
||||||
return CloudwalkResult.success(result.get());
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<PersonPropertiesResult> getBindProperty(QueryPersonRegistryParam param, CloudwalkCallContext context) throws ServiceException {
|
public CloudwalkResult<PersonPropertiesResult> getBindProperty(QueryPersonRegistryParam param, CloudwalkCallContext context) throws ServiceException {
|
||||||
@@ -286,7 +286,7 @@ implements IPersonRegistryHandler {
|
|||||||
PersonRegistry dbPersonRegistry = (PersonRegistry)this.commonPersonRegistryService.getResultByBusinessAndType(businessId, RegistryTypeEnum.CERT_REGISTRY.getValue()).getData();
|
PersonRegistry dbPersonRegistry = (PersonRegistry)this.commonPersonRegistryService.getResultByBusinessAndType(businessId, RegistryTypeEnum.CERT_REGISTRY.getValue()).getData();
|
||||||
List<PersonPropertiesResult> propertyResultList = this.getPersonPropertyList(dbPersonRegistry, true);
|
List<PersonPropertiesResult> propertyResultList = this.getPersonPropertyList(dbPersonRegistry, true);
|
||||||
propertyResultList.stream().filter(property -> Objects.equals(property.getBindProp(), param.getBindPropertyCode())).findFirst().ifPresent(property -> result.set(property));
|
propertyResultList.stream().filter(property -> Objects.equals(property.getBindProp(), param.getBindPropertyCode())).findFirst().ifPresent(property -> result.set(property));
|
||||||
return CloudwalkResult.success(result.get());
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -89,7 +89,7 @@ extends AbstractImagStoreService {
|
|||||||
this.logger.warn("该租户不存在人员注册配置,租户ID:[{}]", (Object)businessId);
|
this.logger.warn("该租户不存在人员注册配置,租户ID:[{}]", (Object)businessId);
|
||||||
throw new ServiceException("53014517", this.getMessage("53014517"));
|
throw new ServiceException("53014517", this.getMessage("53014517"));
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success(personRegistryList.get(0));
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void insertPersonRegistry(String id, AddPersonRegistryParam param, CloudwalkCallContext context) throws ServiceException {
|
public void insertPersonRegistry(String id, AddPersonRegistryParam param, CloudwalkCallContext context) throws ServiceException {
|
||||||
|
|||||||
+5
-5
@@ -109,7 +109,7 @@ implements CpDeviceImagePersonService {
|
|||||||
public CloudwalkResult<List<DeviceImagePersonRefResult>> getImagePersonRefs(DeviceImagePersonRefQuery queryParam, CloudwalkCallContext context) throws ServiceException {
|
public CloudwalkResult<List<DeviceImagePersonRefResult>> getImagePersonRefs(DeviceImagePersonRefQuery queryParam, CloudwalkCallContext context) throws ServiceException {
|
||||||
ArrayList<DeviceImagePersonRefResult> deviceImagePersonRefResults = new ArrayList<DeviceImagePersonRefResult>();
|
ArrayList<DeviceImagePersonRefResult> deviceImagePersonRefResults = new ArrayList<DeviceImagePersonRefResult>();
|
||||||
if (StringUtils.isBlank((CharSequence)queryParam.getImageStoreId()) && CollectionUtils.isEmpty((Collection)queryParam.getImageStoreIds())) {
|
if (StringUtils.isBlank((CharSequence)queryParam.getImageStoreId()) && CollectionUtils.isEmpty((Collection)queryParam.getImageStoreIds())) {
|
||||||
return CloudwalkResult.fail((String)"53013500", (String)this.getMessage("53013500"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
if (StringUtils.isNotBlank((CharSequence)queryParam.getImageStoreId())) {
|
if (StringUtils.isNotBlank((CharSequence)queryParam.getImageStoreId())) {
|
||||||
queryParam.setImageStoreIds((List)Lists.newArrayList((Object[])new String[]{queryParam.getImageStoreId()}));
|
queryParam.setImageStoreIds((List)Lists.newArrayList((Object[])new String[]{queryParam.getImageStoreId()}));
|
||||||
@@ -128,7 +128,7 @@ implements CpDeviceImagePersonService {
|
|||||||
deviceImagePersonRefResult.setImageLastUpdateTime(lastUpdateTime);
|
deviceImagePersonRefResult.setImageLastUpdateTime(lastUpdateTime);
|
||||||
deviceImagePersonRefResults.add(deviceImagePersonRefResult);
|
deviceImagePersonRefResults.add(deviceImagePersonRefResult);
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success(deviceImagePersonRefResults);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<CloudwalkPageAble<DeviceImageUpdatePersonResult>> getDeviceImageUpdatePersonInfo(DeviceImageUpdatePersonQuery query, CloudwalkCallContext context) throws ServiceException {
|
public CloudwalkResult<CloudwalkPageAble<DeviceImageUpdatePersonResult>> getDeviceImageUpdatePersonInfo(DeviceImageUpdatePersonQuery query, CloudwalkCallContext context) throws ServiceException {
|
||||||
@@ -221,7 +221,7 @@ implements CpDeviceImagePersonService {
|
|||||||
deviceImageUpdatePersonResults.add(deviceImageUpdatePersonResult);
|
deviceImageUpdatePersonResults.add(deviceImageUpdatePersonResult);
|
||||||
}
|
}
|
||||||
CloudwalkPageAble resultCloudwalkPageAble = new CloudwalkPageAble(deviceImageUpdatePersonResults, page, groupPersonRefs.getTotal());
|
CloudwalkPageAble resultCloudwalkPageAble = new CloudwalkPageAble(deviceImageUpdatePersonResults, page, groupPersonRefs.getTotal());
|
||||||
return CloudwalkResult.success((Object)resultCloudwalkPageAble);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean elevatorGroup(String imageStoreId, CloudwalkCallContext context) {
|
private boolean elevatorGroup(String imageStoreId, CloudwalkCallContext context) {
|
||||||
@@ -388,7 +388,7 @@ implements CpDeviceImagePersonService {
|
|||||||
deviceImageUpdatePersonResults.add(deviceImageUpdatePersonResult);
|
deviceImageUpdatePersonResults.add(deviceImageUpdatePersonResult);
|
||||||
}
|
}
|
||||||
CloudwalkPageAble resultCloudwalkPageAble = new CloudwalkPageAble(deviceImageUpdatePersonResults, page, 0L);
|
CloudwalkPageAble resultCloudwalkPageAble = new CloudwalkPageAble(deviceImageUpdatePersonResults, page, 0L);
|
||||||
return CloudwalkResult.success((Object)resultCloudwalkPageAble);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getFloorInfo(GroupPersonRefDTO groupPersonRef, Map<String, String> personPassRuleMap) {
|
private String getFloorInfo(GroupPersonRefDTO groupPersonRef, Map<String, String> personPassRuleMap) {
|
||||||
@@ -435,7 +435,7 @@ implements CpDeviceImagePersonService {
|
|||||||
deviceImageUpdateFeautreResults.add(deviceImageUpdateFeautreResult);
|
deviceImageUpdateFeautreResults.add(deviceImageUpdateFeautreResult);
|
||||||
}
|
}
|
||||||
CloudwalkPageAble resultCloudwalkPageAble = new CloudwalkPageAble(deviceImageUpdateFeautreResults, page, groupPersonRefs.getTotal());
|
CloudwalkPageAble resultCloudwalkPageAble = new CloudwalkPageAble(deviceImageUpdateFeautreResults, page, groupPersonRefs.getTotal());
|
||||||
return CloudwalkResult.success((Object)resultCloudwalkPageAble);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Async(value="saveSyncLogExecutor")
|
@Async(value="saveSyncLogExecutor")
|
||||||
|
|||||||
+4
-4
@@ -232,7 +232,7 @@ extends AbstractImagStoreService {
|
|||||||
if (CollectionUtils.isEmpty((Collection)associatedList)) {
|
if (CollectionUtils.isEmpty((Collection)associatedList)) {
|
||||||
return personResultMap;
|
return personResultMap;
|
||||||
}
|
}
|
||||||
Map<String, List<IsImageStoreAssociated>> imageStoreAssociatedMap = associatedList.stream().collect(Collectors.groupingBy(IsImageStoreAssociated::getImageStoreId));
|
Map<String, List<IsImageStoreAssociated>> imageStoreAssociatedMap = (java.util.Map<java.lang.String,java.util.List<cn.cloudwalk.data.organization.entity.IsImageStoreAssociated>>) associatedList.stream().collect(Collectors.groupingBy(IsImageStoreAssociated::getImageStoreId));
|
||||||
imageStoreAssociatedMap.keySet().forEach(key -> {
|
imageStoreAssociatedMap.keySet().forEach(key -> {
|
||||||
GroupPersonRef groupPersonRef = this.matchGroupPersonRef((String)key, personId, (List)imageStoreAssociatedMap.get(key));
|
GroupPersonRef groupPersonRef = this.matchGroupPersonRef((String)key, personId, (List)imageStoreAssociatedMap.get(key));
|
||||||
if (groupPersonRef != null) {
|
if (groupPersonRef != null) {
|
||||||
@@ -248,7 +248,7 @@ extends AbstractImagStoreService {
|
|||||||
HashSet addPersonIds;
|
HashSet addPersonIds;
|
||||||
GetsImageStoreAssociatedDTO getsImageStoreAssociatedDTO = new GetsImageStoreAssociatedDTO();
|
GetsImageStoreAssociatedDTO getsImageStoreAssociatedDTO = new GetsImageStoreAssociatedDTO();
|
||||||
getsImageStoreAssociatedDTO.setImageStoreId(imageStoreId);
|
getsImageStoreAssociatedDTO.setImageStoreId(imageStoreId);
|
||||||
List associatedList = this.imageStoreAssociatedMapper.gets(getsImageStoreAssociatedDTO);
|
List<IsImageStoreAssociated> associatedList = this.imageStoreAssociatedMapper.gets(getsImageStoreAssociatedDTO);
|
||||||
String matchPattern = null;
|
String matchPattern = null;
|
||||||
ArrayList<String> includeLabelIds = new ArrayList<String>();
|
ArrayList<String> includeLabelIds = new ArrayList<String>();
|
||||||
ArrayList<String> includeOrganizationIds = new ArrayList<String>();
|
ArrayList<String> includeOrganizationIds = new ArrayList<String>();
|
||||||
@@ -411,7 +411,7 @@ extends AbstractImagStoreService {
|
|||||||
this.logger.error("图库图片同步失败,result:{}", (Object)JSONObject.toJSONString((Object)imageQueryResult));
|
this.logger.error("图库图片同步失败,result:{}", (Object)JSONObject.toJSONString((Object)imageQueryResult));
|
||||||
throw new ServiceException(imageQueryResult.getCode(), imageQueryResult.getMessage());
|
throw new ServiceException(imageQueryResult.getCode(), imageQueryResult.getMessage());
|
||||||
}
|
}
|
||||||
List resultList = (List)imageQueryResult.getData();
|
List<AgImageStoreImageResult> resultList = (List)imageQueryResult.getData();
|
||||||
if (CollectionUtils.isEmpty((Collection)resultList)) break;
|
if (CollectionUtils.isEmpty((Collection)resultList)) break;
|
||||||
for (AgImageStoreImageResult result : resultList) {
|
for (AgImageStoreImageResult result : resultList) {
|
||||||
try {
|
try {
|
||||||
@@ -467,7 +467,7 @@ extends AbstractImagStoreService {
|
|||||||
this.logger.warn("没有需要同步的图库图片");
|
this.logger.warn("没有需要同步的图库图片");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Map<String, List<GroupPersonRefDTO>> groupSyncList = syncList.stream().collect(Collectors.groupingBy(GroupPersonRef::getImageStoreId));
|
Map<String, List<GroupPersonRefDTO>> groupSyncList = (java.util.Map<java.lang.String,java.util.List<cn.cloudwalk.data.organization.dto.GroupPersonRefDTO>>) syncList.stream().collect(Collectors.groupingBy(GroupPersonRef::getImageStoreId));
|
||||||
for (Map.Entry<String, List<GroupPersonRefDTO>> entry : groupSyncList.entrySet()) {
|
for (Map.Entry<String, List<GroupPersonRefDTO>> entry : groupSyncList.entrySet()) {
|
||||||
String imageStoreId = entry.getKey();
|
String imageStoreId = entry.getKey();
|
||||||
this.updateGroupPerson(imageStoreId, entry.getValue());
|
this.updateGroupPerson(imageStoreId, entry.getValue());
|
||||||
|
|||||||
+21
-21
@@ -147,7 +147,7 @@ implements CpImageStorePersonService {
|
|||||||
throw new ServiceException("53013531", this.getMessage("53013531"));
|
throw new ServiceException("53013531", this.getMessage("53013531"));
|
||||||
}
|
}
|
||||||
if (StringUtils.isNotBlank((CharSequence)addParam.getImageBase64()) && FileUtil.getFileSizeFromBase64(addParam.getImageBase64()) > (long)ImageStoreConstants.MAX_FILE.intValue()) {
|
if (StringUtils.isNotBlank((CharSequence)addParam.getImageBase64()) && FileUtil.getFileSizeFromBase64(addParam.getImageBase64()) > (long)ImageStoreConstants.MAX_FILE.intValue()) {
|
||||||
return CloudwalkResult.fail((String)"53013536", (String)this.getMessage("53013536"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
AgImageStoreResult agImageStoreResult = this.checkAgImageStoreExist(addParam.getImageStoreId());
|
AgImageStoreResult agImageStoreResult = this.checkAgImageStoreExist(addParam.getImageStoreId());
|
||||||
if (StringUtils.isNotBlank((CharSequence)addParam.getPersonCode())) {
|
if (StringUtils.isNotBlank((CharSequence)addParam.getPersonCode())) {
|
||||||
@@ -157,7 +157,7 @@ implements CpImageStorePersonService {
|
|||||||
personCodeQuery.setIsDel(DelStatusEnum.NORAML.getCode());
|
personCodeQuery.setIsDel(DelStatusEnum.NORAML.getCode());
|
||||||
List personCodeQueryResult = this.imgStorePersonMapper.gets(personCodeQuery);
|
List personCodeQueryResult = this.imgStorePersonMapper.gets(personCodeQuery);
|
||||||
if (StringUtils.isBlank((CharSequence)addParam.getPersonId()) ? !CollectionUtil.isEmpty((Collection)personCodeQueryResult) : CollectionUtil.isNotEmpty((Collection)personCodeQueryResult) && !addParam.getPersonId().equals(((ImgStorePerson)personCodeQueryResult.get(0)).getPersonCode())) {
|
if (StringUtils.isBlank((CharSequence)addParam.getPersonId()) ? !CollectionUtil.isEmpty((Collection)personCodeQueryResult) : CollectionUtil.isNotEmpty((Collection)personCodeQueryResult) && !addParam.getPersonId().equals(((ImgStorePerson)personCodeQueryResult.get(0)).getPersonCode())) {
|
||||||
return CloudwalkResult.fail((String)"53013537", (String)this.getMessage("53013537"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
GroupPersonRef groupPersonRef = new GroupPersonRef();
|
GroupPersonRef groupPersonRef = new GroupPersonRef();
|
||||||
@@ -167,7 +167,7 @@ implements CpImageStorePersonService {
|
|||||||
groupPersonDTO.setPersonId(addParam.getPersonId());
|
groupPersonDTO.setPersonId(addParam.getPersonId());
|
||||||
List queryResult = this.groupPersonRefMapper.query(groupPersonDTO);
|
List queryResult = this.groupPersonRefMapper.query(groupPersonDTO);
|
||||||
if (CollectionUtils.isEmpty((Collection)queryResult)) {
|
if (CollectionUtils.isEmpty((Collection)queryResult)) {
|
||||||
return CloudwalkResult.fail((String)"53013539", (String)this.getMessage("53013539"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
groupPersonRef = (GroupPersonRef)queryResult.get(0);
|
groupPersonRef = (GroupPersonRef)queryResult.get(0);
|
||||||
this.deletePersonImage(addParam.getImageStoreId(), addParam.getPersonId(), context);
|
this.deletePersonImage(addParam.getImageStoreId(), addParam.getPersonId(), context);
|
||||||
@@ -213,7 +213,7 @@ implements CpImageStorePersonService {
|
|||||||
result.setComparePicture(imagePath);
|
result.setComparePicture(imagePath);
|
||||||
result.setAge(Optional.ofNullable(age).orElse(groupPersonRef.getAge()));
|
result.setAge(Optional.ofNullable(age).orElse(groupPersonRef.getAge()));
|
||||||
result.setGender(Optional.ofNullable(gender).orElse(groupPersonRef.getGender()));
|
result.setGender(Optional.ofNullable(gender).orElse(groupPersonRef.getGender()));
|
||||||
return CloudwalkResult.success((Object)result);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(rollbackFor={Exception.class})
|
@Transactional(rollbackFor={Exception.class})
|
||||||
@@ -305,7 +305,7 @@ implements CpImageStorePersonService {
|
|||||||
public CloudwalkResult<Boolean> delete(DeleteImageStorePersonParam deleteParam, CloudwalkCallContext context) throws ServiceException {
|
public CloudwalkResult<Boolean> delete(DeleteImageStorePersonParam deleteParam, CloudwalkCallContext context) throws ServiceException {
|
||||||
ImgStorePerson imgStorePerson = this.imgStorePersonMapper.selectByPrimaryKey(deleteParam.getPersonId());
|
ImgStorePerson imgStorePerson = this.imgStorePersonMapper.selectByPrimaryKey(deleteParam.getPersonId());
|
||||||
if (imgStorePerson == null) {
|
if (imgStorePerson == null) {
|
||||||
return CloudwalkResult.fail((String)"53013538", (String)this.getMessage("53013538"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
AgImageStoreResult agImageStoreResult = this.checkAgImageStoreExist(deleteParam.getImageStoreId());
|
AgImageStoreResult agImageStoreResult = this.checkAgImageStoreExist(deleteParam.getImageStoreId());
|
||||||
try {
|
try {
|
||||||
@@ -315,9 +315,9 @@ implements CpImageStorePersonService {
|
|||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
this.logger.error("delete error", e);
|
this.logger.error("delete error", e);
|
||||||
return CloudwalkResult.fail((String)"53013533", (String)this.getMessage("53013533"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)true);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(rollbackFor={Exception.class})
|
@Transactional(rollbackFor={Exception.class})
|
||||||
@@ -385,9 +385,9 @@ implements CpImageStorePersonService {
|
|||||||
cpBatchHandleFaceParam.setImageStoreId(param.getImageStoreId());
|
cpBatchHandleFaceParam.setImageStoreId(param.getImageStoreId());
|
||||||
cpBatchHandleFaceParam.setImageIds(param.getImageIds());
|
cpBatchHandleFaceParam.setImageIds(param.getImageIds());
|
||||||
this.cpImageStoreToolService.batchRemoveFace(cpBatchHandleFaceParam);
|
this.cpImageStoreToolService.batchRemoveFace(cpBatchHandleFaceParam);
|
||||||
return CloudwalkResult.success((Object)true);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
return CloudwalkResult.fail((String)"53013533", (String)this.getMessage("53013533"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
@CloudwalkParamsValidate
|
@CloudwalkParamsValidate
|
||||||
@@ -397,22 +397,22 @@ implements CpImageStorePersonService {
|
|||||||
agImageStoreQueryParam.setId(bindParam.getImageStoreId());
|
agImageStoreQueryParam.setId(bindParam.getImageStoreId());
|
||||||
CloudwalkResult agImageStoreResult = this.agImageStoreService.query(agImageStoreQueryParam);
|
CloudwalkResult agImageStoreResult = this.agImageStoreService.query(agImageStoreQueryParam);
|
||||||
if (!agImageStoreResult.isSuccess()) {
|
if (!agImageStoreResult.isSuccess()) {
|
||||||
return CloudwalkResult.fail((String)agImageStoreResult.getCode(), (String)agImageStoreResult.getMessage());
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
if (CollectionUtils.isEmpty((Collection)((Collection)agImageStoreResult.getData()))) {
|
if (CollectionUtils.isEmpty((Collection)((Collection)agImageStoreResult.getData()))) {
|
||||||
return CloudwalkResult.fail((String)"53013502", (String)this.getMessage("53013502"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
AgImageStoreResult agImageStore = (AgImageStoreResult)((List)agImageStoreResult.getData()).get(0);
|
AgImageStoreResult agImageStore = (AgImageStoreResult)((List)agImageStoreResult.getData()).get(0);
|
||||||
ImgStorePerson imgStorePerson = this.imgStorePersonMapper.selectByPrimaryKey(bindParam.getPersonId());
|
ImgStorePerson imgStorePerson = this.imgStorePersonMapper.selectByPrimaryKey(bindParam.getPersonId());
|
||||||
if (imgStorePerson == null || DelStatusEnum.DELETED.getCode().equals(imgStorePerson.getIsDel())) {
|
if (imgStorePerson == null || DelStatusEnum.DELETED.getCode().equals(imgStorePerson.getIsDel())) {
|
||||||
return CloudwalkResult.fail((String)"53013538", (String)this.getMessage("53013538"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
if (StringUtils.isBlank((CharSequence)imgStorePerson.getImageId())) {
|
if (StringUtils.isBlank((CharSequence)imgStorePerson.getImageId())) {
|
||||||
return CloudwalkResult.fail((String)"53013531", (String)this.getMessage("53013531"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
boolean bl = typeNotMatch = agImageStore.getType() == 1 && CpPersonSourceEnum.CAPTURE.getCode().equals(imgStorePerson.getSource()) || agImageStore.getType() != 1 && !CpPersonSourceEnum.CAPTURE.getCode().equals(imgStorePerson.getSource());
|
boolean bl = typeNotMatch = agImageStore.getType() == 1 && CpPersonSourceEnum.CAPTURE.getCode().equals(imgStorePerson.getSource()) || agImageStore.getType() != 1 && !CpPersonSourceEnum.CAPTURE.getCode().equals(imgStorePerson.getSource());
|
||||||
if (typeNotMatch) {
|
if (typeNotMatch) {
|
||||||
return CloudwalkResult.fail((String)"53013540", (String)this.getMessage("53013540"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
CpImageStorePersonServiceImpl proxyObj = (CpImageStorePersonServiceImpl)AopContext.currentProxy();
|
CpImageStorePersonServiceImpl proxyObj = (CpImageStorePersonServiceImpl)AopContext.currentProxy();
|
||||||
@@ -421,9 +421,9 @@ implements CpImageStorePersonService {
|
|||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
this.logger.error("bind error", e);
|
this.logger.error("bind error", e);
|
||||||
return CloudwalkResult.fail((String)"53013541", (String)this.getMessage("53013541"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)true);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<BatchBindImageStorePersonResult> batchBind(BatchBindImageStorePersonParam batchBindParam, CloudwalkCallContext context) throws ServiceException {
|
public CloudwalkResult<BatchBindImageStorePersonResult> batchBind(BatchBindImageStorePersonParam batchBindParam, CloudwalkCallContext context) throws ServiceException {
|
||||||
@@ -484,7 +484,7 @@ implements CpImageStorePersonService {
|
|||||||
ArrayList failIds = new ArrayList(batchBindParam.getPersonIds());
|
ArrayList failIds = new ArrayList(batchBindParam.getPersonIds());
|
||||||
failIds.removeAll(new ArrayList(successIds));
|
failIds.removeAll(new ArrayList(successIds));
|
||||||
this.cpImageStorePersonSynManager.addGroupPersonSynTask(Arrays.asList(agImageStore.getId()), new ArrayList<String>(successIds), true);
|
this.cpImageStorePersonSynManager.addGroupPersonSynTask(Arrays.asList(agImageStore.getId()), new ArrayList<String>(successIds), true);
|
||||||
return CloudwalkResult.success((Object)new BatchBindImageStorePersonResult(new ArrayList(successIds), failIds));
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(rollbackFor={Exception.class})
|
@Transactional(rollbackFor={Exception.class})
|
||||||
@@ -696,7 +696,7 @@ implements CpImageStorePersonService {
|
|||||||
result.setValidDateCron(JsonUtils.toStrList(dto.getValidDateCron()));
|
result.setValidDateCron(JsonUtils.toStrList(dto.getValidDateCron()));
|
||||||
resultList.add(result);
|
resultList.add(result);
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)new CloudwalkPageAble((Collection)resultList, new CloudwalkPageInfo(queryParam.getCurrentPage(), queryParam.getRowsOfPage()), pageInfo.getTotal()));
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -804,14 +804,14 @@ implements CpImageStorePersonService {
|
|||||||
personIdList.addAll(Optional.ofNullable(param.getPersonIds()).orElse(new ArrayList()));
|
personIdList.addAll(Optional.ofNullable(param.getPersonIds()).orElse(new ArrayList()));
|
||||||
if (CollectionUtils.isEmpty(personIdList)) {
|
if (CollectionUtils.isEmpty(personIdList)) {
|
||||||
this.logger.warn("CpImageStorePersonService updateGroupPersonRef,关联人员为空");
|
this.logger.warn("CpImageStorePersonService updateGroupPersonRef,关联人员为空");
|
||||||
return CloudwalkResult.success((Object)true);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
GroupPersonRef query = new GroupPersonRef();
|
GroupPersonRef query = new GroupPersonRef();
|
||||||
query.setImageStoreId(param.getImageStoreId());
|
query.setImageStoreId(param.getImageStoreId());
|
||||||
List groupPersonRefList = this.groupPersonRefMapper.selectByCondition(query, personIdList);
|
List groupPersonRefList = this.groupPersonRefMapper.selectByCondition(query, personIdList);
|
||||||
if (CollectionUtils.isEmpty((Collection)groupPersonRefList)) {
|
if (CollectionUtils.isEmpty((Collection)groupPersonRefList)) {
|
||||||
this.logger.warn("CpImageStorePersonService updateGroupPersonRef,图库人员为空");
|
this.logger.warn("CpImageStorePersonService updateGroupPersonRef,图库人员为空");
|
||||||
return CloudwalkResult.success((Object)true);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
Long currentTime = System.currentTimeMillis();
|
Long currentTime = System.currentTimeMillis();
|
||||||
Set groupPersonIdSet = groupPersonRefList.stream().map(GroupPersonRef::getId).collect(Collectors.toSet());
|
Set groupPersonIdSet = groupPersonRefList.stream().map(GroupPersonRef::getId).collect(Collectors.toSet());
|
||||||
@@ -830,7 +830,7 @@ implements CpImageStorePersonService {
|
|||||||
HashSet<String> changeGroupIds = new HashSet<String>();
|
HashSet<String> changeGroupIds = new HashSet<String>();
|
||||||
changeGroupIds.add(param.getImageStoreId());
|
changeGroupIds.add(param.getImageStoreId());
|
||||||
this.cpImageStoreSyncManager.sendChangeToDevice(changeGroupIds, false);
|
this.cpImageStoreSyncManager.sendChangeToDevice(changeGroupIds, false);
|
||||||
return CloudwalkResult.success((Object)true);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+6
-6
@@ -293,7 +293,7 @@ extends AbstractImagStoreService {
|
|||||||
Map<String, GroupPersonRef> associatedPersonResultsAfterUpdate = this.cpImageStorePersonManager.getCurrentAssociatedPersonIds(waitSyncImageStore.getId());
|
Map<String, GroupPersonRef> associatedPersonResultsAfterUpdate = this.cpImageStorePersonManager.getCurrentAssociatedPersonIds(waitSyncImageStore.getId());
|
||||||
HashSet associatedPersonIdsAfterUpdate = Sets.newHashSet(associatedPersonResultsAfterUpdate.keySet());
|
HashSet associatedPersonIdsAfterUpdate = Sets.newHashSet(associatedPersonResultsAfterUpdate.keySet());
|
||||||
List associatedPersonExpiryDateAfterUpdate = CollectionUtil.isNotEmpty((Collection)associatedPersonIdsAfterUpdate) ? this.imgStorePersonMapper.selectExpiryDateByIds((List)Lists.newArrayList((Iterable)associatedPersonIdsAfterUpdate)) : Lists.newArrayList();
|
List associatedPersonExpiryDateAfterUpdate = CollectionUtil.isNotEmpty((Collection)associatedPersonIdsAfterUpdate) ? this.imgStorePersonMapper.selectExpiryDateByIds((List)Lists.newArrayList((Iterable)associatedPersonIdsAfterUpdate)) : Lists.newArrayList();
|
||||||
Map<String, ImgStorePerson> associatedPersonExpiryDateAfterUpdateMap = associatedPersonExpiryDateAfterUpdate.stream().collect(Collectors.toMap(ImgStorePerson::getId, o -> o));
|
Map<String, ImgStorePerson> associatedPersonExpiryDateAfterUpdateMap = (java.util.Map<java.lang.String,cn.cloudwalk.data.organization.entity.ImgStorePerson>) associatedPersonExpiryDateAfterUpdate.stream().collect(Collectors.toMap(ImgStorePerson::getId, o -> o));
|
||||||
Map<String, GroupPersonRef> associatedPersonResultsBeforeUpdate = this.cpImageStorePersonManager.getOldAssociatedPersonIds(waitSyncImageStore.getId(), null);
|
Map<String, GroupPersonRef> associatedPersonResultsBeforeUpdate = this.cpImageStorePersonManager.getOldAssociatedPersonIds(waitSyncImageStore.getId(), null);
|
||||||
HashSet associatedPersonIdsBeforeUpdate = Sets.newHashSet(associatedPersonResultsBeforeUpdate.keySet());
|
HashSet associatedPersonIdsBeforeUpdate = Sets.newHashSet(associatedPersonResultsBeforeUpdate.keySet());
|
||||||
HashSet personIdsNeedDelete = new HashSet(associatedPersonIdsBeforeUpdate);
|
HashSet personIdsNeedDelete = new HashSet(associatedPersonIdsBeforeUpdate);
|
||||||
@@ -363,7 +363,7 @@ extends AbstractImagStoreService {
|
|||||||
if (Collections3.isNotEmpty((Collection)synData.getAddPersonIds())) {
|
if (Collections3.isNotEmpty((Collection)synData.getAddPersonIds())) {
|
||||||
associatedPersonResultsAfterUpdate = this.cpImageStorePersonManager.getGroupPersonRefByPersons(waitSyncImageStore.getId(), synData.getAddPersonIds());
|
associatedPersonResultsAfterUpdate = this.cpImageStorePersonManager.getGroupPersonRefByPersons(waitSyncImageStore.getId(), synData.getAddPersonIds());
|
||||||
List associatedPersonExpiryDateAfterUpdate = this.imgStorePersonMapper.selectExpiryDateByIds(synData.getAddPersonIds());
|
List associatedPersonExpiryDateAfterUpdate = this.imgStorePersonMapper.selectExpiryDateByIds(synData.getAddPersonIds());
|
||||||
Map<String, ImgStorePerson> associatedPersonExpiryDateAfterUpdateMap = associatedPersonExpiryDateAfterUpdate.stream().collect(Collectors.toMap(ImgStorePerson::getId, o -> o));
|
Map<String, ImgStorePerson> associatedPersonExpiryDateAfterUpdateMap = (java.util.Map<java.lang.String,cn.cloudwalk.data.organization.entity.ImgStorePerson>) associatedPersonExpiryDateAfterUpdate.stream().collect(Collectors.toMap(ImgStorePerson::getId, o -> o));
|
||||||
Map<String, GroupPersonRef> associatedPersonResultsBeforeUpdate = this.cpImageStorePersonManager.getOldAssociatedPersonIds(waitSyncImageStore.getId(), synData.getAddPersonIds());
|
Map<String, GroupPersonRef> associatedPersonResultsBeforeUpdate = this.cpImageStorePersonManager.getOldAssociatedPersonIds(waitSyncImageStore.getId(), synData.getAddPersonIds());
|
||||||
synData.getAddPersonIds().forEach(personId -> {
|
synData.getAddPersonIds().forEach(personId -> {
|
||||||
if (associatedPersonResultsAfterUpdate.containsKey(personId)) {
|
if (associatedPersonResultsAfterUpdate.containsKey(personId)) {
|
||||||
@@ -486,20 +486,20 @@ extends AbstractImagStoreService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void checkHandleSynTaskException() {
|
public void checkHandleSynTaskException() {
|
||||||
Set synQueueHeadDataKeys = this.redisTemplate.keys((Object)"group_person_syn_queue_head_data:*");
|
Set synQueueHeadDataKeys = (java.lang.String) this.redisTemplate.keys((Object)"group_person_syn_queue_head_data:*");
|
||||||
synQueueHeadDataKeys.forEach(synQueueHeadDataKey -> {
|
synQueueHeadDataKeys.forEach(synQueueHeadDataKey -> {
|
||||||
String imageStoreId = synQueueHeadDataKey.replaceFirst(SYN_QUEUE_HEAD_DATA, "");
|
String imageStoreId = synQueueHeadDataKey.replaceFirst(SYN_QUEUE_HEAD_DATA, "");
|
||||||
Set lockKeys = this.redisTemplate.keys((Object)(imageStoreId + ":*"));
|
Set lockKeys = (java.lang.String) this.redisTemplate.keys((Object)(imageStoreId + ":*"));
|
||||||
if (Collections3.isEmpty((Collection)lockKeys)) {
|
if (Collections3.isEmpty((Collection)lockKeys)) {
|
||||||
this.logger.info("CpImageStorePersonSynManager checkHandleSynTaskException 消费加锁");
|
this.logger.info("CpImageStorePersonSynManager checkHandleSynTaskException 消费加锁");
|
||||||
this.handleFailSynTask(imageStoreId);
|
this.handleFailSynTask(imageStoreId);
|
||||||
this.handleGroupPersonSynTask(imageStoreId);
|
this.handleGroupPersonSynTask(imageStoreId);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Set waitSynTaskKeys = this.redisTemplate.keys((Object)"group_person_wait_syn_task:*");
|
Set waitSynTaskKeys = (java.lang.String) this.redisTemplate.keys((Object)"group_person_wait_syn_task:*");
|
||||||
waitSynTaskKeys.forEach(waitSynTaskKey -> {
|
waitSynTaskKeys.forEach(waitSynTaskKey -> {
|
||||||
String imageStoreId = waitSynTaskKey.replaceFirst(WAIT_SYN_TASK_KEY, "");
|
String imageStoreId = waitSynTaskKey.replaceFirst(WAIT_SYN_TASK_KEY, "");
|
||||||
Set lockKeys = this.redisTemplate.keys((Object)(imageStoreId + ":*"));
|
Set lockKeys = (java.lang.String) this.redisTemplate.keys((Object)(imageStoreId + ":*"));
|
||||||
if (Collections3.isEmpty((Collection)lockKeys)) {
|
if (Collections3.isEmpty((Collection)lockKeys)) {
|
||||||
this.logger.info("CpImageStorePersonSynManager checkHandleSynTaskException 未消费");
|
this.logger.info("CpImageStorePersonSynManager checkHandleSynTaskException 未消费");
|
||||||
this.handleFailSynTask(imageStoreId);
|
this.handleFailSynTask(imageStoreId);
|
||||||
|
|||||||
+3
-3
@@ -198,7 +198,7 @@ extends AbstractImagStoreService {
|
|||||||
devicePersonSyncLogDTO.setLastUpdateTime(deleteParam.getLastUpdateTime());
|
devicePersonSyncLogDTO.setLastUpdateTime(deleteParam.getLastUpdateTime());
|
||||||
devicePersonSyncLogDTO.setUpdateInfo("删除人员,更新同步记录状态:设备未拉取");
|
devicePersonSyncLogDTO.setUpdateInfo("删除人员,更新同步记录状态:设备未拉取");
|
||||||
devicePersonSyncLogDTO.setIsDel(Integer.valueOf(DelStatusEnum.DELETED.getCode().shortValue()));
|
devicePersonSyncLogDTO.setIsDel(Integer.valueOf(DelStatusEnum.DELETED.getCode().shortValue()));
|
||||||
List partition = Lists.partition(changePersonIds, (int)this.delBatchSize);
|
List<List> partition = Lists.partition(changePersonIds, (int)this.delBatchSize);
|
||||||
for (List list : partition) {
|
for (List list : partition) {
|
||||||
deleteParam.setPersonIds((Collection)list);
|
deleteParam.setPersonIds((Collection)list);
|
||||||
devicePersonSyncLogDTO.setPersonIds(list);
|
devicePersonSyncLogDTO.setPersonIds(list);
|
||||||
@@ -358,7 +358,7 @@ extends AbstractImagStoreService {
|
|||||||
List list = this.groupPersonRefMapper.queryHandleFaceException(DelStatusEnum.NORAML.getCode(), Arrays.asList(GroupModelStatusEnum.MODEL_WAIT.getCode(), GroupModelStatusEnum.MODEL_FAILED.getCode()));
|
List list = this.groupPersonRefMapper.queryHandleFaceException(DelStatusEnum.NORAML.getCode(), Arrays.asList(GroupModelStatusEnum.MODEL_WAIT.getCode(), GroupModelStatusEnum.MODEL_FAILED.getCode()));
|
||||||
long e1 = System.currentTimeMillis();
|
long e1 = System.currentTimeMillis();
|
||||||
this.logger.debug("HandleGroupFaceExceptionTask 查询人员正常但未入库、入库失败 耗时:[{}]", (Object)(e1 - s1));
|
this.logger.debug("HandleGroupFaceExceptionTask 查询人员正常但未入库、入库失败 耗时:[{}]", (Object)(e1 - s1));
|
||||||
Map<Short, List<GroupPersonRefDTO>> groupPersonMap = list.stream().collect(Collectors.groupingBy(GroupPersonRef::getGroupStatus));
|
Map<Short, List<GroupPersonRefDTO>> groupPersonMap = (java.util.Map<java.lang.Short,java.util.List<cn.cloudwalk.data.organization.dto.GroupPersonRefDTO>>) list.stream().collect(Collectors.groupingBy(GroupPersonRef::getGroupStatus));
|
||||||
if (!CollectionUtils.isEmpty((Collection)list)) {
|
if (!CollectionUtils.isEmpty((Collection)list)) {
|
||||||
List<GroupPersonRefDTO> modelWaitList = groupPersonMap.get(GroupModelStatusEnum.MODEL_WAIT.getCode());
|
List<GroupPersonRefDTO> modelWaitList = groupPersonMap.get(GroupModelStatusEnum.MODEL_WAIT.getCode());
|
||||||
List<GroupPersonRefDTO> modelFailedList = groupPersonMap.get(GroupModelStatusEnum.MODEL_FAILED.getCode());
|
List<GroupPersonRefDTO> modelFailedList = groupPersonMap.get(GroupModelStatusEnum.MODEL_FAILED.getCode());
|
||||||
@@ -376,7 +376,7 @@ extends AbstractImagStoreService {
|
|||||||
list = this.groupPersonRefMapper.queryHandleFaceException(DelStatusEnum.DELETED.getCode(), Arrays.asList(GroupModelStatusEnum.MODEL_COMPLETED.getCode(), GroupModelStatusEnum.MODEL_DEL_FAILED.getCode()));
|
list = this.groupPersonRefMapper.queryHandleFaceException(DelStatusEnum.DELETED.getCode(), Arrays.asList(GroupModelStatusEnum.MODEL_COMPLETED.getCode(), GroupModelStatusEnum.MODEL_DEL_FAILED.getCode()));
|
||||||
long e2 = System.currentTimeMillis();
|
long e2 = System.currentTimeMillis();
|
||||||
this.logger.debug("HandleGroupFaceExceptionTask 查询人员删除但入库完成、删除失败 耗时:[{}]", (Object)(e2 - s2));
|
this.logger.debug("HandleGroupFaceExceptionTask 查询人员删除但入库完成、删除失败 耗时:[{}]", (Object)(e2 - s2));
|
||||||
groupPersonMap = list.stream().collect(Collectors.groupingBy(GroupPersonRef::getGroupStatus));
|
groupPersonMap = (java.util.Map<java.lang.Short,java.util.List<cn.cloudwalk.data.organization.dto.GroupPersonRefDTO>>) list.stream().collect(Collectors.groupingBy(GroupPersonRef::getGroupStatus));
|
||||||
List<GroupPersonRefDTO> modelCompleteList = groupPersonMap.get(GroupModelStatusEnum.MODEL_COMPLETED.getCode());
|
List<GroupPersonRefDTO> modelCompleteList = groupPersonMap.get(GroupModelStatusEnum.MODEL_COMPLETED.getCode());
|
||||||
List<GroupPersonRefDTO> modelDelFailedList = groupPersonMap.get(GroupModelStatusEnum.MODEL_DEL_FAILED.getCode());
|
List<GroupPersonRefDTO> modelDelFailedList = groupPersonMap.get(GroupModelStatusEnum.MODEL_DEL_FAILED.getCode());
|
||||||
if (!CollectionUtils.isEmpty(modelCompleteList)) {
|
if (!CollectionUtils.isEmpty(modelCompleteList)) {
|
||||||
|
|||||||
+1
-1
@@ -166,7 +166,7 @@ public class CpImageStorePersonValidateManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.updateExpiryDateStatus(currentTime, syncPersonList);
|
this.updateExpiryDateStatus(currentTime, syncPersonList);
|
||||||
Map<String, List<SyncPersonDTO>> deleteImageMap = deleteSet.parallelStream().collect(Collectors.groupingBy(SyncPersonDTO::getImageStoreId));
|
Map<String, List<SyncPersonDTO>> deleteImageMap = (java.util.Map<java.lang.String,java.util.List<cn.cloudwalk.data.organization.dto.SyncPersonDTO>>) deleteSet.parallelStream().collect(Collectors.groupingBy(SyncPersonDTO::getImageStoreId));
|
||||||
for (Map.Entry entry : deleteImageMap.entrySet()) {
|
for (Map.Entry entry : deleteImageMap.entrySet()) {
|
||||||
Set<String> keySet = ((List)entry.getValue()).parallelStream().map(SyncPersonDTO::getImageId).collect(Collectors.toSet());
|
Set<String> keySet = ((List)entry.getValue()).parallelStream().map(SyncPersonDTO::getImageId).collect(Collectors.toSet());
|
||||||
this.cpImageStorePersonTxHandler.handleImageStoreImageChange((String)entry.getKey(), keySet, false);
|
this.cpImageStorePersonTxHandler.handleImageStoreImageChange((String)entry.getKey(), keySet, false);
|
||||||
|
|||||||
+16
-16
@@ -144,7 +144,7 @@ implements CpImageStoreService {
|
|||||||
throw new ServiceException(addResult.getCode(), addResult.getMessage());
|
throw new ServiceException(addResult.getCode(), addResult.getMessage());
|
||||||
}
|
}
|
||||||
this.cpImageStorePersonSynManager.addGroupPersonSynTask(Lists.newArrayList((Object[])new String[]{imageStoreId}), "isAll");
|
this.cpImageStorePersonSynManager.addGroupPersonSynTask(Lists.newArrayList((Object[])new String[]{imageStoreId}), "isAll");
|
||||||
return CloudwalkResult.success((Object)imageStoreId);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(rollbackFor={Exception.class})
|
@Transactional(rollbackFor={Exception.class})
|
||||||
@@ -171,7 +171,7 @@ implements CpImageStoreService {
|
|||||||
throw new ServiceException(editResult.getCode(), editResult.getMessage());
|
throw new ServiceException(editResult.getCode(), editResult.getMessage());
|
||||||
}
|
}
|
||||||
this.cpImageStorePersonSynManager.addGroupPersonSynTask(Lists.newArrayList((Object[])new String[]{param.getImageStoreId()}), "isAll");
|
this.cpImageStorePersonSynManager.addGroupPersonSynTask(Lists.newArrayList((Object[])new String[]{param.getImageStoreId()}), "isAll");
|
||||||
return CloudwalkResult.success((Object)Boolean.TRUE);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean checkAssociatedIsChange(String imageStoreId, List<IsImageStoreAssociated> associatedListAfterUpdate) {
|
private boolean checkAssociatedIsChange(String imageStoreId, List<IsImageStoreAssociated> associatedListAfterUpdate) {
|
||||||
@@ -217,7 +217,7 @@ implements CpImageStoreService {
|
|||||||
if (!delete.isSuccess()) {
|
if (!delete.isSuccess()) {
|
||||||
throw new ServiceException(delete.getCode(), delete.getMessage());
|
throw new ServiceException(delete.getCode(), delete.getMessage());
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)Boolean.TRUE);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkAppRefByImageStoreIdForDelete(String imageStoreId, CloudwalkCallContext context) throws ServiceException {
|
private void checkAppRefByImageStoreIdForDelete(String imageStoreId, CloudwalkCallContext context) throws ServiceException {
|
||||||
@@ -236,20 +236,20 @@ implements CpImageStoreService {
|
|||||||
CloudwalkResult agPageResult;
|
CloudwalkResult agPageResult;
|
||||||
boolean isEnd = this.handleQueryParam(queryImageStoreParam);
|
boolean isEnd = this.handleQueryParam(queryImageStoreParam);
|
||||||
if (isEnd) {
|
if (isEnd) {
|
||||||
return CloudwalkResult.success((Object)new CloudwalkPageAble(new ArrayList(), new CloudwalkPageInfo(queryImageStoreParam.getCurrentPage(), queryImageStoreParam.getRowsOfPage()), 0L));
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
AgImageStoreQueryParam queryParam = (AgImageStoreQueryParam)BeanCopyUtils.copyProperties((Object)queryImageStoreParam, AgImageStoreQueryParam.class);
|
AgImageStoreQueryParam queryParam = (AgImageStoreQueryParam)BeanCopyUtils.copyProperties((Object)queryImageStoreParam, AgImageStoreQueryParam.class);
|
||||||
if (StringUtils.isBlank((CharSequence)queryParam.getBusinessId())) {
|
if (StringUtils.isBlank((CharSequence)queryParam.getBusinessId())) {
|
||||||
queryParam.setBusinessId(context.getCompany().getCompanyId());
|
queryParam.setBusinessId(context.getCompany().getCompanyId());
|
||||||
}
|
}
|
||||||
if (!(agPageResult = this.agImageStoreService.page(queryParam)).isSuccess()) {
|
if (!(agPageResult = this.agImageStoreService.page(queryParam)).isSuccess()) {
|
||||||
return CloudwalkResult.fail((String)agPageResult.getCode(), (String)agPageResult.getMessage());
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
if (agPageResult.getData() == null) {
|
if (agPageResult.getData() == null) {
|
||||||
return CloudwalkResult.success((Object)new CloudwalkPageAble(new ArrayList(), new CloudwalkPageInfo(queryParam.getCurrentPage(), queryParam.getRowsOfPage()), 0L));
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
List<PageImageStoreResult> resultList = this.packageCpResult(((CloudwalkPageAble)agPageResult.getData()).getDatas(), queryParam.getBusinessId());
|
List<PageImageStoreResult> resultList = this.packageCpResult(((CloudwalkPageAble)agPageResult.getData()).getDatas(), queryParam.getBusinessId());
|
||||||
return CloudwalkResult.success((Object)new CloudwalkPageAble(resultList, new CloudwalkPageInfo((int)((CloudwalkPageAble)agPageResult.getData()).getCurrentPage(), (int)((CloudwalkPageAble)agPageResult.getData()).getPageSize()), ((CloudwalkPageAble)agPageResult.getData()).getTotalRows()));
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<List<ImageStoreResult>> list(QueryImageStoreParam queryImageStoreParam, CloudwalkCallContext cloudwalkContext) throws ServiceException {
|
public CloudwalkResult<List<ImageStoreResult>> list(QueryImageStoreParam queryImageStoreParam, CloudwalkCallContext cloudwalkContext) throws ServiceException {
|
||||||
@@ -257,14 +257,14 @@ implements CpImageStoreService {
|
|||||||
List<Object> resultList = new ArrayList();
|
List<Object> resultList = new ArrayList();
|
||||||
boolean isEnd = this.handleQueryParam(queryImageStoreParam);
|
boolean isEnd = this.handleQueryParam(queryImageStoreParam);
|
||||||
if (isEnd) {
|
if (isEnd) {
|
||||||
return CloudwalkResult.success(resultList);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
AgImageStoreQueryParam queryParam = (AgImageStoreQueryParam)BeanCopyUtils.copyProperties((Object)queryImageStoreParam, AgImageStoreQueryParam.class);
|
AgImageStoreQueryParam queryParam = (AgImageStoreQueryParam)BeanCopyUtils.copyProperties((Object)queryImageStoreParam, AgImageStoreQueryParam.class);
|
||||||
if (StringUtils.isBlank((CharSequence)queryParam.getBusinessId())) {
|
if (StringUtils.isBlank((CharSequence)queryParam.getBusinessId())) {
|
||||||
queryParam.setBusinessId(cloudwalkContext.getCompany().getCompanyId());
|
queryParam.setBusinessId(cloudwalkContext.getCompany().getCompanyId());
|
||||||
}
|
}
|
||||||
if (!(agQueryResult = this.agImageStoreService.query(queryParam)).isSuccess()) {
|
if (!(agQueryResult = this.agImageStoreService.query(queryParam)).isSuccess()) {
|
||||||
return CloudwalkResult.fail((String)agQueryResult.getCode(), (String)agQueryResult.getMessage());
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
if (!CollectionUtils.isEmpty((Collection)queryImageStoreParam.getLabelIds())) {
|
if (!CollectionUtils.isEmpty((Collection)queryImageStoreParam.getLabelIds())) {
|
||||||
GetsImageStoreAssociatedDTO get = new GetsImageStoreAssociatedDTO();
|
GetsImageStoreAssociatedDTO get = new GetsImageStoreAssociatedDTO();
|
||||||
@@ -272,14 +272,14 @@ implements CpImageStoreService {
|
|||||||
get.setAssociatedObjectIdType(Integer.valueOf(2));
|
get.setAssociatedObjectIdType(Integer.valueOf(2));
|
||||||
List associateds = this.isImageStoreAssociatedMapper.gets(get);
|
List associateds = this.isImageStoreAssociatedMapper.gets(get);
|
||||||
if (CollectionUtils.isEmpty((Collection)associateds)) {
|
if (CollectionUtils.isEmpty((Collection)associateds)) {
|
||||||
return CloudwalkResult.success(resultList);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
List imageStoreIds = Collections3.extractToList((Collection)associateds, (String)"imageStoreId");
|
List imageStoreIds = Collections3.extractToList((Collection)associateds, (String)"imageStoreId");
|
||||||
List collect = ((List)agQueryResult.getData()).stream().filter(a -> imageStoreIds.contains(a.getId())).collect(Collectors.toList());
|
List collect = ((List)agQueryResult.getData()).stream().filter(a -> imageStoreIds.contains(a.getId())).collect(Collectors.toList());
|
||||||
agQueryResult.setData(collect);
|
agQueryResult.setData(collect);
|
||||||
}
|
}
|
||||||
resultList = this.packageImageStoreResult((Collection)agQueryResult.getData(), queryParam.getBusinessId());
|
resultList = this.packageImageStoreResult((Collection)agQueryResult.getData(), queryParam.getBusinessId());
|
||||||
return CloudwalkResult.success(resultList);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
@CloudwalkParamsValidate
|
@CloudwalkParamsValidate
|
||||||
@@ -288,10 +288,10 @@ implements CpImageStoreService {
|
|||||||
queryParam.setId(param.getId());
|
queryParam.setId(param.getId());
|
||||||
CloudwalkResult queryResult = this.agImageStoreService.query(queryParam);
|
CloudwalkResult queryResult = this.agImageStoreService.query(queryParam);
|
||||||
if (!queryResult.isSuccess()) {
|
if (!queryResult.isSuccess()) {
|
||||||
return CloudwalkResult.fail((String)queryResult.getCode(), (String)queryResult.getMessage());
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
if (CollectionUtils.isEmpty((Collection)((Collection)queryResult.getData()))) {
|
if (CollectionUtils.isEmpty((Collection)((Collection)queryResult.getData()))) {
|
||||||
return CloudwalkResult.fail((String)"53013502", (String)this.getMessage("53013502"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
AgImageStoreResult agImageStoreResult = (AgImageStoreResult)((List)queryResult.getData()).get(0);
|
AgImageStoreResult agImageStoreResult = (AgImageStoreResult)((List)queryResult.getData()).get(0);
|
||||||
ImageStoreDetailResult result = (ImageStoreDetailResult)BeanCopyUtils.copyProperties((Object)agImageStoreResult, ImageStoreDetailResult.class);
|
ImageStoreDetailResult result = (ImageStoreDetailResult)BeanCopyUtils.copyProperties((Object)agImageStoreResult, ImageStoreDetailResult.class);
|
||||||
@@ -301,14 +301,14 @@ implements CpImageStoreService {
|
|||||||
}
|
}
|
||||||
catch (ServiceException e) {
|
catch (ServiceException e) {
|
||||||
this.logger.error("查询企业名称错误e:{}", (Object)e.getMessage());
|
this.logger.error("查询企业名称错误e:{}", (Object)e.getMessage());
|
||||||
return CloudwalkResult.fail((String)e.getCode(), (String)e.getMessage());
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
result.setSourceApplicationName(this.getSourceApplicationName(result.getSourceApplicationId()));
|
result.setSourceApplicationName(this.getSourceApplicationName(result.getSourceApplicationId()));
|
||||||
}
|
}
|
||||||
catch (ServiceException e) {
|
catch (ServiceException e) {
|
||||||
this.logger.error("查询来源应用名称错误e:{}", (Object)e.getMessage());
|
this.logger.error("查询来源应用名称错误e:{}", (Object)e.getMessage());
|
||||||
return CloudwalkResult.fail((String)e.getCode(), (String)e.getMessage());
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
this.getAssociated(result);
|
this.getAssociated(result);
|
||||||
DeviceImageStoreQueryParam deviceParam = new DeviceImageStoreQueryParam();
|
DeviceImageStoreQueryParam deviceParam = new DeviceImageStoreQueryParam();
|
||||||
@@ -327,7 +327,7 @@ implements CpImageStoreService {
|
|||||||
} else {
|
} else {
|
||||||
this.logger.error("图库详情关联应用名称获取失败,result:[{}]", (Object)JSONObject.toJSONString((Object)appResult));
|
this.logger.error("图库详情关联应用名称获取失败,result:[{}]", (Object)JSONObject.toJSONString((Object)appResult));
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)result);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<DeviceInfoResult> getDeviceList(List<DeviceImageStoreQueryResult> resultList, CloudwalkCallContext context) {
|
private List<DeviceInfoResult> getDeviceList(List<DeviceImageStoreQueryResult> resultList, CloudwalkCallContext context) {
|
||||||
|
|||||||
+23
-23
@@ -106,14 +106,14 @@ implements CpImageStoreToolService {
|
|||||||
}
|
}
|
||||||
List faceDataList = searchMutipleResult.getFaces();
|
List faceDataList = searchMutipleResult.getFaces();
|
||||||
if (CollectionUtils.isEmpty((Collection)faceDataList)) {
|
if (CollectionUtils.isEmpty((Collection)faceDataList)) {
|
||||||
return CloudwalkResult.success(new ArrayList());
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
List<String> userIdList = faceDataList.stream().map(SearchFaceMutipleResult.FaceData::getUserId).collect(Collectors.toList());
|
List<String> userIdList = faceDataList.stream().map(SearchFaceMutipleResult.FaceData::getUserId).collect(Collectors.toList());
|
||||||
Map<String, ImgStorePerson> personMap = new HashMap<String, ImgStorePerson>();
|
Map<String, ImgStorePerson> personMap = new HashMap<String, ImgStorePerson>();
|
||||||
if (!CollectionUtils.isEmpty(userIdList)) {
|
if (!CollectionUtils.isEmpty(userIdList)) {
|
||||||
personMap = this.getPersonMap(userIdList);
|
personMap = this.getPersonMap(userIdList);
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success(this.transFaceResult(faceDataList, personMap));
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<Map<String, List<CpFeatureQueryResult>>> searchMultipleEveryGroup(CpFeatureQueryParam queryParam) throws ServiceException {
|
public CloudwalkResult<Map<String, List<CpFeatureQueryResult>>> searchMultipleEveryGroup(CpFeatureQueryParam queryParam) throws ServiceException {
|
||||||
@@ -148,7 +148,7 @@ implements CpImageStoreToolService {
|
|||||||
}
|
}
|
||||||
List faceGroupDataList = searchMutiplePerGroupResult.getFaces();
|
List faceGroupDataList = searchMutiplePerGroupResult.getFaces();
|
||||||
if (CollectionUtils.isEmpty((Collection)faceGroupDataList)) {
|
if (CollectionUtils.isEmpty((Collection)faceGroupDataList)) {
|
||||||
return CloudwalkResult.success(new HashMap());
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
HashSet<String> imageIdSet = new HashSet<String>();
|
HashSet<String> imageIdSet = new HashSet<String>();
|
||||||
faceGroupDataList.stream().forEach(faceGroupData -> {
|
faceGroupDataList.stream().forEach(faceGroupData -> {
|
||||||
@@ -164,7 +164,7 @@ implements CpImageStoreToolService {
|
|||||||
for (SearchFaceMutiplePerGroupResult.FaceGroupData faceGroupData2 : faceGroupDataList) {
|
for (SearchFaceMutiplePerGroupResult.FaceGroupData faceGroupData2 : faceGroupDataList) {
|
||||||
resultMap.put(faceGroupData2.getGroupId(), this.transFaceGroupResult(faceGroupData2, personMap));
|
resultMap.put(faceGroupData2.getGroupId(), this.transFaceGroupResult(faceGroupData2, personMap));
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success(resultMap);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<AgFeatureExtractResult> extractFeature(AgFeatureExtractParam extractParam) throws ServiceException {
|
public CloudwalkResult<AgFeatureExtractResult> extractFeature(AgFeatureExtractParam extractParam) throws ServiceException {
|
||||||
@@ -212,7 +212,7 @@ implements CpImageStoreToolService {
|
|||||||
result.setAge(Integer.valueOf(new BigDecimal(qualityScores.get(10)).setScale(0, 4).intValue()));
|
result.setAge(Integer.valueOf(new BigDecimal(qualityScores.get(10)).setScale(0, 4).intValue()));
|
||||||
result.setGender(Integer.valueOf(new BigDecimal(qualityScores.get(11)).setScale(0).intValue()));
|
result.setGender(Integer.valueOf(new BigDecimal(qualityScores.get(11)).setScale(0).intValue()));
|
||||||
this.logger.info("结束特征提取,结果:{}", (Object)JSON.toJSONString((Object)result));
|
this.logger.info("结束特征提取,结果:{}", (Object)JSON.toJSONString((Object)result));
|
||||||
return CloudwalkResult.success((Object)result);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<FaceDetectResult> faceDetect(CpFaceDetectParam faceDetectParam) throws ServiceException {
|
public CloudwalkResult<FaceDetectResult> faceDetect(CpFaceDetectParam faceDetectParam) throws ServiceException {
|
||||||
@@ -251,7 +251,7 @@ implements CpImageStoreToolService {
|
|||||||
throw new ServiceException(faceDetectResult.getResult().toString(), faceDetectResult.getInfo());
|
throw new ServiceException(faceDetectResult.getResult().toString(), faceDetectResult.getInfo());
|
||||||
}
|
}
|
||||||
this.logger.info("结束人脸检测,结果:{}", (Object)JSON.toJSONString((Object)faceDetectResult));
|
this.logger.info("结束人脸检测,结果:{}", (Object)JSON.toJSONString((Object)faceDetectResult));
|
||||||
return CloudwalkResult.success((Object)faceDetectResult);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<BatchHandleFaceResult> batchAddFace(CpBatchHandleFaceParam param) throws ServiceException {
|
public CloudwalkResult<BatchHandleFaceResult> batchAddFace(CpBatchHandleFaceParam param) throws ServiceException {
|
||||||
@@ -285,7 +285,7 @@ implements CpImageStoreToolService {
|
|||||||
throw new ServiceException(batchHandleFaceResult.getResult().toString(), batchHandleFaceResult.getInfo());
|
throw new ServiceException(batchHandleFaceResult.getResult().toString(), batchHandleFaceResult.getInfo());
|
||||||
}
|
}
|
||||||
this.logger.info("结束批量添加人脸");
|
this.logger.info("结束批量添加人脸");
|
||||||
return CloudwalkResult.success((Object)batchHandleFaceResult);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<BatchHandleFaceResult> batchRemoveFace(CpBatchHandleFaceParam param) throws ServiceException {
|
public CloudwalkResult<BatchHandleFaceResult> batchRemoveFace(CpBatchHandleFaceParam param) throws ServiceException {
|
||||||
@@ -305,7 +305,7 @@ implements CpImageStoreToolService {
|
|||||||
throw new ServiceException(batchHandleFaceResult.getResult().toString(), batchHandleFaceResult.getInfo());
|
throw new ServiceException(batchHandleFaceResult.getResult().toString(), batchHandleFaceResult.getInfo());
|
||||||
}
|
}
|
||||||
this.logger.info("结束批量删除人脸");
|
this.logger.info("结束批量删除人脸");
|
||||||
return CloudwalkResult.success((Object)batchHandleFaceResult);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<Boolean> addFace(CpBatchHandleFaceParam param) throws ServiceException {
|
public CloudwalkResult<Boolean> addFace(CpBatchHandleFaceParam param) throws ServiceException {
|
||||||
@@ -337,7 +337,7 @@ implements CpImageStoreToolService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.logger.info("结束添加人脸");
|
this.logger.info("结束添加人脸");
|
||||||
return CloudwalkResult.success((Object)(successCount > 0 ? 1 : 0));
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<HandleFaceResult> addFace(CpHandleFaceParam param) throws ServiceException {
|
public CloudwalkResult<HandleFaceResult> addFace(CpHandleFaceParam param) throws ServiceException {
|
||||||
@@ -370,7 +370,7 @@ implements CpImageStoreToolService {
|
|||||||
handleFaceResult.setAge(CollectionUtils.isEmpty(qualityScoreList) ? null : Integer.valueOf(new BigDecimal((String)qualityScoreList.get(10)).setScale(2, 3).intValue()));
|
handleFaceResult.setAge(CollectionUtils.isEmpty(qualityScoreList) ? null : Integer.valueOf(new BigDecimal((String)qualityScoreList.get(10)).setScale(2, 3).intValue()));
|
||||||
handleFaceResult.setGender(CollectionUtils.isEmpty(qualityScoreList) ? null : Short.valueOf(new BigDecimal((String)qualityScoreList.get(11)).shortValue()));
|
handleFaceResult.setGender(CollectionUtils.isEmpty(qualityScoreList) ? null : Short.valueOf(new BigDecimal((String)qualityScoreList.get(11)).shortValue()));
|
||||||
this.logger.info("图库[{}]人脸[{}]已存在", (Object)param.getImageStoreId(), (Object)param.getImageId());
|
this.logger.info("图库[{}]人脸[{}]已存在", (Object)param.getImageStoreId(), (Object)param.getImageId());
|
||||||
return CloudwalkResult.success((Object)handleFaceResult);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
if (extractResult.isSuccess()) {
|
if (extractResult.isSuccess()) {
|
||||||
AddFaceParam addFaceParam = AddFaceParam.builder().groupId(param.getImageStoreId()).userId(param.getImageId()).feature(((AgFeatureExtractResult)extractResult.getData()).getFeature()).qualityScore(String.join((CharSequence)",", qualityScoreList)).build();
|
AddFaceParam addFaceParam = AddFaceParam.builder().groupId(param.getImageStoreId()).userId(param.getImageId()).feature(((AgFeatureExtractResult)extractResult.getData()).getFeature()).qualityScore(String.join((CharSequence)",", qualityScoreList)).build();
|
||||||
@@ -384,7 +384,7 @@ implements CpImageStoreToolService {
|
|||||||
handleFaceResult.setAge(Integer.valueOf(new BigDecimal((String)qualityScoreList.get(10)).setScale(2, 3).intValue()));
|
handleFaceResult.setAge(Integer.valueOf(new BigDecimal((String)qualityScoreList.get(10)).setScale(2, 3).intValue()));
|
||||||
handleFaceResult.setGender(Short.valueOf(new BigDecimal((String)qualityScoreList.get(11)).shortValue()));
|
handleFaceResult.setGender(Short.valueOf(new BigDecimal((String)qualityScoreList.get(11)).shortValue()));
|
||||||
this.logger.info("结束添加图库[{}]人脸[{}]", (Object)param.getImageStoreId(), (Object)param.getImageId());
|
this.logger.info("结束添加图库[{}]人脸[{}]", (Object)param.getImageStoreId(), (Object)param.getImageId());
|
||||||
return CloudwalkResult.success((Object)handleFaceResult);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
this.logger.warn("图库[{}]添加人脸[{}]失败:{}", new Object[]{param.getImageStoreId(), param.getImageId(), result.getInfo()});
|
this.logger.warn("图库[{}]添加人脸[{}]失败:{}", new Object[]{param.getImageStoreId(), param.getImageId(), result.getInfo()});
|
||||||
}
|
}
|
||||||
@@ -392,7 +392,7 @@ implements CpImageStoreToolService {
|
|||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
this.logger.error("图库[{}]添加人脸[{}]异常:{}", new Object[]{param.getImageStoreId(), param.getImageId(), e.getMessage()});
|
this.logger.error("图库[{}]添加人脸[{}]异常:{}", new Object[]{param.getImageStoreId(), param.getImageId(), e.getMessage()});
|
||||||
}
|
}
|
||||||
return CloudwalkResult.fail((String)"53060447", (String)this.getMessage("53060447"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<HandleFaceResult> removeFace(CpHandleFaceParam param) throws ServiceException {
|
public CloudwalkResult<HandleFaceResult> removeFace(CpHandleFaceParam param) throws ServiceException {
|
||||||
@@ -410,50 +410,50 @@ implements CpImageStoreToolService {
|
|||||||
HandleFaceResult handleFaceResult = (HandleFaceResult)BeanCopyUtils.copyProperties((Object)result, HandleFaceResult.class);
|
HandleFaceResult handleFaceResult = (HandleFaceResult)BeanCopyUtils.copyProperties((Object)result, HandleFaceResult.class);
|
||||||
handleFaceResult.setPersonId(Optional.ofNullable(imgStorePerson).map(p -> p.getId()).orElse(""));
|
handleFaceResult.setPersonId(Optional.ofNullable(imgStorePerson).map(p -> p.getId()).orElse(""));
|
||||||
this.logger.info("结束删除图库[{}]人脸[{}]", (Object)param.getImageStoreId(), (Object)param.getImageId());
|
this.logger.info("结束删除图库[{}]人脸[{}]", (Object)param.getImageStoreId(), (Object)param.getImageId());
|
||||||
return CloudwalkResult.success((Object)handleFaceResult);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
this.logger.warn("图库[{}]删除人脸[{}]失败", (Object)param.getImageStoreId(), (Object)param.getImageId());
|
this.logger.warn("图库[{}]删除人脸[{}]失败", (Object)param.getImageStoreId(), (Object)param.getImageId());
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
this.logger.error("图库[{}]删除人脸[{}]异常:{}", new Object[]{param.getImageStoreId(), param.getImageId(), e.getMessage()});
|
this.logger.error("图库[{}]删除人脸[{}]异常:{}", new Object[]{param.getImageStoreId(), param.getImageId(), e.getMessage()});
|
||||||
}
|
}
|
||||||
return CloudwalkResult.fail((String)"53060448", (String)this.getMessage("53060448"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<SearchFaceResult> searchFace(CpSearchFaceParam param) {
|
public CloudwalkResult<SearchFaceResult> searchFace(CpSearchFaceParam param) {
|
||||||
if (StringUtils.isEmpty((Object)param.getImageStoreId())) {
|
if (StringUtils.isEmpty((Object)param.getImageStoreId())) {
|
||||||
return CloudwalkResult.fail((String)"53060438", (String)this.getMessage("53060438"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
if (StringUtils.isEmpty((Object)param.getImageIds())) {
|
if (StringUtils.isEmpty((Object)param.getImageIds())) {
|
||||||
return CloudwalkResult.fail((String)"53014025", (String)this.getMessage("53014025"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
SearchFaceParam searchFaceParam = SearchFaceParam.builder().groupId(param.getImageStoreId()).userId(String.join((CharSequence)",", param.getImageIds())).build();
|
SearchFaceParam searchFaceParam = SearchFaceParam.builder().groupId(param.getImageStoreId()).userId(String.join((CharSequence)",", param.getImageIds())).build();
|
||||||
String resultStr = this.pineappleClient.searchFace(searchFaceParam);
|
String resultStr = this.pineappleClient.searchFace(searchFaceParam);
|
||||||
if (StringUtils.isEmpty((Object)resultStr)) {
|
if (StringUtils.isEmpty((Object)resultStr)) {
|
||||||
return CloudwalkResult.fail((String)"53060443", (String)this.getMessage("53060443"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
SearchFaceResult result = (SearchFaceResult)JSON.parseObject((String)resultStr, SearchFaceResult.class);
|
SearchFaceResult result = (SearchFaceResult)JSON.parseObject((String)resultStr, SearchFaceResult.class);
|
||||||
return CloudwalkResult.success((Object)result);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<BatchSearchFaceResult> batchSearchFace(CpSearchFaceParam param) {
|
public CloudwalkResult<BatchSearchFaceResult> batchSearchFace(CpSearchFaceParam param) {
|
||||||
if (StringUtils.isEmpty((Object)param.getImageStoreId())) {
|
if (StringUtils.isEmpty((Object)param.getImageStoreId())) {
|
||||||
return CloudwalkResult.fail((String)"53060438", (String)this.getMessage("53060438"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
if (StringUtils.isEmpty((Object)param.getImageIds())) {
|
if (StringUtils.isEmpty((Object)param.getImageIds())) {
|
||||||
return CloudwalkResult.fail((String)"53014025", (String)this.getMessage("53014025"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
SearchFaceParam searchFaceParam = SearchFaceParam.builder().groupId(param.getImageStoreId()).userId(param.getImageIds()).build();
|
SearchFaceParam searchFaceParam = SearchFaceParam.builder().groupId(param.getImageStoreId()).userId(param.getImageIds()).build();
|
||||||
String resultStr = this.pineappleClient.searchFace(searchFaceParam);
|
String resultStr = this.pineappleClient.searchFace(searchFaceParam);
|
||||||
if (StringUtils.isEmpty((Object)resultStr)) {
|
if (StringUtils.isEmpty((Object)resultStr)) {
|
||||||
return CloudwalkResult.fail((String)"53060443", (String)this.getMessage("53060443"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
BatchSearchFaceResult result = (BatchSearchFaceResult)JSON.parseObject((String)resultStr, BatchSearchFaceResult.class);
|
BatchSearchFaceResult result = (BatchSearchFaceResult)JSON.parseObject((String)resultStr, BatchSearchFaceResult.class);
|
||||||
if (result.getResult() != 0) {
|
if (result.getResult() != 0) {
|
||||||
this.logger.warn("批量查询图库[]人脸[]失败", (Object)param.getImageStoreId(), (Object)String.join((CharSequence)",", param.getImageIds()));
|
this.logger.warn("批量查询图库[]人脸[]失败", (Object)param.getImageStoreId(), (Object)String.join((CharSequence)",", param.getImageIds()));
|
||||||
return CloudwalkResult.fail((String)"53060444", (String)this.getMessage("53060444"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)result);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkBatchHandleFaceParam(CpBatchHandleFaceParam param) throws ServiceException {
|
private void checkBatchHandleFaceParam(CpBatchHandleFaceParam param) throws ServiceException {
|
||||||
|
|||||||
+10
-10
@@ -114,7 +114,7 @@ implements CpOrgDevieKitService {
|
|||||||
UpdateGroupResult updateGroupResult = new UpdateGroupResult();
|
UpdateGroupResult updateGroupResult = new UpdateGroupResult();
|
||||||
BeanCopyUtils.copyProperties((Object)updateGroupParam, (Object)updateGroupResult);
|
BeanCopyUtils.copyProperties((Object)updateGroupParam, (Object)updateGroupResult);
|
||||||
updateGroupResult.setGroups(groups);
|
updateGroupResult.setGroups(groups);
|
||||||
return CloudwalkResult.success((Object)updateGroupResult);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<UpdateFeatureResult> onUpdateFeatureRequest(UpdateFeatureParam updateFeatureParam, CloudwalkCallContext cloudwalkCallContext) throws ServiceException {
|
public CloudwalkResult<UpdateFeatureResult> onUpdateFeatureRequest(UpdateFeatureParam updateFeatureParam, CloudwalkCallContext cloudwalkCallContext) throws ServiceException {
|
||||||
@@ -124,7 +124,7 @@ implements CpOrgDevieKitService {
|
|||||||
AtomicDeviceGetResult device = this.checkAndGetDeviceByCode(updateFeatureParam.getDeviceId(), cloudwalkCallContext);
|
AtomicDeviceGetResult device = this.checkAndGetDeviceByCode(updateFeatureParam.getDeviceId(), cloudwalkCallContext);
|
||||||
boolean checkBoolean = this.checkDeviceImageStoreIdRefExist(updateFeatureParam.getGroupId(), device.getId(), cloudwalkCallContext);
|
boolean checkBoolean = this.checkDeviceImageStoreIdRefExist(updateFeatureParam.getGroupId(), device.getId(), cloudwalkCallContext);
|
||||||
if (!checkBoolean) {
|
if (!checkBoolean) {
|
||||||
return CloudwalkResult.success((Object)updateFeatureResult);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
DeviceImageUpdateFeatureQuery updatePersonQuery = new DeviceImageUpdateFeatureQuery();
|
DeviceImageUpdateFeatureQuery updatePersonQuery = new DeviceImageUpdateFeatureQuery();
|
||||||
updatePersonQuery.setImageStoreId(updateFeatureParam.getGroupId());
|
updatePersonQuery.setImageStoreId(updateFeatureParam.getGroupId());
|
||||||
@@ -137,7 +137,7 @@ implements CpOrgDevieKitService {
|
|||||||
}
|
}
|
||||||
if (!(updatePersonInfo = this.cpDeviceImagePersonService.getDeviceImageUpdateFeatureInfo(updatePersonQuery, cloudwalkCallContext)).isSuccess()) {
|
if (!(updatePersonInfo = this.cpDeviceImagePersonService.getDeviceImageUpdateFeatureInfo(updatePersonQuery, cloudwalkCallContext)).isSuccess()) {
|
||||||
this.logger.warn("get feature info error,device:{}, imageStore:{}", (Object)updateFeatureParam.getDeviceId(), (Object)updateFeatureParam.getGroupId());
|
this.logger.warn("get feature info error,device:{}, imageStore:{}", (Object)updateFeatureParam.getDeviceId(), (Object)updateFeatureParam.getGroupId());
|
||||||
return CloudwalkResult.success((Object)updateFeatureResult);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
CloudwalkPageAble personInfoData = (CloudwalkPageAble)updatePersonInfo.getData();
|
CloudwalkPageAble personInfoData = (CloudwalkPageAble)updatePersonInfo.getData();
|
||||||
updateFeatureResult.setCurrentPage(Integer.valueOf((int)personInfoData.getCurrentPage()));
|
updateFeatureResult.setCurrentPage(Integer.valueOf((int)personInfoData.getCurrentPage()));
|
||||||
@@ -163,7 +163,7 @@ implements CpOrgDevieKitService {
|
|||||||
} else {
|
} else {
|
||||||
updateFeatureResult.setEndFlag(EndFlagEnum.NO_END.getCode());
|
updateFeatureResult.setEndFlag(EndFlagEnum.NO_END.getCode());
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)updateFeatureResult);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<UpdatePictureResult> onUpdatePictureRequest(UpdatePictureParam updatePictureParam, CloudwalkCallContext cloudwalkCallContext) throws ServiceException {
|
public CloudwalkResult<UpdatePictureResult> onUpdatePictureRequest(UpdatePictureParam updatePictureParam, CloudwalkCallContext cloudwalkCallContext) throws ServiceException {
|
||||||
@@ -173,7 +173,7 @@ implements CpOrgDevieKitService {
|
|||||||
AtomicDeviceGetResult device = this.checkAndGetDeviceByCode(updatePictureParam.getDeviceId(), cloudwalkCallContext);
|
AtomicDeviceGetResult device = this.checkAndGetDeviceByCode(updatePictureParam.getDeviceId(), cloudwalkCallContext);
|
||||||
boolean checkBoolean = this.checkDeviceImageStoreIdRefExist(updatePictureParam.getGroupId(), device.getId(), cloudwalkCallContext);
|
boolean checkBoolean = this.checkDeviceImageStoreIdRefExist(updatePictureParam.getGroupId(), device.getId(), cloudwalkCallContext);
|
||||||
if (!checkBoolean) {
|
if (!checkBoolean) {
|
||||||
return CloudwalkResult.success((Object)updatePictureResult);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
DeviceImageUpdatePersonQuery updatePersonQuery = new DeviceImageUpdatePersonQuery();
|
DeviceImageUpdatePersonQuery updatePersonQuery = new DeviceImageUpdatePersonQuery();
|
||||||
updatePersonQuery.setImageStoreId(updatePictureParam.getGroupId());
|
updatePersonQuery.setImageStoreId(updatePictureParam.getGroupId());
|
||||||
@@ -186,7 +186,7 @@ implements CpOrgDevieKitService {
|
|||||||
}
|
}
|
||||||
if (!(updatePersonInfo = this.cpDeviceImagePersonService.getDeviceImageUpdatePersonInfo(updatePersonQuery, cloudwalkCallContext)).isSuccess()) {
|
if (!(updatePersonInfo = this.cpDeviceImagePersonService.getDeviceImageUpdatePersonInfo(updatePersonQuery, cloudwalkCallContext)).isSuccess()) {
|
||||||
this.logger.warn("get picture info error,device:{}, imageStore:{}", (Object)updatePictureParam.getDeviceId(), (Object)updatePictureParam.getGroupId());
|
this.logger.warn("get picture info error,device:{}, imageStore:{}", (Object)updatePictureParam.getDeviceId(), (Object)updatePictureParam.getGroupId());
|
||||||
return CloudwalkResult.success((Object)updatePictureResult);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
CloudwalkPageAble personInfoData = (CloudwalkPageAble)updatePersonInfo.getData();
|
CloudwalkPageAble personInfoData = (CloudwalkPageAble)updatePersonInfo.getData();
|
||||||
updatePictureParam.setCurrentPage(Integer.valueOf((int)personInfoData.getCurrentPage()));
|
updatePictureParam.setCurrentPage(Integer.valueOf((int)personInfoData.getCurrentPage()));
|
||||||
@@ -212,7 +212,7 @@ implements CpOrgDevieKitService {
|
|||||||
updatePictureResult.setEndFlag(EndFlagEnum.NO_END.getCode());
|
updatePictureResult.setEndFlag(EndFlagEnum.NO_END.getCode());
|
||||||
}
|
}
|
||||||
BeanCopyUtils.copyProperties((Object)updatePictureParam, (Object)updatePictureResult);
|
BeanCopyUtils.copyProperties((Object)updatePictureParam, (Object)updatePictureResult);
|
||||||
return CloudwalkResult.success((Object)updatePictureResult);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<UpdatePersonResult> onUpdatePersonRequest(UpdatePersonParam updatePersonParam, CloudwalkCallContext cloudwalkCallContext) throws ServiceException {
|
public CloudwalkResult<UpdatePersonResult> onUpdatePersonRequest(UpdatePersonParam updatePersonParam, CloudwalkCallContext cloudwalkCallContext) throws ServiceException {
|
||||||
@@ -232,7 +232,7 @@ implements CpOrgDevieKitService {
|
|||||||
List deviceImageStoreList = this.deviceImageStoreMapper.select(query);
|
List deviceImageStoreList = this.deviceImageStoreMapper.select(query);
|
||||||
if (!CollectionUtils.isEmpty((Collection)deviceImageStoreList) && (deviceImageStore = (DeviceImageStore)deviceImageStoreList.get(0)).getType() == 2 && null != deviceImageStore.getFinishPullTime()) {
|
if (!CollectionUtils.isEmpty((Collection)deviceImageStoreList) && (deviceImageStore = (DeviceImageStore)deviceImageStoreList.get(0)).getType() == 2 && null != deviceImageStore.getFinishPullTime()) {
|
||||||
updatePersonResult.setEndFlag(EndFlagEnum.END.getCode());
|
updatePersonResult.setEndFlag(EndFlagEnum.END.getCode());
|
||||||
return CloudwalkResult.success((Object)updatePersonResult);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DeviceImageUpdatePersonQuery updatePersonQuery = new DeviceImageUpdatePersonQuery();
|
DeviceImageUpdatePersonQuery updatePersonQuery = new DeviceImageUpdatePersonQuery();
|
||||||
@@ -252,7 +252,7 @@ implements CpOrgDevieKitService {
|
|||||||
this.logger.info("20113 getDeviceUpdatePersonInfo,spend time {} millis", (Object)(t2 - t1));
|
this.logger.info("20113 getDeviceUpdatePersonInfo,spend time {} millis", (Object)(t2 - t1));
|
||||||
if (!updatePersonInfo.isSuccess()) {
|
if (!updatePersonInfo.isSuccess()) {
|
||||||
this.logger.warn("get person info error,device:{}, imageStore:{}", (Object)updatePersonParam.getDeviceId(), (Object)updatePersonParam.getGroupId());
|
this.logger.warn("get person info error,device:{}, imageStore:{}", (Object)updatePersonParam.getDeviceId(), (Object)updatePersonParam.getGroupId());
|
||||||
return CloudwalkResult.success((Object)updatePersonResult);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
CloudwalkPageAble personInfoData = (CloudwalkPageAble)updatePersonInfo.getData();
|
CloudwalkPageAble personInfoData = (CloudwalkPageAble)updatePersonInfo.getData();
|
||||||
updatePersonResult.setCurrentPage(Integer.valueOf((int)personInfoData.getCurrentPage()));
|
updatePersonResult.setCurrentPage(Integer.valueOf((int)personInfoData.getCurrentPage()));
|
||||||
@@ -307,7 +307,7 @@ implements CpOrgDevieKitService {
|
|||||||
} else {
|
} else {
|
||||||
updatePersonResult.setEndFlag(EndFlagEnum.NO_END.getCode());
|
updatePersonResult.setEndFlag(EndFlagEnum.NO_END.getCode());
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)updatePersonResult);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addSyncLogForFeatureUpdate(String deviceId, String groupId, List<UpdateFeatureResult.FeatureData> featureDatas) {
|
private void addSyncLogForFeatureUpdate(String deviceId, String groupId, List<UpdateFeatureResult.FeatureData> featureDatas) {
|
||||||
|
|||||||
+4
-4
@@ -51,7 +51,7 @@ implements CpOrgImageStoreService {
|
|||||||
this.logger.error("新增图库应用关联异常", e);
|
this.logger.error("新增图库应用关联异常", e);
|
||||||
throw new ServiceException("53013522", this.getMessage("53013522"));
|
throw new ServiceException("53013522", this.getMessage("53013522"));
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)true);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
@CloudwalkParamsValidate
|
@CloudwalkParamsValidate
|
||||||
@@ -65,13 +65,13 @@ implements CpOrgImageStoreService {
|
|||||||
if (CollectionUtils.isEmpty((Collection)queryResult)) {
|
if (CollectionUtils.isEmpty((Collection)queryResult)) {
|
||||||
this.applicationImageStoreService.delete((ApplicationImageStoreDeleteParam)BeanCopyUtils.copyProperties((Object)deleteParam, ApplicationImageStoreDeleteParam.class), context);
|
this.applicationImageStoreService.delete((ApplicationImageStoreDeleteParam)BeanCopyUtils.copyProperties((Object)deleteParam, ApplicationImageStoreDeleteParam.class), context);
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)true);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
@CloudwalkParamsValidate
|
@CloudwalkParamsValidate
|
||||||
public CloudwalkResult<List<OrgImageStoreResult>> query(QueryOrgImageStoreParam queryParam, CloudwalkCallContext context) {
|
public CloudwalkResult<List<OrgImageStoreResult>> query(QueryOrgImageStoreParam queryParam, CloudwalkCallContext context) {
|
||||||
List queryResult = this.organizationImageStoreMapper.query((OrganizationImageStoreQueryDTO)BeanCopyUtils.copyProperties((Object)queryParam, OrganizationImageStoreQueryDTO.class));
|
List queryResult = this.organizationImageStoreMapper.query((OrganizationImageStoreQueryDTO)BeanCopyUtils.copyProperties((Object)queryParam, OrganizationImageStoreQueryDTO.class));
|
||||||
return CloudwalkResult.success((Object)BeanCopyUtils.copy((Collection)queryResult, OrgImageStoreResult.class));
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
@CloudwalkParamsValidate
|
@CloudwalkParamsValidate
|
||||||
@@ -79,7 +79,7 @@ implements CpOrgImageStoreService {
|
|||||||
Page pageInfo = PageHelper.startPage((int)queryParam.getCurrentPage(), (int)queryParam.getRowsOfPage());
|
Page pageInfo = PageHelper.startPage((int)queryParam.getCurrentPage(), (int)queryParam.getRowsOfPage());
|
||||||
List queryResult = this.organizationImageStoreMapper.query((OrganizationImageStoreQueryDTO)BeanCopyUtils.copyProperties((Object)queryParam, OrganizationImageStoreQueryDTO.class));
|
List queryResult = this.organizationImageStoreMapper.query((OrganizationImageStoreQueryDTO)BeanCopyUtils.copyProperties((Object)queryParam, OrganizationImageStoreQueryDTO.class));
|
||||||
List resultList = BeanCopyUtils.copy((Collection)queryResult, OrgImageStoreResult.class);
|
List resultList = BeanCopyUtils.copy((Collection)queryResult, OrgImageStoreResult.class);
|
||||||
return CloudwalkResult.success((Object)new CloudwalkPageAble((Collection)resultList, new CloudwalkPageInfo(queryParam.getCurrentPage(), queryParam.getCurrentPage()), pageInfo.getTotal()));
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
-5
@@ -88,7 +88,7 @@ implements DevicePersonSyncService {
|
|||||||
this.logger.debug("图库同步记录详情分页查询结果:[{}]", (Object)JSON.toJSONString(result));
|
this.logger.debug("图库同步记录详情分页查询结果:[{}]", (Object)JSON.toJSONString(result));
|
||||||
if (!result.isSuccess()) {
|
if (!result.isSuccess()) {
|
||||||
this.logger.warn("获取图库同步记录详情分页查询失败");
|
this.logger.warn("获取图库同步记录详情分页查询失败");
|
||||||
return CloudwalkResult.fail((String)"53013549", (String)this.getMessage("53013549"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
CloudwalkPageAble pageAble = (CloudwalkPageAble)result.getData();
|
CloudwalkPageAble pageAble = (CloudwalkPageAble)result.getData();
|
||||||
if (null != pageAble && !CollectionUtils.isEmpty((Collection)pageAble.getDatas())) {
|
if (null != pageAble && !CollectionUtils.isEmpty((Collection)pageAble.getDatas())) {
|
||||||
@@ -107,7 +107,7 @@ implements DevicePersonSyncService {
|
|||||||
synLogResult.setImageUrl(((ImgStorePerson)personMap.get(synLogResult.getPersonId())).getComparePicture());
|
synLogResult.setImageUrl(((ImgStorePerson)personMap.get(synLogResult.getPersonId())).getComparePicture());
|
||||||
synLogResult.setName(((ImgStorePerson)personMap.get(synLogResult.getPersonId())).getName());
|
synLogResult.setName(((ImgStorePerson)personMap.get(synLogResult.getPersonId())).getName());
|
||||||
});
|
});
|
||||||
return CloudwalkResult.success((Object)new CloudwalkPageAble((Collection)resultList, new CloudwalkPageInfo(param.getCurrentPage(), param.getRowsOfPage()), pageAble.getTotalRows()));
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -138,7 +138,7 @@ implements DevicePersonSyncService {
|
|||||||
CloudwalkPageAble pageAble = new CloudwalkPageAble(deviceList, page, totalCount);
|
CloudwalkPageAble pageAble = new CloudwalkPageAble(deviceList, page, totalCount);
|
||||||
long end = System.currentTimeMillis();
|
long end = System.currentTimeMillis();
|
||||||
this.logger.debug("查询当前租户设备列表耗时[{}]", (Object)(end - start));
|
this.logger.debug("查询当前租户设备列表耗时[{}]", (Object)(end - start));
|
||||||
return CloudwalkResult.success((Object)pageAble);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<AtomicDeviceGetResult> pageBySubList(List<AtomicDeviceGetResult> list, int pagesize, int currentPage) {
|
public static List<AtomicDeviceGetResult> pageBySubList(List<AtomicDeviceGetResult> list, int pagesize, int currentPage) {
|
||||||
@@ -247,7 +247,7 @@ implements DevicePersonSyncService {
|
|||||||
Map<String, String> imageStoreMap = this.deviceImageStoreMap(queryDevicePersonSyncLogParam, context);
|
Map<String, String> imageStoreMap = this.deviceImageStoreMap(queryDevicePersonSyncLogParam, context);
|
||||||
List imageStoreIds = imageStoreMap.entrySet().stream().map(e -> (String)e.getKey()).collect(Collectors.toList());
|
List imageStoreIds = imageStoreMap.entrySet().stream().map(e -> (String)e.getKey()).collect(Collectors.toList());
|
||||||
if (CollectionUtils.isEmpty(imageStoreIds)) {
|
if (CollectionUtils.isEmpty(imageStoreIds)) {
|
||||||
return CloudwalkResult.success(pageAble);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
boolean supportValidDate = false;
|
boolean supportValidDate = false;
|
||||||
CoreDeviceQueryParam coreDeviceQueryParam = new CoreDeviceQueryParam();
|
CoreDeviceQueryParam coreDeviceQueryParam = new CoreDeviceQueryParam();
|
||||||
@@ -278,7 +278,7 @@ implements DevicePersonSyncService {
|
|||||||
result.setPersonStatus(Integer.valueOf(StatusEnum.VALID.getValue()));
|
result.setPersonStatus(Integer.valueOf(StatusEnum.VALID.getValue()));
|
||||||
}
|
}
|
||||||
pageAble = new CloudwalkPageAble((Collection)list, page, pageResult.getTotal());
|
pageAble = new CloudwalkPageAble((Collection)list, page, pageResult.getTotal());
|
||||||
return CloudwalkResult.success((Object)pageAble);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(rollbackFor={Exception.class})
|
@Transactional(rollbackFor={Exception.class})
|
||||||
|
|||||||
+3
-3
@@ -43,15 +43,15 @@ implements ImgPersonBatchDetailService {
|
|||||||
throw new ServiceException(e);
|
throw new ServiceException(e);
|
||||||
}
|
}
|
||||||
result = BeanCopyUtils.copy((Collection)pageAble.getDatas(), BatchDetailResult.class);
|
result = BeanCopyUtils.copy((Collection)pageAble.getDatas(), BatchDetailResult.class);
|
||||||
return CloudwalkResult.success((Object)new CloudwalkPageAble((Collection)result, page, pageAble.getTotalRows()));
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<Integer> insertBatch(List<BatchDetailInsertBatchParam> batchDetails) {
|
public CloudwalkResult<Integer> insertBatch(List<BatchDetailInsertBatchParam> batchDetails) {
|
||||||
if (!CollectionUtils.isEmpty(batchDetails)) {
|
if (!CollectionUtils.isEmpty(batchDetails)) {
|
||||||
List list = BeanCopyUtils.copy(batchDetails, BatchDetail.class);
|
List list = BeanCopyUtils.copy(batchDetails, BatchDetail.class);
|
||||||
return CloudwalkResult.success((Object)this.imgPersonBatchDetailMapper.insertBatch(list));
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)batchDetails.size());
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -509,9 +509,9 @@ implements ImgPersonBatchService {
|
|||||||
batchImport.setLoginName(context.getUser().getCallerName());
|
batchImport.setLoginName(context.getUser().getCallerName());
|
||||||
int count = this.personBatchImportMapper.insert(batchImport);
|
int count = this.personBatchImportMapper.insert(batchImport);
|
||||||
if (count < 1) {
|
if (count < 1) {
|
||||||
return CloudwalkResult.fail((String)"53014035", (String)this.messageSource.getMessage("53014035", null, LocaleContextHolder.getLocale()));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)true);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<CloudwalkPageAble<BatchImportQueryResult>> page(BatchImportQueryParam param, CloudwalkPageInfo page, CloudwalkCallContext context) throws ServiceException {
|
public CloudwalkResult<CloudwalkPageAble<BatchImportQueryResult>> page(BatchImportQueryParam param, CloudwalkPageInfo page, CloudwalkCallContext context) throws ServiceException {
|
||||||
@@ -529,7 +529,7 @@ implements ImgPersonBatchService {
|
|||||||
throw new ServiceException(e);
|
throw new ServiceException(e);
|
||||||
}
|
}
|
||||||
result = BeanCopyUtils.copy((Collection)pageAble.getDatas(), BatchImportQueryResult.class);
|
result = BeanCopyUtils.copy((Collection)pageAble.getDatas(), BatchImportQueryResult.class);
|
||||||
return CloudwalkResult.success((Object)new CloudwalkPageAble((Collection)result, page, pageAble.getTotalRows()));
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+15
-15
@@ -428,13 +428,13 @@ extends AbstractImagStoreService {
|
|||||||
Field sourceField = ReflectionUtils.findField(param.getClass(), (String)systemIdFiledName);
|
Field sourceField = ReflectionUtils.findField(param.getClass(), (String)systemIdFiledName);
|
||||||
Field targetField = ReflectionUtils.findField(ImgStorePersonQueryDto.class, (String)systemIdFiledName);
|
Field targetField = ReflectionUtils.findField(ImgStorePersonQueryDto.class, (String)systemIdFiledName);
|
||||||
if (null == sourceField || null == targetField) {
|
if (null == sourceField || null == targetField) {
|
||||||
return CloudwalkResult.fail((String)"53014016", (String)this.getMessage("53014016"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
sourceField.setAccessible(true);
|
sourceField.setAccessible(true);
|
||||||
targetField.setAccessible(true);
|
targetField.setAccessible(true);
|
||||||
Object systemIdFieldValue = ReflectionUtils.getField((Field)sourceField, (Object)param);
|
Object systemIdFieldValue = ReflectionUtils.getField((Field)sourceField, (Object)param);
|
||||||
if (null == systemIdFieldValue || StringUtils.isBlank((CharSequence)systemIdFieldValue.toString())) {
|
if (null == systemIdFieldValue || StringUtils.isBlank((CharSequence)systemIdFieldValue.toString())) {
|
||||||
return CloudwalkResult.fail((String)"53014027", (String)this.getMessage("53014027"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
String businessId = StringUtils.isEmpty((CharSequence)param.getBusinessId()) ? context.getCompany().getCompanyId() : param.getBusinessId();
|
String businessId = StringUtils.isEmpty((CharSequence)param.getBusinessId()) ? context.getCompany().getCompanyId() : param.getBusinessId();
|
||||||
ImgStorePersonQueryDto queryDto = new ImgStorePersonQueryDto();
|
ImgStorePersonQueryDto queryDto = new ImgStorePersonQueryDto();
|
||||||
@@ -445,18 +445,18 @@ extends AbstractImagStoreService {
|
|||||||
List queryList = this.imgStorePersonMapper.gets(queryDto);
|
List queryList = this.imgStorePersonMapper.gets(queryDto);
|
||||||
if (!CollectionUtils.isEmpty((Collection)queryList)) {
|
if (!CollectionUtils.isEmpty((Collection)queryList)) {
|
||||||
if (systemIdFiledName.equals("personCode")) {
|
if (systemIdFiledName.equals("personCode")) {
|
||||||
return CloudwalkResult.fail((String)"53014012", (String)this.getMessage("53014012"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
if (systemIdFiledName.equals("phone")) {
|
if (systemIdFiledName.equals("phone")) {
|
||||||
return CloudwalkResult.fail((String)"53014014", (String)this.getMessage("53014014"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
if (systemIdFiledName.equals("email")) {
|
if (systemIdFiledName.equals("email")) {
|
||||||
return CloudwalkResult.fail((String)"53014015", (String)this.getMessage("53014015"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
if (systemIdFiledName.equals("userName")) {
|
if (systemIdFiledName.equals("userName")) {
|
||||||
return CloudwalkResult.fail((String)"53014013", (String)this.getMessage("53014013"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
return CloudwalkResult.fail((String)"53014028", (String)this.getMessage("53014028"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
if (null != param.getSource() && Objects.equals(CpPersonSourceEnum.CERT.getCode(), param.getSource())) {
|
if (null != param.getSource() && Objects.equals(CpPersonSourceEnum.CERT.getCode(), param.getSource())) {
|
||||||
QueryPersonRegistryParam registryParam = new QueryPersonRegistryParam();
|
QueryPersonRegistryParam registryParam = new QueryPersonRegistryParam();
|
||||||
@@ -478,14 +478,14 @@ extends AbstractImagStoreService {
|
|||||||
queryList = this.imgStorePersonMapper.query(personParam);
|
queryList = this.imgStorePersonMapper.query(personParam);
|
||||||
if (!CollectionUtil.isEmpty((Collection)queryList)) {
|
if (!CollectionUtil.isEmpty((Collection)queryList)) {
|
||||||
String errorMessage = this.messageSource.getMessage("53014023", null, LocaleContextHolder.getLocale());
|
String errorMessage = this.messageSource.getMessage("53014023", null, LocaleContextHolder.getLocale());
|
||||||
return CloudwalkResult.fail((String)"53014023", (String)errorMessage);
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
String errorMessage = this.messageSource.getMessage("53014022", null, LocaleContextHolder.getLocale());
|
String errorMessage = this.messageSource.getMessage("53014022", null, LocaleContextHolder.getLocale());
|
||||||
return CloudwalkResult.fail((String)"53014022", (String)errorMessage);
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)"");
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
CloudwalkResult<String> checkUniqueProperty(AddImgPersonParam param, CloudwalkCallContext context) throws ServiceException {
|
CloudwalkResult<String> checkUniqueProperty(AddImgPersonParam param, CloudwalkCallContext context) throws ServiceException {
|
||||||
@@ -501,7 +501,7 @@ extends AbstractImagStoreService {
|
|||||||
queryList = this.imgStorePersonMapper.gets(queryDto);
|
queryList = this.imgStorePersonMapper.gets(queryDto);
|
||||||
if (!CollectionUtil.isEmpty((Collection)queryList)) {
|
if (!CollectionUtil.isEmpty((Collection)queryList)) {
|
||||||
String errorMessage = this.messageSource.getMessage("53014012", null, LocaleContextHolder.getLocale());
|
String errorMessage = this.messageSource.getMessage("53014012", null, LocaleContextHolder.getLocale());
|
||||||
return CloudwalkResult.fail((String)"53014012", (String)errorMessage);
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!StringUtils.isEmpty((CharSequence)param.getUserName())) {
|
if (!StringUtils.isEmpty((CharSequence)param.getUserName())) {
|
||||||
@@ -512,7 +512,7 @@ extends AbstractImagStoreService {
|
|||||||
queryList = this.imgStorePersonMapper.gets(queryDto);
|
queryList = this.imgStorePersonMapper.gets(queryDto);
|
||||||
if (!CollectionUtil.isEmpty((Collection)queryList)) {
|
if (!CollectionUtil.isEmpty((Collection)queryList)) {
|
||||||
String errorMessage = this.messageSource.getMessage("53014013", null, LocaleContextHolder.getLocale());
|
String errorMessage = this.messageSource.getMessage("53014013", null, LocaleContextHolder.getLocale());
|
||||||
return CloudwalkResult.fail((String)"53014013", (String)errorMessage);
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (null != param.getSource() && Objects.equals(CpPersonSourceEnum.CERT.getCode(), param.getSource())) {
|
if (null != param.getSource() && Objects.equals(CpPersonSourceEnum.CERT.getCode(), param.getSource())) {
|
||||||
@@ -535,14 +535,14 @@ extends AbstractImagStoreService {
|
|||||||
queryList = this.imgStorePersonMapper.query(personParam);
|
queryList = this.imgStorePersonMapper.query(personParam);
|
||||||
if (!CollectionUtil.isEmpty((Collection)queryList)) {
|
if (!CollectionUtil.isEmpty((Collection)queryList)) {
|
||||||
String errorMessage = this.messageSource.getMessage("53014023", null, LocaleContextHolder.getLocale());
|
String errorMessage = this.messageSource.getMessage("53014023", null, LocaleContextHolder.getLocale());
|
||||||
return CloudwalkResult.fail((String)"53014023", (String)errorMessage);
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
String errorMessage = this.messageSource.getMessage("53014022", null, LocaleContextHolder.getLocale());
|
String errorMessage = this.messageSource.getMessage("53014022", null, LocaleContextHolder.getLocale());
|
||||||
return CloudwalkResult.fail((String)"53014022", (String)errorMessage);
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)"");
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
void addAccount(AddImgPersonParam param, String businessId, String personId) throws ServiceException {
|
void addAccount(AddImgPersonParam param, String businessId, String personId) throws ServiceException {
|
||||||
|
|||||||
+9
-9
@@ -108,11 +108,11 @@ implements ImgStorePersonPropertiesService {
|
|||||||
}
|
}
|
||||||
this.personPropertiesMapper.insertSelective(personProperties);
|
this.personPropertiesMapper.insertSelective(personProperties);
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)Boolean.TRUE);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
return this.addAndUpdate(newList, listFromDB, context, businessId);
|
return this.addAndUpdate(newList, listFromDB, context, businessId);
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)Boolean.TRUE);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<PersonProListResult> getList(String businessId) throws ServiceException {
|
public CloudwalkResult<PersonProListResult> getList(String businessId) throws ServiceException {
|
||||||
@@ -137,7 +137,7 @@ implements ImgStorePersonPropertiesService {
|
|||||||
List returnList = BeanCopyUtils.copy((Collection)listFromDB, ImgPersonProGetResult.class);
|
List returnList = BeanCopyUtils.copy((Collection)listFromDB, ImgPersonProGetResult.class);
|
||||||
result.setProperties(returnList);
|
result.setProperties(returnList);
|
||||||
result.setHasAccount(Boolean.valueOf(hasAccount));
|
result.setHasAccount(Boolean.valueOf(hasAccount));
|
||||||
return CloudwalkResult.success((Object)result);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<Boolean> init(AddImgPersonProParam param, CloudwalkCallContext cloudwalkContext) throws ServiceException {
|
public CloudwalkResult<Boolean> init(AddImgPersonProParam param, CloudwalkCallContext cloudwalkContext) throws ServiceException {
|
||||||
@@ -199,7 +199,7 @@ implements ImgStorePersonPropertiesService {
|
|||||||
personPropertyinit = ImgStorePersonProperties.getBuilder().setId(CloudwalkDateUtils.getUUID()).setBusinessId("cloudwalk").setCode("showPicture").setName("展示照").setType(Short.valueOf((short)4)).setStatus(ImageStoreConstants.COMMON_PROPERTIES_STATUS).setHasDefault(Integer.valueOf(1)).setHasSysAccount(Integer.valueOf(0)).setHasSysAccountAvailable(Integer.valueOf(0)).setHasRequired(Integer.valueOf(0)).setCreateTime(Long.valueOf(System.currentTimeMillis())).setCreateUserId(cloudwalkContext.getUser().getCaller()).setLastUpdateTime(Long.valueOf(System.currentTimeMillis())).setLastUpdateUserId(cloudwalkContext.getUser().getCaller()).setOrderNum(Integer.valueOf(12)).setReminder("请上传展示照").bulid();
|
personPropertyinit = ImgStorePersonProperties.getBuilder().setId(CloudwalkDateUtils.getUUID()).setBusinessId("cloudwalk").setCode("showPicture").setName("展示照").setType(Short.valueOf((short)4)).setStatus(ImageStoreConstants.COMMON_PROPERTIES_STATUS).setHasDefault(Integer.valueOf(1)).setHasSysAccount(Integer.valueOf(0)).setHasSysAccountAvailable(Integer.valueOf(0)).setHasRequired(Integer.valueOf(0)).setCreateTime(Long.valueOf(System.currentTimeMillis())).setCreateUserId(cloudwalkContext.getUser().getCaller()).setLastUpdateTime(Long.valueOf(System.currentTimeMillis())).setLastUpdateUserId(cloudwalkContext.getUser().getCaller()).setOrderNum(Integer.valueOf(12)).setReminder("请上传展示照").bulid();
|
||||||
this.personPropertiesMapper.insertSelective(personPropertyinit);
|
this.personPropertiesMapper.insertSelective(personPropertyinit);
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)Boolean.TRUE);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
private CloudwalkResult<Boolean> addAndUpdate(List<ImgStorePersonProperties> newList, List<ImgStorePersonProperties> listFromDB, CloudwalkCallContext context, String businessId) throws ServiceException {
|
private CloudwalkResult<Boolean> addAndUpdate(List<ImgStorePersonProperties> newList, List<ImgStorePersonProperties> listFromDB, CloudwalkCallContext context, String businessId) throws ServiceException {
|
||||||
@@ -284,7 +284,7 @@ implements ImgStorePersonPropertiesService {
|
|||||||
this.personPropertiesMapper.insertSelective(personProperties);
|
this.personPropertiesMapper.insertSelective(personProperties);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)Boolean.TRUE);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getCode(Set<String> codeSet) {
|
private String getCode(Set<String> codeSet) {
|
||||||
@@ -316,7 +316,7 @@ implements ImgStorePersonPropertiesService {
|
|||||||
}
|
}
|
||||||
EngineResult engineResult = new EngineResult();
|
EngineResult engineResult = new EngineResult();
|
||||||
engineResult.setOnline(online);
|
engineResult.setOnline(online);
|
||||||
return CloudwalkResult.success((Object)engineResult);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
@CloudwalkParamsValidate
|
@CloudwalkParamsValidate
|
||||||
@@ -328,7 +328,7 @@ implements ImgStorePersonPropertiesService {
|
|||||||
PersonPropertiesSwitch entry = (PersonPropertiesSwitch)BeanCopyUtils.copyProperties((Object)param, PersonPropertiesSwitch.class);
|
PersonPropertiesSwitch entry = (PersonPropertiesSwitch)BeanCopyUtils.copyProperties((Object)param, PersonPropertiesSwitch.class);
|
||||||
if (entry.getBackgroundParam().equals(Boolean.TRUE)) {
|
if (entry.getBackgroundParam().equals(Boolean.TRUE)) {
|
||||||
if (entry.getBackgroundObject() == null) {
|
if (entry.getBackgroundObject() == null) {
|
||||||
return CloudwalkResult.fail((String)"53004130", (String)this.getMessage("53004130"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
entry.setBackgroundObject(null);
|
entry.setBackgroundObject(null);
|
||||||
@@ -341,7 +341,7 @@ implements ImgStorePersonPropertiesService {
|
|||||||
entry.setLastUpdateTime(Long.valueOf(System.currentTimeMillis()));
|
entry.setLastUpdateTime(Long.valueOf(System.currentTimeMillis()));
|
||||||
entry.setLastUpdateUserId(caller);
|
entry.setLastUpdateUserId(caller);
|
||||||
this.personPropertiesSwitchMapper.insert(entry);
|
this.personPropertiesSwitchMapper.insert(entry);
|
||||||
return CloudwalkResult.success((Object)true);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
this.logger.error("保存注册图优化参数失败,原因:", e);
|
this.logger.error("保存注册图优化参数失败,原因:", e);
|
||||||
@@ -354,7 +354,7 @@ implements ImgStorePersonPropertiesService {
|
|||||||
try {
|
try {
|
||||||
PersonPropertiesSwitch entry = this.personPropertiesSwitchMapper.selectByBusinessId(businessId);
|
PersonPropertiesSwitch entry = this.personPropertiesSwitchMapper.selectByBusinessId(businessId);
|
||||||
PersonPropertiesSwitchResult result = ObjectUtils.isEmpty((Object)entry) ? null : (PersonPropertiesSwitchResult)BeanCopyUtils.copyProperties((Object)entry, PersonPropertiesSwitchResult.class);
|
PersonPropertiesSwitchResult result = ObjectUtils.isEmpty((Object)entry) ? null : (PersonPropertiesSwitchResult)BeanCopyUtils.copyProperties((Object)entry, PersonPropertiesSwitchResult.class);
|
||||||
return CloudwalkResult.success((Object)result);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
this.logger.error("查询注册图优化参数失败,原因:", e);
|
this.logger.error("查询注册图优化参数失败,原因:", e);
|
||||||
|
|||||||
+24
-24
@@ -234,7 +234,7 @@ implements ImgStorePersonService {
|
|||||||
String errorMessage = this.messageSource.getMessage("53014008", null, LocaleContextHolder.getLocale());
|
String errorMessage = this.messageSource.getMessage("53014008", null, LocaleContextHolder.getLocale());
|
||||||
throw new ServiceException("53014008", errorMessage);
|
throw new ServiceException("53014008", errorMessage);
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)personId);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
@CloudwalkParamsValidate
|
@CloudwalkParamsValidate
|
||||||
@@ -252,7 +252,7 @@ implements ImgStorePersonService {
|
|||||||
try {
|
try {
|
||||||
if (CollectionUtils.isEmpty((Collection)param.getLabelIds()) && CollectionUtils.isEmpty((Collection)param.getOrganizationIds())) {
|
if (CollectionUtils.isEmpty((Collection)param.getLabelIds()) && CollectionUtils.isEmpty((Collection)param.getOrganizationIds())) {
|
||||||
String errorMessage = this.messageSource.getMessage("53014020", null, LocaleContextHolder.getLocale());
|
String errorMessage = this.messageSource.getMessage("53014020", null, LocaleContextHolder.getLocale());
|
||||||
return CloudwalkResult.fail((String)"53014020", (String)errorMessage);
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
CloudwalkResult<String> checkUniqueResult = this.imgPersonHandler.checkUniqueProperty(param, context);
|
CloudwalkResult<String> checkUniqueResult = this.imgPersonHandler.checkUniqueProperty(param, context);
|
||||||
if (!checkUniqueResult.isSuccess()) {
|
if (!checkUniqueResult.isSuccess()) {
|
||||||
@@ -274,7 +274,7 @@ implements ImgStorePersonService {
|
|||||||
String errorMessage = this.messageSource.getMessage("53014008", null, LocaleContextHolder.getLocale());
|
String errorMessage = this.messageSource.getMessage("53014008", null, LocaleContextHolder.getLocale());
|
||||||
throw new ServiceException("53014008", errorMessage);
|
throw new ServiceException("53014008", errorMessage);
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)personId);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<CloudwalkPageAble<ImgStorePersonGetResult>> page(QueryImgPersonParam param, CloudwalkPageInfo page, CloudwalkCallContext context) throws ServiceException {
|
public CloudwalkResult<CloudwalkPageAble<ImgStorePersonGetResult>> page(QueryImgPersonParam param, CloudwalkPageInfo page, CloudwalkCallContext context) throws ServiceException {
|
||||||
@@ -364,7 +364,7 @@ implements ImgStorePersonService {
|
|||||||
String errorMessage = this.messageSource.getMessage("53014011", null, LocaleContextHolder.getLocale());
|
String errorMessage = this.messageSource.getMessage("53014011", null, LocaleContextHolder.getLocale());
|
||||||
throw new ServiceException("53014011", errorMessage);
|
throw new ServiceException("53014011", errorMessage);
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)pageAble);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Set<String> getOrgSet(List<ImgStorePersonGetResult> result) {
|
private Set<String> getOrgSet(List<ImgStorePersonGetResult> result) {
|
||||||
@@ -392,7 +392,7 @@ implements ImgStorePersonService {
|
|||||||
}
|
}
|
||||||
if (imgStorePersonById == null) {
|
if (imgStorePersonById == null) {
|
||||||
String errorMessage = this.messageSource.getMessage("53003819", null, LocaleContextHolder.getLocale());
|
String errorMessage = this.messageSource.getMessage("53003819", null, LocaleContextHolder.getLocale());
|
||||||
return CloudwalkResult.fail((String)"53003819", (String)errorMessage);
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
SysLog logParam = new SysLog();
|
SysLog logParam = new SysLog();
|
||||||
logParam.setLogType(Integer.valueOf(3));
|
logParam.setLogType(Integer.valueOf(3));
|
||||||
@@ -403,7 +403,7 @@ implements ImgStorePersonService {
|
|||||||
try {
|
try {
|
||||||
if (CollectionUtils.isEmpty((Collection)param.getLabelIds()) && CollectionUtils.isEmpty((Collection)param.getOrganizationIds())) {
|
if (CollectionUtils.isEmpty((Collection)param.getLabelIds()) && CollectionUtils.isEmpty((Collection)param.getOrganizationIds())) {
|
||||||
String errorMessage = this.messageSource.getMessage("53014020", null, LocaleContextHolder.getLocale());
|
String errorMessage = this.messageSource.getMessage("53014020", null, LocaleContextHolder.getLocale());
|
||||||
return CloudwalkResult.fail((String)"53014020", (String)errorMessage);
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
ImgStorePerson person = new ImgStorePerson();
|
ImgStorePerson person = new ImgStorePerson();
|
||||||
if (!StringUtils.isEmpty((CharSequence)param.getComparePicture())) {
|
if (!StringUtils.isEmpty((CharSequence)param.getComparePicture())) {
|
||||||
@@ -418,11 +418,11 @@ implements ImgStorePersonService {
|
|||||||
this.logger.info("score:{}", (Object)score);
|
this.logger.info("score:{}", (Object)score);
|
||||||
if (this.imgQualityScore > score) {
|
if (this.imgQualityScore > score) {
|
||||||
String errorMessage = "系统要求识别质量分>=" + this.imgQualityScore + ",当前识别质量分:" + score + ",请重新上传。";
|
String errorMessage = "系统要求识别质量分>=" + this.imgQualityScore + ",当前识别质量分:" + score + ",请重新上传。";
|
||||||
return CloudwalkResult.fail((String)"53003820", (String)errorMessage);
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return CloudwalkResult.fail((String)result.getCode(), (String)result.getMessage());
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BeanCopyUtils.copyProperties((Object)param, (Object)person);
|
BeanCopyUtils.copyProperties((Object)param, (Object)person);
|
||||||
@@ -480,7 +480,7 @@ implements ImgStorePersonService {
|
|||||||
String errorMessage = this.messageSource.getMessage("53014009", null, LocaleContextHolder.getLocale());
|
String errorMessage = this.messageSource.getMessage("53014009", null, LocaleContextHolder.getLocale());
|
||||||
throw new ServiceException("53014009", errorMessage);
|
throw new ServiceException("53014009", errorMessage);
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)true);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
@CloudwalkParamsValidate
|
@CloudwalkParamsValidate
|
||||||
@@ -490,7 +490,7 @@ implements ImgStorePersonService {
|
|||||||
ImgStorePerson imgStorePersonById = this.imgStorePersonMapper.selectByPrimaryKey(personId);
|
ImgStorePerson imgStorePersonById = this.imgStorePersonMapper.selectByPrimaryKey(personId);
|
||||||
if (imgStorePersonById == null) {
|
if (imgStorePersonById == null) {
|
||||||
String errorMessage = this.messageSource.getMessage("53003819", null, LocaleContextHolder.getLocale());
|
String errorMessage = this.messageSource.getMessage("53003819", null, LocaleContextHolder.getLocale());
|
||||||
return CloudwalkResult.fail((String)"53003819", (String)errorMessage);
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
String caller = context.getUser().getCaller();
|
String caller = context.getUser().getCaller();
|
||||||
try {
|
try {
|
||||||
@@ -518,7 +518,7 @@ implements ImgStorePersonService {
|
|||||||
String errorMessage = this.messageSource.getMessage("53014009", null, LocaleContextHolder.getLocale());
|
String errorMessage = this.messageSource.getMessage("53014009", null, LocaleContextHolder.getLocale());
|
||||||
throw new ServiceException("53014009", errorMessage);
|
throw new ServiceException("53014009", errorMessage);
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)true);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<ImgStorePersonGetResult> detail(DetailImgPersonParam param, CloudwalkCallContext context) throws ServiceException {
|
public CloudwalkResult<ImgStorePersonGetResult> detail(DetailImgPersonParam param, CloudwalkCallContext context) throws ServiceException {
|
||||||
@@ -582,7 +582,7 @@ implements ImgStorePersonService {
|
|||||||
String errorMessage = this.messageSource.getMessage("53014011", null, LocaleContextHolder.getLocale());
|
String errorMessage = this.messageSource.getMessage("53014011", null, LocaleContextHolder.getLocale());
|
||||||
throw new ServiceException("53014011", errorMessage);
|
throw new ServiceException("53014011", errorMessage);
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success(result);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<List<ImgStorePersonGetResult>> listPerson(QueryImgPersonParam param, CloudwalkCallContext context) throws ServiceException {
|
public CloudwalkResult<List<ImgStorePersonGetResult>> listPerson(QueryImgPersonParam param, CloudwalkCallContext context) throws ServiceException {
|
||||||
@@ -692,7 +692,7 @@ implements ImgStorePersonService {
|
|||||||
personResult.setFloorNames(zoneNames);
|
personResult.setFloorNames(zoneNames);
|
||||||
personResult.setFloorList(floorList);
|
personResult.setFloorList(floorList);
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success(imgStorePersonResults);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
this.logger.error("执行报错 {}: {}", (Object)e.getClass().getName(), (Object)e.getMessage());
|
this.logger.error("执行报错 {}: {}", (Object)e.getClass().getName(), (Object)e.getMessage());
|
||||||
@@ -755,7 +755,7 @@ implements ImgStorePersonService {
|
|||||||
String errorMessage = this.messageSource.getMessage("53014010", null, LocaleContextHolder.getLocale());
|
String errorMessage = this.messageSource.getMessage("53014010", null, LocaleContextHolder.getLocale());
|
||||||
throw new ServiceException("53014010", errorMessage);
|
throw new ServiceException("53014010", errorMessage);
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)true);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<ImgStorePersonGetResult> getImgStorePersonResults(List<ImgStorePerson> storePersonList, String businessId) {
|
private List<ImgStorePersonGetResult> getImgStorePersonResults(List<ImgStorePerson> storePersonList, String businessId) {
|
||||||
@@ -1052,10 +1052,10 @@ implements ImgStorePersonService {
|
|||||||
dto.setPhone(param.getPhone());
|
dto.setPhone(param.getPhone());
|
||||||
dto.setUserName(param.getUserName());
|
dto.setUserName(param.getUserName());
|
||||||
List imgStorePeople = this.imgStorePersonMapper.getByUniqueCondition(dto);
|
List imgStorePeople = this.imgStorePersonMapper.getByUniqueCondition(dto);
|
||||||
return CloudwalkResult.success((Object)BeanCopyUtils.copy((Collection)imgStorePeople, ImgStorePersonResult.class));
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
return CloudwalkResult.fail((String)"53014011", (String)this.messageSource.getMessage("53014011", null, LocaleContextHolder.getLocale()));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1074,9 +1074,9 @@ implements ImgStorePersonService {
|
|||||||
batchImport.setLoginName(context.getUser().getCallerName());
|
batchImport.setLoginName(context.getUser().getCallerName());
|
||||||
int count = this.batchImportMapper.insert(batchImport);
|
int count = this.batchImportMapper.insert(batchImport);
|
||||||
if (count < 1) {
|
if (count < 1) {
|
||||||
return CloudwalkResult.fail((String)"53014035", (String)this.messageSource.getMessage("53014035", null, LocaleContextHolder.getLocale()));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)true);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<List<UserAccountCheckResult>> syncAccountCheck(QueryImgPersonParam param, CloudwalkCallContext context) {
|
public CloudwalkResult<List<UserAccountCheckResult>> syncAccountCheck(QueryImgPersonParam param, CloudwalkCallContext context) {
|
||||||
@@ -1085,10 +1085,10 @@ implements ImgStorePersonService {
|
|||||||
BeanUtils.copyProperties((Object)param, (Object)dto);
|
BeanUtils.copyProperties((Object)param, (Object)dto);
|
||||||
List personAccountResult = this.imgStorePersonMapper.SyncAccountCheck(dto);
|
List personAccountResult = this.imgStorePersonMapper.SyncAccountCheck(dto);
|
||||||
List userAccountCheckResults = BeanCopyUtils.copy((Collection)personAccountResult, UserAccountCheckResult.class);
|
List userAccountCheckResults = BeanCopyUtils.copy((Collection)personAccountResult, UserAccountCheckResult.class);
|
||||||
return CloudwalkResult.success((Object)userAccountCheckResults);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
catch (BeansException e) {
|
catch (BeansException e) {
|
||||||
return CloudwalkResult.fail((String)"53014011", (String)this.messageSource.getMessage("53014011", null, LocaleContextHolder.getLocale()));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1097,12 +1097,12 @@ implements ImgStorePersonService {
|
|||||||
ImgStorePerson imgStorePerson = this.imgStorePersonMapper.selectByPrimaryKey(param.getPersonId());
|
ImgStorePerson imgStorePerson = this.imgStorePersonMapper.selectByPrimaryKey(param.getPersonId());
|
||||||
if (imgStorePerson == null || !imgStorePerson.getBusinessId().equals(businessId)) {
|
if (imgStorePerson == null || !imgStorePerson.getBusinessId().equals(businessId)) {
|
||||||
String errorMessage = this.messageSource.getMessage("53003819", null, LocaleContextHolder.getLocale());
|
String errorMessage = this.messageSource.getMessage("53003819", null, LocaleContextHolder.getLocale());
|
||||||
return CloudwalkResult.fail((String)"53003819", (String)errorMessage);
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
imgStorePerson.setCreateSysAccount(Short.valueOf((short)1));
|
imgStorePerson.setCreateSysAccount(Short.valueOf((short)1));
|
||||||
imgStorePerson.setSysAccountId(param.getSysAccountId());
|
imgStorePerson.setSysAccountId(param.getSysAccountId());
|
||||||
this.imgStorePersonMapper.updateByPrimaryKey(imgStorePerson);
|
this.imgStorePersonMapper.updateByPrimaryKey(imgStorePerson);
|
||||||
return CloudwalkResult.success((Object)true);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<Boolean> syncAccountUnbind(SyncAccountParam param, CloudwalkCallContext context) {
|
public CloudwalkResult<Boolean> syncAccountUnbind(SyncAccountParam param, CloudwalkCallContext context) {
|
||||||
@@ -1110,12 +1110,12 @@ implements ImgStorePersonService {
|
|||||||
ImgStorePerson imgStorePerson = this.imgStorePersonMapper.selectByPrimaryKey(param.getPersonId());
|
ImgStorePerson imgStorePerson = this.imgStorePersonMapper.selectByPrimaryKey(param.getPersonId());
|
||||||
if (imgStorePerson == null || !imgStorePerson.getBusinessId().equals(businessId)) {
|
if (imgStorePerson == null || !imgStorePerson.getBusinessId().equals(businessId)) {
|
||||||
String errorMessage = this.messageSource.getMessage("53003819", null, LocaleContextHolder.getLocale());
|
String errorMessage = this.messageSource.getMessage("53003819", null, LocaleContextHolder.getLocale());
|
||||||
return CloudwalkResult.fail((String)"53003819", (String)errorMessage);
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
imgStorePerson.setCreateSysAccount(Short.valueOf((short)0));
|
imgStorePerson.setCreateSysAccount(Short.valueOf((short)0));
|
||||||
imgStorePerson.setSysAccountId(null);
|
imgStorePerson.setSysAccountId(null);
|
||||||
this.imgStorePersonMapper.updateByPrimaryKey(imgStorePerson);
|
this.imgStorePersonMapper.updateByPrimaryKey(imgStorePerson);
|
||||||
return CloudwalkResult.success((Object)true);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void saveSysLog(SysLog param, CloudwalkCallContext context) {
|
private void saveSysLog(SysLog param, CloudwalkCallContext context) {
|
||||||
|
|||||||
+22
-22
@@ -103,11 +103,11 @@ implements LabelService {
|
|||||||
Short addType = ObjectUtils.isEmpty((Object)addLabelParam.getAddType()) ? (short)0 : addLabelParam.getAddType();
|
Short addType = ObjectUtils.isEmpty((Object)addLabelParam.getAddType()) ? (short)0 : addLabelParam.getAddType();
|
||||||
Integer count = this.imgStoreLabelMapper.countByName(addLabelParam.getName(), businessId);
|
Integer count = this.imgStoreLabelMapper.countByName(addLabelParam.getName(), businessId);
|
||||||
if (count != null && count != 0) {
|
if (count != null && count != 0) {
|
||||||
return CloudwalkResult.fail((String)"53003700", (String)this.getMessage("53003700"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
String code = addLabelParam.getCode();
|
String code = addLabelParam.getCode();
|
||||||
if (StringUtils.isNotBlank((CharSequence)code) && (count = this.imgStoreLabelMapper.countByCode(code, businessId)) != null && count != 0) {
|
if (StringUtils.isNotBlank((CharSequence)code) && (count = this.imgStoreLabelMapper.countByCode(code, businessId)) != null && count != 0) {
|
||||||
return CloudwalkResult.fail((String)"53003705", (String)this.getMessage("53003705"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
Label label = new Label();
|
Label label = new Label();
|
||||||
long time = System.currentTimeMillis();
|
long time = System.currentTimeMillis();
|
||||||
@@ -129,7 +129,7 @@ implements LabelService {
|
|||||||
logParam.setRemark(OperationLogEnum.LABEL_ADD.getName() + "-" + label.getName());
|
logParam.setRemark(OperationLogEnum.LABEL_ADD.getName() + "-" + label.getName());
|
||||||
this.saveSysLog(logParam, context);
|
this.saveSysLog(logParam, context);
|
||||||
this.imgStoreLabelMapper.insertSelective(label);
|
this.imgStoreLabelMapper.insertSelective(label);
|
||||||
return CloudwalkResult.success((Object)label.getId());
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
@CloudwalkParamsValidate
|
@CloudwalkParamsValidate
|
||||||
@@ -141,17 +141,17 @@ implements LabelService {
|
|||||||
getsLabelDTO.setBusinessId(businessId);
|
getsLabelDTO.setBusinessId(businessId);
|
||||||
List labelList = this.imgStoreLabelMapper.gets(getsLabelDTO);
|
List labelList = this.imgStoreLabelMapper.gets(getsLabelDTO);
|
||||||
if (labelList.size() == 0) {
|
if (labelList.size() == 0) {
|
||||||
return CloudwalkResult.fail((String)"53003701", (String)this.getMessage("53003701"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
Label old = (Label)labelList.get(0);
|
Label old = (Label)labelList.get(0);
|
||||||
Label newLabel = new Label();
|
Label newLabel = new Label();
|
||||||
if (StringUtils.isEmpty((CharSequence)param.getName())) {
|
if (StringUtils.isEmpty((CharSequence)param.getName())) {
|
||||||
return CloudwalkResult.success((Object)Boolean.TRUE);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
List labels = this.imgStoreLabelMapper.getLabelByName(param.getName(), businessId);
|
List labels = this.imgStoreLabelMapper.getLabelByName(param.getName(), businessId);
|
||||||
for (Label label : labels) {
|
for (Label label : labels) {
|
||||||
if (label.getId().equals(param.getId())) continue;
|
if (label.getId().equals(param.getId())) continue;
|
||||||
return CloudwalkResult.fail((String)"53003700", (String)this.getMessage("53003700"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
newLabel.setLastUpdateTime(Long.valueOf(System.currentTimeMillis()));
|
newLabel.setLastUpdateTime(Long.valueOf(System.currentTimeMillis()));
|
||||||
newLabel.setLastUpdateUserId(context.getUser().getCaller());
|
newLabel.setLastUpdateUserId(context.getUser().getCaller());
|
||||||
@@ -163,7 +163,7 @@ implements LabelService {
|
|||||||
logParam.setRemark(OperationLogEnum.LABEL_EDIT.getName() + "-" + param.getName());
|
logParam.setRemark(OperationLogEnum.LABEL_EDIT.getName() + "-" + param.getName());
|
||||||
this.saveSysLog(logParam, context);
|
this.saveSysLog(logParam, context);
|
||||||
this.imgStoreLabelMapper.updateByPrimaryKeySelective(newLabel);
|
this.imgStoreLabelMapper.updateByPrimaryKeySelective(newLabel);
|
||||||
return CloudwalkResult.success((Object)Boolean.TRUE);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
@CloudwalkParamsValidate
|
@CloudwalkParamsValidate
|
||||||
@@ -171,7 +171,7 @@ implements LabelService {
|
|||||||
String businessId = StringUtils.isEmpty((CharSequence)delLabelParam.getBusinessId()) ? context.getCompany().getCompanyId() : delLabelParam.getBusinessId();
|
String businessId = StringUtils.isEmpty((CharSequence)delLabelParam.getBusinessId()) ? context.getCompany().getCompanyId() : delLabelParam.getBusinessId();
|
||||||
Set personIdsByLabelIds = this.imgStorePersonLabelMapper.getPersonIdsByLabelIds(Collections.singletonList(delLabelParam.getId()));
|
Set personIdsByLabelIds = this.imgStorePersonLabelMapper.getPersonIdsByLabelIds(Collections.singletonList(delLabelParam.getId()));
|
||||||
if (!CollectionUtils.isEmpty((Collection)personIdsByLabelIds)) {
|
if (!CollectionUtils.isEmpty((Collection)personIdsByLabelIds)) {
|
||||||
return CloudwalkResult.fail((String)"53003707", (String)this.getMessage("53003707"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
GetsLabelDTO getsLabelDTO = new GetsLabelDTO();
|
GetsLabelDTO getsLabelDTO = new GetsLabelDTO();
|
||||||
getsLabelDTO.setId(delLabelParam.getId());
|
getsLabelDTO.setId(delLabelParam.getId());
|
||||||
@@ -179,7 +179,7 @@ implements LabelService {
|
|||||||
getsLabelDTO.setBusinessId(businessId);
|
getsLabelDTO.setBusinessId(businessId);
|
||||||
List labelList = this.imgStoreLabelMapper.gets(getsLabelDTO);
|
List labelList = this.imgStoreLabelMapper.gets(getsLabelDTO);
|
||||||
if (labelList.size() == 0) {
|
if (labelList.size() == 0) {
|
||||||
return CloudwalkResult.fail((String)"53003701", (String)this.getMessage("53003701"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
Label label = (Label)labelList.get(0);
|
Label label = (Label)labelList.get(0);
|
||||||
label.setIsDel(Short.valueOf((short)1));
|
label.setIsDel(Short.valueOf((short)1));
|
||||||
@@ -193,7 +193,7 @@ implements LabelService {
|
|||||||
logParam.setRemark(OperationLogEnum.LABEL_DELETE.getName() + "-" + ((Label)labelList.get(0)).getName());
|
logParam.setRemark(OperationLogEnum.LABEL_DELETE.getName() + "-" + ((Label)labelList.get(0)).getName());
|
||||||
this.saveSysLog(logParam, context);
|
this.saveSysLog(logParam, context);
|
||||||
this.imgStorePersonLabelMapper.delete(del);
|
this.imgStorePersonLabelMapper.delete(del);
|
||||||
return CloudwalkResult.success((Object)Boolean.TRUE);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<CloudwalkPageAble<PageLabelResult>> page(PageLabelParam pageLabelParam, CloudwalkCallContext context) {
|
public CloudwalkResult<CloudwalkPageAble<PageLabelResult>> page(PageLabelParam pageLabelParam, CloudwalkCallContext context) {
|
||||||
@@ -210,7 +210,7 @@ implements LabelService {
|
|||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
this.logger.error("分页查询异常,e:{}", (Object)e.getMessage());
|
this.logger.error("分页查询异常,e:{}", (Object)e.getMessage());
|
||||||
return CloudwalkResult.fail((String)"53003702", (String)this.getMessage("53003702"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
List res = BeanCopyUtils.copy((Collection)ret.getResult(), PageLabelResult.class);
|
List res = BeanCopyUtils.copy((Collection)ret.getResult(), PageLabelResult.class);
|
||||||
ArrayList<String> labelIds = new ArrayList<String>();
|
ArrayList<String> labelIds = new ArrayList<String>();
|
||||||
@@ -237,7 +237,7 @@ implements LabelService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
pageAble = new CloudwalkPageAble((Collection)res, page, ret.getTotal());
|
pageAble = new CloudwalkPageAble((Collection)res, page, ret.getTotal());
|
||||||
return CloudwalkResult.success((Object)pageAble);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<List<PageLabelResult>> listByPage(PageLabelParam param, CloudwalkCallContext context) throws ServiceException {
|
public CloudwalkResult<List<PageLabelResult>> listByPage(PageLabelParam param, CloudwalkCallContext context) throws ServiceException {
|
||||||
@@ -322,7 +322,7 @@ implements LabelService {
|
|||||||
pageLabelResult.setFloorNames(zoneNames);
|
pageLabelResult.setFloorNames(zoneNames);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)res);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
this.logger.error("执行报错 {}: {}", (Object)e.getClass().getName(), (Object)e.getMessage());
|
this.logger.error("执行报错 {}: {}", (Object)e.getClass().getName(), (Object)e.getMessage());
|
||||||
@@ -335,7 +335,7 @@ implements LabelService {
|
|||||||
pageLabelDTO.setBusinessId(StringUtils.isEmpty((CharSequence)param.getBusinessId()) ? context.getCompany().getCompanyId() : param.getBusinessId());
|
pageLabelDTO.setBusinessId(StringUtils.isEmpty((CharSequence)param.getBusinessId()) ? context.getCompany().getCompanyId() : param.getBusinessId());
|
||||||
List allLabels = this.imgStoreLabelMapper.getAllLabels(pageLabelDTO);
|
List allLabels = this.imgStoreLabelMapper.getAllLabels(pageLabelDTO);
|
||||||
List labelResults = BeanCopyUtils.copy((Collection)allLabels, LabelResult.class);
|
List labelResults = BeanCopyUtils.copy((Collection)allLabels, LabelResult.class);
|
||||||
return CloudwalkResult.success((Object)labelResults);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
@CloudwalkParamsValidate
|
@CloudwalkParamsValidate
|
||||||
@@ -343,10 +343,10 @@ implements LabelService {
|
|||||||
String businessId = StringUtils.isEmpty((CharSequence)personParam.getBusinessId()) ? context.getCompany().getCompanyId() : personParam.getBusinessId();
|
String businessId = StringUtils.isEmpty((CharSequence)personParam.getBusinessId()) ? context.getCompany().getCompanyId() : personParam.getBusinessId();
|
||||||
Label lab = this.imgStoreLabelMapper.selectByPrimaryKey(personParam.getLabelId());
|
Label lab = this.imgStoreLabelMapper.selectByPrimaryKey(personParam.getLabelId());
|
||||||
if (lab == null || lab.getIsDel() == 1 || !businessId.equals(lab.getBusinessId())) {
|
if (lab == null || lab.getIsDel() == 1 || !businessId.equals(lab.getBusinessId())) {
|
||||||
return CloudwalkResult.fail((String)"53003701", (String)this.getMessage("53003701"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
if (personParam.getPersonIds() == null || personParam.getPersonIds().size() == 0) {
|
if (personParam.getPersonIds() == null || personParam.getPersonIds().size() == 0) {
|
||||||
return CloudwalkResult.fail((String)"53060411", (String)this.getMessage("53060411"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
SysLog logParam = new SysLog();
|
SysLog logParam = new SysLog();
|
||||||
logParam.setLogType(Integer.valueOf(5));
|
logParam.setLogType(Integer.valueOf(5));
|
||||||
@@ -357,14 +357,14 @@ implements LabelService {
|
|||||||
personParam.getPersonIds().removeAll(personIds);
|
personParam.getPersonIds().removeAll(personIds);
|
||||||
}
|
}
|
||||||
if (personParam.getPersonIds().size() == 0) {
|
if (personParam.getPersonIds().size() == 0) {
|
||||||
return CloudwalkResult.success((Object)Boolean.TRUE);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
ImgStorePersonQueryDto dto = new ImgStorePersonQueryDto();
|
ImgStorePersonQueryDto dto = new ImgStorePersonQueryDto();
|
||||||
dto.setIds((Collection)personParam.getPersonIds());
|
dto.setIds((Collection)personParam.getPersonIds());
|
||||||
dto.setBusinessId(businessId);
|
dto.setBusinessId(businessId);
|
||||||
dto.setIsDel(DelStatusEnum.NORAML.getCode());
|
dto.setIsDel(DelStatusEnum.NORAML.getCode());
|
||||||
if (this.personMapper.gets(dto).size() != personParam.getPersonIds().size()) {
|
if (this.personMapper.gets(dto).size() != personParam.getPersonIds().size()) {
|
||||||
return CloudwalkResult.fail((String)"53003311", (String)this.getMessage("53003311"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
ArrayList<ImgStorePersonLabel> labels = new ArrayList<ImgStorePersonLabel>();
|
ArrayList<ImgStorePersonLabel> labels = new ArrayList<ImgStorePersonLabel>();
|
||||||
long time = System.currentTimeMillis();
|
long time = System.currentTimeMillis();
|
||||||
@@ -388,7 +388,7 @@ implements LabelService {
|
|||||||
if (Collections3.isNotEmpty(imageIdResultList)) {
|
if (Collections3.isNotEmpty(imageIdResultList)) {
|
||||||
imageIdResultList.parallelStream().forEach(imageId -> this.cpImageStorePersonSynManager.handleGroupPersonSynTask((String)imageId));
|
imageIdResultList.parallelStream().forEach(imageId -> this.cpImageStorePersonSynManager.handleGroupPersonSynTask((String)imageId));
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)Boolean.TRUE);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
@CloudwalkParamsValidate
|
@CloudwalkParamsValidate
|
||||||
@@ -398,7 +398,7 @@ implements LabelService {
|
|||||||
getsLabelDTO.setBusinessId(StringUtils.isEmpty((CharSequence)param.getBusinessId()) ? context.getCompany().getCompanyId() : param.getBusinessId());
|
getsLabelDTO.setBusinessId(StringUtils.isEmpty((CharSequence)param.getBusinessId()) ? context.getCompany().getCompanyId() : param.getBusinessId());
|
||||||
List labelList = this.imgStoreLabelMapper.gets(getsLabelDTO);
|
List labelList = this.imgStoreLabelMapper.gets(getsLabelDTO);
|
||||||
if (labelList.size() == 0) {
|
if (labelList.size() == 0) {
|
||||||
return CloudwalkResult.fail((String)"53003701", (String)this.getMessage("53003701"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
if (param.getPersonIds() != null && param.getPersonIds().size() > 0) {
|
if (param.getPersonIds() != null && param.getPersonIds().size() > 0) {
|
||||||
SysLog logParam = new SysLog();
|
SysLog logParam = new SysLog();
|
||||||
@@ -415,7 +415,7 @@ implements LabelService {
|
|||||||
imageIdResultList.parallelStream().forEach(imageId -> this.cpImageStorePersonSynManager.handleGroupPersonSynTask((String)imageId));
|
imageIdResultList.parallelStream().forEach(imageId -> this.cpImageStorePersonSynManager.handleGroupPersonSynTask((String)imageId));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)Boolean.TRUE);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<LabelResult> detail(PageLabelParam param, CloudwalkCallContext context) {
|
public CloudwalkResult<LabelResult> detail(PageLabelParam param, CloudwalkCallContext context) {
|
||||||
@@ -430,7 +430,7 @@ implements LabelService {
|
|||||||
Label label = (Label)labelList.get(0);
|
Label label = (Label)labelList.get(0);
|
||||||
labelResult = (LabelResult)BeanCopyUtils.copyProperties((Object)label, LabelResult.class);
|
labelResult = (LabelResult)BeanCopyUtils.copyProperties((Object)label, LabelResult.class);
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success(labelResult);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void saveSysLog(SysLog param, CloudwalkCallContext context) {
|
private void saveSysLog(SysLog param, CloudwalkCallContext context) {
|
||||||
|
|||||||
+2
-2
@@ -29,7 +29,7 @@ implements IOperationLogService {
|
|||||||
this.logger.error("操作日志新增失败,原因:", e);
|
this.logger.error("操作日志新增失败,原因:", e);
|
||||||
throw new ServiceException(e);
|
throw new ServiceException(e);
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)true);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<Boolean> delete(OperationLogDelParam param, CloudwalkCallContext context) throws ServiceException {
|
public CloudwalkResult<Boolean> delete(OperationLogDelParam param, CloudwalkCallContext context) throws ServiceException {
|
||||||
@@ -40,7 +40,7 @@ implements IOperationLogService {
|
|||||||
this.logger.error("操作日志删除失败,原因:", e);
|
this.logger.error("操作日志删除失败,原因:", e);
|
||||||
throw new ServiceException(e);
|
throw new ServiceException(e);
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)true);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+49
-49
@@ -151,17 +151,17 @@ implements OrganizationService {
|
|||||||
getsOrganizationDTO.setId(param.getParentId());
|
getsOrganizationDTO.setId(param.getParentId());
|
||||||
List list = this.imgStoreOrganizationMapper.gets(getsOrganizationDTO);
|
List list = this.imgStoreOrganizationMapper.gets(getsOrganizationDTO);
|
||||||
if (CollectionUtils.isEmpty((Collection)list)) {
|
if (CollectionUtils.isEmpty((Collection)list)) {
|
||||||
return CloudwalkResult.fail((String)"53003307", (String)this.getMessage("53003307"));
|
return (CloudwalkResult)CloudwalkResult.fail((String)"53003307", (String)this.getMessage("53003307"));
|
||||||
}
|
}
|
||||||
Organization organization = (Organization)list.get(0);
|
Organization organization = (Organization)list.get(0);
|
||||||
OrganizationType organizationType = this.imgStoreOrganizationTypeMapper.selectByPrimaryKey(organization.getTypeId());
|
OrganizationType organizationType = this.imgStoreOrganizationTypeMapper.selectByPrimaryKey(organization.getTypeId());
|
||||||
if (organizationType != null && organizationType.getHasLowerLevel() != 1) {
|
if (organizationType != null && organizationType.getHasLowerLevel() != 1) {
|
||||||
return CloudwalkResult.fail((String)"53003306", (String)this.getMessage("53003306"));
|
return (CloudwalkResult)CloudwalkResult.fail((String)"53003306", (String)this.getMessage("53003306"));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
List parent = this.imgStoreOrganizationMapper.getParentNode(businessId);
|
List parent = this.imgStoreOrganizationMapper.getParentNode(businessId);
|
||||||
if (!CollectionUtils.isEmpty((Collection)parent)) {
|
if (!CollectionUtils.isEmpty((Collection)parent)) {
|
||||||
return CloudwalkResult.fail((String)"53003314", (String)this.getMessage("53003314"));
|
return (CloudwalkResult)CloudwalkResult.fail((String)"53003314", (String)this.getMessage("53003314"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
getsOrganizationDTO.setId(null);
|
getsOrganizationDTO.setId(null);
|
||||||
@@ -169,7 +169,7 @@ implements OrganizationService {
|
|||||||
getsOrganizationDTO.setParentId(param.getParentId());
|
getsOrganizationDTO.setParentId(param.getParentId());
|
||||||
List names = this.imgStoreOrganizationMapper.gets(getsOrganizationDTO);
|
List names = this.imgStoreOrganizationMapper.gets(getsOrganizationDTO);
|
||||||
if (!CollectionUtils.isEmpty((Collection)names)) {
|
if (!CollectionUtils.isEmpty((Collection)names)) {
|
||||||
return CloudwalkResult.fail((String)"53003316", (String)this.getMessage("53003316"));
|
return (CloudwalkResult)CloudwalkResult.fail((String)"53003316", (String)this.getMessage("53003316"));
|
||||||
}
|
}
|
||||||
long time = System.currentTimeMillis();
|
long time = System.currentTimeMillis();
|
||||||
Organization organization = (Organization)BeanCopyUtils.copyProperties((Object)param, Organization.class);
|
Organization organization = (Organization)BeanCopyUtils.copyProperties((Object)param, Organization.class);
|
||||||
@@ -193,7 +193,7 @@ implements OrganizationService {
|
|||||||
addUnitZoneRefForm.setUnitName(organization.getName());
|
addUnitZoneRefForm.setUnitName(organization.getName());
|
||||||
addUnitZoneRefForm.setZoneIds(param.getZoneIds());
|
addUnitZoneRefForm.setZoneIds(param.getZoneIds());
|
||||||
this.zoneFeignClient.addUnitRef(addUnitZoneRefForm);
|
this.zoneFeignClient.addUnitRef(addUnitZoneRefForm);
|
||||||
return CloudwalkResult.success((Object)organization.getId());
|
return (CloudwalkResult)CloudwalkResult.success(organization.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@CloudwalkParamsValidate
|
@CloudwalkParamsValidate
|
||||||
@@ -203,11 +203,11 @@ implements OrganizationService {
|
|||||||
getsOrganizationDTO.setId(param.getId());
|
getsOrganizationDTO.setId(param.getId());
|
||||||
getsOrganizationDTO.setBusinessId(businessId);
|
getsOrganizationDTO.setBusinessId(businessId);
|
||||||
getsOrganizationDTO.setIsDel(Short.valueOf((short)0));
|
getsOrganizationDTO.setIsDel(Short.valueOf((short)0));
|
||||||
List organizationList = this.imgStoreOrganizationMapper.gets(getsOrganizationDTO);
|
List<Organization> organizationList = this.imgStoreOrganizationMapper.gets(getsOrganizationDTO);
|
||||||
if (CollectionUtils.isEmpty((Collection)organizationList)) {
|
if (CollectionUtils.isEmpty((Collection)organizationList)) {
|
||||||
return CloudwalkResult.fail((String)"53003310", (String)this.getMessage("53003310"));
|
return (CloudwalkResult)CloudwalkResult.fail((String)"53003310", (String)this.getMessage("53003310"));
|
||||||
}
|
}
|
||||||
List res = null;
|
List<TreeOrganizationResult> res = null;
|
||||||
Organization old = (Organization)organizationList.get(0);
|
Organization old = (Organization)organizationList.get(0);
|
||||||
Organization edit = (Organization)BeanCopyUtils.copyProperties((Object)param, Organization.class);
|
Organization edit = (Organization)BeanCopyUtils.copyProperties((Object)param, Organization.class);
|
||||||
edit.setId(old.getId());
|
edit.setId(old.getId());
|
||||||
@@ -216,7 +216,7 @@ implements OrganizationService {
|
|||||||
res = this.judgeNodeLevel(param, businessId);
|
res = this.judgeNodeLevel(param, businessId);
|
||||||
}
|
}
|
||||||
catch (ServiceException e) {
|
catch (ServiceException e) {
|
||||||
return CloudwalkResult.fail((String)e.getCode(), (String)e.getMessage());
|
return (CloudwalkResult)CloudwalkResult.fail((String)e.getCode(), (String)e.getMessage());
|
||||||
}
|
}
|
||||||
edit.setParentId(param.getParentId());
|
edit.setParentId(param.getParentId());
|
||||||
}
|
}
|
||||||
@@ -226,7 +226,7 @@ implements OrganizationService {
|
|||||||
}
|
}
|
||||||
for (TreeOrganizationResult org : res) {
|
for (TreeOrganizationResult org : res) {
|
||||||
if (!org.getName().equals(param.getName()) || org.getId().equals(param.getId()) || !org.getParentId().equals(param.getParentId())) continue;
|
if (!org.getName().equals(param.getName()) || org.getId().equals(param.getId()) || !org.getParentId().equals(param.getParentId())) continue;
|
||||||
return CloudwalkResult.fail((String)"53003316", (String)this.getMessage("53003316"));
|
return (CloudwalkResult)CloudwalkResult.fail((String)"53003316", (String)this.getMessage("53003316"));
|
||||||
}
|
}
|
||||||
edit.setName(param.getName());
|
edit.setName(param.getName());
|
||||||
}
|
}
|
||||||
@@ -248,19 +248,19 @@ implements OrganizationService {
|
|||||||
if (param.getOfficeArea() != null || param.getPassableArea() != null) {
|
if (param.getOfficeArea() != null || param.getPassableArea() != null) {
|
||||||
this.saveAreaDetails(param, businessId);
|
this.saveAreaDetails(param, businessId);
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)Boolean.TRUE);
|
return (CloudwalkResult)CloudwalkResult.success(Boolean.TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@CloudwalkParamsValidate
|
@CloudwalkParamsValidate
|
||||||
public CloudwalkResult<Boolean> delete(DelOrganizationParam param, CloudwalkCallContext context) {
|
public CloudwalkResult<Boolean> delete(DelOrganizationParam param, CloudwalkCallContext context) {
|
||||||
String businessId = StringUtils.isNotBlank((CharSequence)param.getBusinessId()) ? param.getBusinessId() : context.getCompany().getCompanyId();
|
String businessId = StringUtils.isNotBlank((CharSequence)param.getBusinessId()) ? param.getBusinessId() : context.getCompany().getCompanyId();
|
||||||
if (!CollectionUtils.isEmpty((Collection)param.getIds())) {
|
if (!CollectionUtils.isEmpty((Collection)param.getIds())) {
|
||||||
List orgByIds = this.imgStoreOrganizationMapper.getOrgByIds(param.getIds(), businessId);
|
List<Organization> orgByIds = this.imgStoreOrganizationMapper.getOrgByIds(param.getIds(), businessId);
|
||||||
if (orgByIds.size() != param.getIds().size()) {
|
if (orgByIds.size() != param.getIds().size()) {
|
||||||
return CloudwalkResult.fail((String)"53060411", (String)this.getMessage("53060411"));
|
return (CloudwalkResult)CloudwalkResult.fail((String)"53060411", (String)this.getMessage("53060411"));
|
||||||
}
|
}
|
||||||
if (!CollectionUtils.isEmpty((Collection)this.imgStoreOrganizationMapper.getParentIdIsNull(param.getIds()))) {
|
if (!CollectionUtils.isEmpty((Collection)this.imgStoreOrganizationMapper.getParentIdIsNull(param.getIds()))) {
|
||||||
return CloudwalkResult.fail((String)"53003313", (String)this.getMessage("53003313"));
|
return (CloudwalkResult)CloudwalkResult.fail((String)"53003313", (String)this.getMessage("53003313"));
|
||||||
}
|
}
|
||||||
String delName = ((Organization)orgByIds.get(0)).getName();
|
String delName = ((Organization)orgByIds.get(0)).getName();
|
||||||
if (orgByIds.size() > 1) {
|
if (orgByIds.size() > 1) {
|
||||||
@@ -282,7 +282,7 @@ implements OrganizationService {
|
|||||||
CloudwalkResult<Boolean> data = this.zoneFeignClient.delUnit(delUnitZoneForm);
|
CloudwalkResult<Boolean> data = this.zoneFeignClient.delUnit(delUnitZoneForm);
|
||||||
this.logger.info("删除关联机构{}", data.getData());
|
this.logger.info("删除关联机构{}", data.getData());
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)Boolean.TRUE);
|
return (CloudwalkResult)CloudwalkResult.success(Boolean.TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
private UserQueryResult getByUserId(String userId, CloudwalkCallContext context) throws ServiceException {
|
private UserQueryResult getByUserId(String userId, CloudwalkCallContext context) throws ServiceException {
|
||||||
@@ -319,14 +319,14 @@ implements OrganizationService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success(new ArrayList(orgAllIds));
|
return (CloudwalkResult)CloudwalkResult.success(new ArrayList(orgAllIds));
|
||||||
}
|
}
|
||||||
return CloudwalkResult.fail((String)"00000001", (String)this.getMessage("00000001"));
|
return (CloudwalkResult)CloudwalkResult.fail((String)"00000001", (String)this.getMessage("00000001"));
|
||||||
}
|
}
|
||||||
catch (ServiceException e) {
|
catch (ServiceException e) {
|
||||||
String errorMessage = this.messageSource.getMessage(e.getCode(), null, LocaleContextHolder.getLocale());
|
String errorMessage = this.messageSource.getMessage(e.getCode(), null, LocaleContextHolder.getLocale());
|
||||||
this.logger.error("通过登录用户查询机构:{},{}", (Object)e.getCode(), (Object)errorMessage);
|
this.logger.error("通过登录用户查询机构:{},{}", (Object)e.getCode(), (Object)errorMessage);
|
||||||
return CloudwalkResult.fail((String)e.getCode(), (String)errorMessage);
|
return (CloudwalkResult)CloudwalkResult.fail((String)e.getCode(), (String)errorMessage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -337,7 +337,7 @@ implements OrganizationService {
|
|||||||
if (StringUtils.isBlank((CharSequence)param.getParentId())) {
|
if (StringUtils.isBlank((CharSequence)param.getParentId())) {
|
||||||
List allOrg = this.imgStoreOrganizationMapper.getAllOrg(businessId);
|
List allOrg = this.imgStoreOrganizationMapper.getAllOrg(businessId);
|
||||||
res = BeanCopyUtils.copy((Collection)allOrg, TreeOrganizationResult.class);
|
res = BeanCopyUtils.copy((Collection)allOrg, TreeOrganizationResult.class);
|
||||||
res = res.stream().filter(ToolUtil.distinctByKey(TreeOrganizationResult::getId)).collect(Collectors.toList());
|
res = (java.util.List) res.stream().filter(ToolUtil.distinctByKey(TreeOrganizationResult::getId)).collect(Collectors.toList());
|
||||||
} else {
|
} else {
|
||||||
res = this.getTreeByParentId(param.getParentId(), businessId);
|
res = this.getTreeByParentId(param.getParentId(), businessId);
|
||||||
}
|
}
|
||||||
@@ -358,7 +358,7 @@ implements OrganizationService {
|
|||||||
tree.add(nodeX);
|
tree.add(nodeX);
|
||||||
}
|
}
|
||||||
this.addLevel(tree, 1);
|
this.addLevel(tree, 1);
|
||||||
return CloudwalkResult.success(tree);
|
return (CloudwalkResult)CloudwalkResult.success(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<TreeOrganizationResult> getTreeByParentId(String parentId, String businessId) {
|
private List<TreeOrganizationResult> getTreeByParentId(String parentId, String businessId) {
|
||||||
@@ -384,7 +384,7 @@ implements OrganizationService {
|
|||||||
ArrayList<Organization> resultAll = new ArrayList<Organization>();
|
ArrayList<Organization> resultAll = new ArrayList<Organization>();
|
||||||
while (!CollectionUtils.isEmpty(parentIdList)) {
|
while (!CollectionUtils.isEmpty(parentIdList)) {
|
||||||
dto.setParentIds(parentIdList);
|
dto.setParentIds(parentIdList);
|
||||||
List resultOnce = this.imgStoreOrganizationMapper.gets(dto);
|
List<Organization> resultOnce = this.imgStoreOrganizationMapper.gets(dto);
|
||||||
if (CollectionUtils.isEmpty((Collection)resultOnce)) break;
|
if (CollectionUtils.isEmpty((Collection)resultOnce)) break;
|
||||||
resultAll.addAll(resultOnce);
|
resultAll.addAll(resultOnce);
|
||||||
parentIdList.clear();
|
parentIdList.clear();
|
||||||
@@ -441,31 +441,31 @@ implements OrganizationService {
|
|||||||
nextTreeOrganizationResult.setHasLowerLevel(null);
|
nextTreeOrganizationResult.setHasLowerLevel(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)res);
|
return (CloudwalkResult)CloudwalkResult.success(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
@CloudwalkParamsValidate
|
@CloudwalkParamsValidate
|
||||||
public CloudwalkResult<Boolean> addPerson(AddPersonOrgParam personOrgParam, CloudwalkCallContext context) {
|
public CloudwalkResult<Boolean> addPerson(AddPersonOrgParam personOrgParam, CloudwalkCallContext context) {
|
||||||
if (CollectionUtils.isEmpty((Collection)personOrgParam.getPersonIds())) {
|
if (CollectionUtils.isEmpty((Collection)personOrgParam.getPersonIds())) {
|
||||||
return CloudwalkResult.fail((String)"53060411", (String)this.getMessage("53060411"));
|
return (CloudwalkResult)CloudwalkResult.fail((String)"53060411", (String)this.getMessage("53060411"));
|
||||||
}
|
}
|
||||||
Organization personOrg = this.imgStoreOrganizationMapper.selectByPrimaryKey(personOrgParam.getOrganizationId());
|
Organization personOrg = this.imgStoreOrganizationMapper.selectByPrimaryKey(personOrgParam.getOrganizationId());
|
||||||
if (personOrg == null || personOrg.getIsDel() == 1 || !context.getCompany().getCompanyId().equals(personOrg.getBusinessId())) {
|
if (personOrg == null || personOrg.getIsDel() == 1 || !context.getCompany().getCompanyId().equals(personOrg.getBusinessId())) {
|
||||||
return CloudwalkResult.fail((String)"53003310", (String)this.getMessage("53003310"));
|
return (CloudwalkResult)CloudwalkResult.fail((String)"53003310", (String)this.getMessage("53003310"));
|
||||||
}
|
}
|
||||||
List personIds = this.imgStoreOrganizationMapper.getPersonIdInRef((AddPersonOrgDTO)BeanCopyUtils.copyProperties((Object)personOrgParam, AddPersonOrgDTO.class));
|
List personIds = this.imgStoreOrganizationMapper.getPersonIdInRef((AddPersonOrgDTO)BeanCopyUtils.copyProperties((Object)personOrgParam, AddPersonOrgDTO.class));
|
||||||
if (!CollectionUtils.isEmpty((Collection)personIds)) {
|
if (!CollectionUtils.isEmpty((Collection)personIds)) {
|
||||||
personOrgParam.getPersonIds().removeAll(personIds);
|
personOrgParam.getPersonIds().removeAll(personIds);
|
||||||
}
|
}
|
||||||
if (CollectionUtils.isEmpty((Collection)personOrgParam.getPersonIds())) {
|
if (CollectionUtils.isEmpty((Collection)personOrgParam.getPersonIds())) {
|
||||||
return CloudwalkResult.success((Object)Boolean.TRUE);
|
return (CloudwalkResult)CloudwalkResult.success(Boolean.TRUE);
|
||||||
}
|
}
|
||||||
ImgStorePersonQueryDto dto = new ImgStorePersonQueryDto();
|
ImgStorePersonQueryDto dto = new ImgStorePersonQueryDto();
|
||||||
dto.setIds((Collection)personOrgParam.getPersonIds());
|
dto.setIds((Collection)personOrgParam.getPersonIds());
|
||||||
dto.setBusinessId(StringUtils.isEmpty((CharSequence)personOrgParam.getBusinessId()) ? context.getCompany().getCompanyId() : personOrgParam.getBusinessId());
|
dto.setBusinessId(StringUtils.isEmpty((CharSequence)personOrgParam.getBusinessId()) ? context.getCompany().getCompanyId() : personOrgParam.getBusinessId());
|
||||||
dto.setIsDel(DelStatusEnum.NORAML.getCode());
|
dto.setIsDel(DelStatusEnum.NORAML.getCode());
|
||||||
if (this.personMapper.gets(dto).size() != personOrgParam.getPersonIds().size()) {
|
if (this.personMapper.gets(dto).size() != personOrgParam.getPersonIds().size()) {
|
||||||
return CloudwalkResult.fail((String)"53003311", (String)this.getMessage("53003311"));
|
return (CloudwalkResult)CloudwalkResult.fail((String)"53003311", (String)this.getMessage("53003311"));
|
||||||
}
|
}
|
||||||
ArrayList<ImgStorePersonOrganization> list = new ArrayList<ImgStorePersonOrganization>();
|
ArrayList<ImgStorePersonOrganization> list = new ArrayList<ImgStorePersonOrganization>();
|
||||||
long time = System.currentTimeMillis();
|
long time = System.currentTimeMillis();
|
||||||
@@ -489,7 +489,7 @@ implements OrganizationService {
|
|||||||
if (Collections3.isNotEmpty(imageIdResultList)) {
|
if (Collections3.isNotEmpty(imageIdResultList)) {
|
||||||
imageIdResultList.parallelStream().forEach(imageId -> this.cpImageStorePersonSynManager.handleGroupPersonSynTask((String)imageId));
|
imageIdResultList.parallelStream().forEach(imageId -> this.cpImageStorePersonSynManager.handleGroupPersonSynTask((String)imageId));
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)Boolean.TRUE);
|
return (CloudwalkResult)CloudwalkResult.success(Boolean.TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@CloudwalkParamsValidate
|
@CloudwalkParamsValidate
|
||||||
@@ -500,7 +500,7 @@ implements OrganizationService {
|
|||||||
getsOrganizationDTO.setBusinessId(businessId);
|
getsOrganizationDTO.setBusinessId(businessId);
|
||||||
List organizationList = this.imgStoreOrganizationMapper.gets(getsOrganizationDTO);
|
List organizationList = this.imgStoreOrganizationMapper.gets(getsOrganizationDTO);
|
||||||
if (CollectionUtils.isEmpty((Collection)organizationList)) {
|
if (CollectionUtils.isEmpty((Collection)organizationList)) {
|
||||||
return CloudwalkResult.fail((String)"53003310", (String)this.getMessage("53003310"));
|
return (CloudwalkResult)CloudwalkResult.fail((String)"53003310", (String)this.getMessage("53003310"));
|
||||||
}
|
}
|
||||||
if (!CollectionUtils.isEmpty((Collection)personOrgParam.getPersonIds())) {
|
if (!CollectionUtils.isEmpty((Collection)personOrgParam.getPersonIds())) {
|
||||||
this.imgStoreOrganizationMapper.delPerson((DelPersonOrgDTO)BeanCopyUtils.copyProperties((Object)personOrgParam, DelPersonOrgDTO.class));
|
this.imgStoreOrganizationMapper.delPerson((DelPersonOrgDTO)BeanCopyUtils.copyProperties((Object)personOrgParam, DelPersonOrgDTO.class));
|
||||||
@@ -513,7 +513,7 @@ implements OrganizationService {
|
|||||||
imageIdResultList.parallelStream().forEach(imageId -> this.cpImageStorePersonSynManager.handleGroupPersonSynTask((String)imageId));
|
imageIdResultList.parallelStream().forEach(imageId -> this.cpImageStorePersonSynManager.handleGroupPersonSynTask((String)imageId));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)Boolean.TRUE);
|
return (CloudwalkResult)CloudwalkResult.success(Boolean.TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected AcAccountDTO getAccountById(String loginId) throws ServiceException {
|
protected AcAccountDTO getAccountById(String loginId) throws ServiceException {
|
||||||
@@ -537,12 +537,12 @@ implements OrganizationService {
|
|||||||
if (param.getByLoginUser() != null && param.getByLoginUser().booleanValue()) {
|
if (param.getByLoginUser() != null && param.getByLoginUser().booleanValue()) {
|
||||||
CloudwalkResult<List<String>> orgIdsByLoginUser = this.getOrgIdsByLoginUser(businessId, context);
|
CloudwalkResult<List<String>> orgIdsByLoginUser = this.getOrgIdsByLoginUser(businessId, context);
|
||||||
if (!orgIdsByLoginUser.isSuccess()) {
|
if (!orgIdsByLoginUser.isSuccess()) {
|
||||||
return CloudwalkResult.fail((String)orgIdsByLoginUser.getCode(), (String)orgIdsByLoginUser.getMessage());
|
return (CloudwalkResult)CloudwalkResult.fail((String)orgIdsByLoginUser.getCode(), (String)orgIdsByLoginUser.getMessage());
|
||||||
}
|
}
|
||||||
if (!CollectionUtils.isEmpty((Collection)((Collection)orgIdsByLoginUser.getData()))) {
|
if (!CollectionUtils.isEmpty((Collection)((Collection)orgIdsByLoginUser.getData()))) {
|
||||||
orgIds = (List)orgIdsByLoginUser.getData();
|
orgIds = (List)orgIdsByLoginUser.getData();
|
||||||
} else {
|
} else {
|
||||||
return CloudwalkResult.success(new ArrayList());
|
return (CloudwalkResult)CloudwalkResult.success(new ArrayList());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
GetsOrganizationDTO getsOrganizationDTO = (GetsOrganizationDTO)BeanCopyUtils.copyProperties((Object)param, GetsOrganizationDTO.class);
|
GetsOrganizationDTO getsOrganizationDTO = (GetsOrganizationDTO)BeanCopyUtils.copyProperties((Object)param, GetsOrganizationDTO.class);
|
||||||
@@ -553,7 +553,7 @@ implements OrganizationService {
|
|||||||
if (!CollectionUtils.isEmpty((Collection)ids)) {
|
if (!CollectionUtils.isEmpty((Collection)ids)) {
|
||||||
orgIds.retainAll(ids);
|
orgIds.retainAll(ids);
|
||||||
if (CollectionUtils.isEmpty(orgIds)) {
|
if (CollectionUtils.isEmpty(orgIds)) {
|
||||||
return CloudwalkResult.success(new ArrayList());
|
return (CloudwalkResult)CloudwalkResult.success(new ArrayList());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
getsOrganizationDTO.setIds(orgIds);
|
getsOrganizationDTO.setIds(orgIds);
|
||||||
@@ -601,7 +601,7 @@ implements OrganizationService {
|
|||||||
result.setHasLowerLevel(null);
|
result.setHasLowerLevel(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)resultList);
|
return (CloudwalkResult)CloudwalkResult.success(resultList);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<CloudwalkPageAble<OrganizationResult>> getPage(QueryOrganizationParam param, CloudwalkPageInfo page, CloudwalkCallContext context) {
|
public CloudwalkResult<CloudwalkPageAble<OrganizationResult>> getPage(QueryOrganizationParam param, CloudwalkPageInfo page, CloudwalkCallContext context) {
|
||||||
@@ -655,7 +655,7 @@ implements OrganizationService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
CloudwalkPageAble pageAble = new CloudwalkPageAble((Collection)resultList, page, pageData.getTotal());
|
CloudwalkPageAble pageAble = new CloudwalkPageAble((Collection)resultList, page, pageData.getTotal());
|
||||||
return CloudwalkResult.success((Object)pageAble);
|
return (CloudwalkResult)CloudwalkResult.success(pageAble);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<List<OrganizationResult>> listByPage(QueryOrganizationParam param, CloudwalkCallContext context) throws ServiceException {
|
public CloudwalkResult<List<OrganizationResult>> listByPage(QueryOrganizationParam param, CloudwalkCallContext context) throws ServiceException {
|
||||||
@@ -762,7 +762,7 @@ implements OrganizationService {
|
|||||||
orgResult.setFloorNames(zoneNames);
|
orgResult.setFloorNames(zoneNames);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)resultList);
|
return (CloudwalkResult)CloudwalkResult.success(resultList);
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
this.logger.error("执行报错 {}: {}", (Object)e.getClass().getName(), (Object)e.getMessage());
|
this.logger.error("执行报错 {}: {}", (Object)e.getClass().getName(), (Object)e.getMessage());
|
||||||
@@ -777,7 +777,7 @@ implements OrganizationService {
|
|||||||
List resultData = this.imgStoreOrganizationMapper.gets(getsOrganizationDTO);
|
List resultData = this.imgStoreOrganizationMapper.gets(getsOrganizationDTO);
|
||||||
Organization organization = null;
|
Organization organization = null;
|
||||||
if (CollectionUtils.isEmpty((Collection)resultData)) {
|
if (CollectionUtils.isEmpty((Collection)resultData)) {
|
||||||
return CloudwalkResult.success(null);
|
return (CloudwalkResult)CloudwalkResult.success(null);
|
||||||
}
|
}
|
||||||
organization = (Organization)resultData.get(0);
|
organization = (Organization)resultData.get(0);
|
||||||
String orgId = organization.getId();
|
String orgId = organization.getId();
|
||||||
@@ -825,12 +825,12 @@ implements OrganizationService {
|
|||||||
}
|
}
|
||||||
result.setZoneIds(zoneIds);
|
result.setZoneIds(zoneIds);
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)result);
|
return (CloudwalkResult)CloudwalkResult.success(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<Map<String, String>> listNames(QueryOrganizationParam param, CloudwalkCallContext context) {
|
public CloudwalkResult<Map<String, String>> listNames(QueryOrganizationParam param, CloudwalkCallContext context) {
|
||||||
if (param.getId() == null && (param.getIds() == null || param.getIds().isEmpty())) {
|
if (param.getId() == null && (param.getIds() == null || param.getIds().isEmpty())) {
|
||||||
return CloudwalkResult.fail((String)"", (String)"请输入查询参数");
|
return (CloudwalkResult)CloudwalkResult.fail((String)"", (String)"请输入查询参数");
|
||||||
}
|
}
|
||||||
String businessId = context.getCompany().getCompanyId();
|
String businessId = context.getCompany().getCompanyId();
|
||||||
List<String> ids = new ArrayList<String>();
|
List<String> ids = new ArrayList<String>();
|
||||||
@@ -840,13 +840,13 @@ implements OrganizationService {
|
|||||||
ids = param.getIds();
|
ids = param.getIds();
|
||||||
}
|
}
|
||||||
List organizations = Optional.ofNullable(this.imgStoreOrganizationMapper.listNames(ids, businessId)).orElse(Collections.emptyList());
|
List organizations = Optional.ofNullable(this.imgStoreOrganizationMapper.listNames(ids, businessId)).orElse(Collections.emptyList());
|
||||||
Map<String, String> collect = organizations.stream().collect(Collectors.toMap(it -> it.getId(), v -> v.getName()));
|
Map<String, String> collect = (java.util.Map<java.lang.String,java.lang.String>) organizations.stream().collect(Collectors.toMap(it -> it.getId(), v -> v.getName()));
|
||||||
return CloudwalkResult.success(collect);
|
return (CloudwalkResult)CloudwalkResult.success(collect);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<OrganizationAreaResult> listAreas(QueryOrganizationParam param, CloudwalkCallContext context) {
|
public CloudwalkResult<OrganizationAreaResult> listAreas(QueryOrganizationParam param, CloudwalkCallContext context) {
|
||||||
String businessId = context.getCompany().getCompanyId();
|
String businessId = context.getCompany().getCompanyId();
|
||||||
List refDTOS = Optional.ofNullable(this.organizationAreaRefMapper.listByOrgId(param.getId(), businessId)).orElse(Collections.emptyList());
|
List<OrganizationAreaRefDTO> refDTOS = Optional.ofNullable(this.organizationAreaRefMapper.listByOrgId(param.getId(), businessId)).orElse(Collections.emptyList());
|
||||||
ArrayList<String> office = new ArrayList<String>();
|
ArrayList<String> office = new ArrayList<String>();
|
||||||
ArrayList<String> passable = new ArrayList<String>();
|
ArrayList<String> passable = new ArrayList<String>();
|
||||||
for (OrganizationAreaRefDTO refDTO : refDTOS) {
|
for (OrganizationAreaRefDTO refDTO : refDTOS) {
|
||||||
@@ -861,7 +861,7 @@ implements OrganizationService {
|
|||||||
result.setBusinessId(businessId);
|
result.setBusinessId(businessId);
|
||||||
result.setOfficeArea(office);
|
result.setOfficeArea(office);
|
||||||
result.setPassableArea(passable);
|
result.setPassableArea(passable);
|
||||||
return CloudwalkResult.success((Object)result);
|
return (CloudwalkResult)CloudwalkResult.success(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<Map<String, List<String>>> getOrg(List<String> ids, String businessId, CloudwalkCallContext cloudwalkContext) {
|
public CloudwalkResult<Map<String, List<String>>> getOrg(List<String> ids, String businessId, CloudwalkCallContext cloudwalkContext) {
|
||||||
@@ -890,21 +890,21 @@ implements OrganizationService {
|
|||||||
typeIdList.addAll(stringList);
|
typeIdList.addAll(stringList);
|
||||||
result.put(id, typeIdList);
|
result.put(id, typeIdList);
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success(result);
|
return (CloudwalkResult)CloudwalkResult.success(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<Boolean> enable(QueryOrganizationParam param, CloudwalkCallContext cloudwalkContext) {
|
public CloudwalkResult<Boolean> enable(QueryOrganizationParam param, CloudwalkCallContext cloudwalkContext) {
|
||||||
Boolean result = this.updateIsValid(param, 0, 1);
|
Boolean result = this.updateIsValid(param, 0, 1);
|
||||||
return CloudwalkResult.success((Object)result);
|
return (CloudwalkResult)CloudwalkResult.success(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<Boolean> disable(QueryOrganizationParam param, CloudwalkCallContext cloudwalkContext) {
|
public CloudwalkResult<Boolean> disable(QueryOrganizationParam param, CloudwalkCallContext cloudwalkContext) {
|
||||||
Boolean result = this.updateIsValid(param, 1, 0);
|
Boolean result = this.updateIsValid(param, 1, 0);
|
||||||
return CloudwalkResult.success((Object)result);
|
return (CloudwalkResult)CloudwalkResult.success(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<TreeOrganizationResult> judgeNodeLevel(EditOrganizationParam param, String businessId) throws ServiceException {
|
private List<TreeOrganizationResult> judgeNodeLevel(EditOrganizationParam param, String businessId) throws ServiceException {
|
||||||
List res = null;
|
List<TreeOrganizationResult> res = null;
|
||||||
Organization parent = this.imgStoreOrganizationMapper.selectByPrimaryKey(param.getParentId());
|
Organization parent = this.imgStoreOrganizationMapper.selectByPrimaryKey(param.getParentId());
|
||||||
if (parent == null || parent.getIsDel() == 1 || !businessId.equals(parent.getBusinessId())) {
|
if (parent == null || parent.getIsDel() == 1 || !businessId.equals(parent.getBusinessId())) {
|
||||||
throw new ServiceException("53003307", this.getMessage("53003307"));
|
throw new ServiceException("53003307", this.getMessage("53003307"));
|
||||||
@@ -947,7 +947,7 @@ implements OrganizationService {
|
|||||||
throw new ServiceException("2", "2");
|
throw new ServiceException("2", "2");
|
||||||
}
|
}
|
||||||
List detailList = extend.getDetail();
|
List detailList = extend.getDetail();
|
||||||
List detailDTOList = BeanCopyUtils.copy((Collection)detailList, OrganizationExtendDetailDTO.class);
|
List<OrganizationExtendDetailDTO> detailDTOList = BeanCopyUtils.copy((Collection)detailList, OrganizationExtendDetailDTO.class);
|
||||||
for (OrganizationExtendDetailDTO detailDTO : detailDTOList) {
|
for (OrganizationExtendDetailDTO detailDTO : detailDTOList) {
|
||||||
this.organizationExtendDetailMapper.insertSelective(detailDTO);
|
this.organizationExtendDetailMapper.insertSelective(detailDTO);
|
||||||
}
|
}
|
||||||
@@ -1044,7 +1044,7 @@ implements OrganizationService {
|
|||||||
}
|
}
|
||||||
if (!CollectionUtils.isEmpty(ids)) {
|
if (!CollectionUtils.isEmpty(ids)) {
|
||||||
HashMap<String, Integer> map = new HashMap<String, Integer>();
|
HashMap<String, Integer> map = new HashMap<String, Integer>();
|
||||||
List orgCountDTOS = this.imgStoreOrganizationMapper.getPersonCount(ids);
|
List<OrgCountDTO> orgCountDTOS = this.imgStoreOrganizationMapper.getPersonCount(ids);
|
||||||
for (OrgCountDTO dto : orgCountDTOS) {
|
for (OrgCountDTO dto : orgCountDTOS) {
|
||||||
map.put(dto.getId(), dto.getCount());
|
map.put(dto.getId(), dto.getCount());
|
||||||
}
|
}
|
||||||
@@ -1068,7 +1068,7 @@ implements OrganizationService {
|
|||||||
}
|
}
|
||||||
OrganizationTypeQueryDto typeQueryDto = new OrganizationTypeQueryDto();
|
OrganizationTypeQueryDto typeQueryDto = new OrganizationTypeQueryDto();
|
||||||
typeQueryDto.setIds(new ArrayList(typeIds));
|
typeQueryDto.setIds(new ArrayList(typeIds));
|
||||||
List orgTypeList = this.imgStoreOrganizationTypeMapper.select(typeQueryDto);
|
List<OrganizationType> orgTypeList = this.imgStoreOrganizationTypeMapper.select(typeQueryDto);
|
||||||
if (!CollectionUtils.isEmpty((Collection)orgTypeList)) {
|
if (!CollectionUtils.isEmpty((Collection)orgTypeList)) {
|
||||||
for (OrganizationType organizationType : orgTypeList) {
|
for (OrganizationType organizationType : orgTypeList) {
|
||||||
typeMap.put(organizationType.getId(), organizationType);
|
typeMap.put(organizationType.getId(), organizationType);
|
||||||
|
|||||||
+10
-10
@@ -103,7 +103,7 @@ implements OrganizationTypeService {
|
|||||||
this.orgTypePropertiesMapper.insertSelective(property);
|
this.orgTypePropertiesMapper.insertSelective(property);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)uuid);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(rollbackFor={Exception.class})
|
@Transactional(rollbackFor={Exception.class})
|
||||||
@@ -241,7 +241,7 @@ implements OrganizationTypeService {
|
|||||||
this.orgTypePropertiesMapper.insertSelective(organizationTypeProperties);
|
this.orgTypePropertiesMapper.insertSelective(organizationTypeProperties);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)Boolean.TRUE);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getCode(Set<String> codeSet) {
|
private String getCode(Set<String> codeSet) {
|
||||||
@@ -286,7 +286,7 @@ implements OrganizationTypeService {
|
|||||||
this.orgTypePropertiesMapper.updateByTypeKey(record);
|
this.orgTypePropertiesMapper.updateByTypeKey(record);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)Boolean.TRUE);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<CloudwalkPageAble<OrganizationTypeListResult>> page(QueryOrgTypeParam param, CloudwalkPageInfo page, CloudwalkCallContext context) throws ServiceException {
|
public CloudwalkResult<CloudwalkPageAble<OrganizationTypeListResult>> page(QueryOrgTypeParam param, CloudwalkPageInfo page, CloudwalkCallContext context) throws ServiceException {
|
||||||
@@ -319,7 +319,7 @@ implements OrganizationTypeService {
|
|||||||
results.add(typeResult);
|
results.add(typeResult);
|
||||||
}
|
}
|
||||||
CloudwalkPageAble pageAble = new CloudwalkPageAble(results, page, gets.getTotal());
|
CloudwalkPageAble pageAble = new CloudwalkPageAble(results, page, gets.getTotal());
|
||||||
return CloudwalkResult.success((Object)pageAble);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
this.logger.error("分页查询机构类型信息失败,原因:", e);
|
this.logger.error("分页查询机构类型信息失败,原因:", e);
|
||||||
@@ -353,7 +353,7 @@ implements OrganizationTypeService {
|
|||||||
}
|
}
|
||||||
results.add(typeResult);
|
results.add(typeResult);
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success(results);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<OrganizationTypeResult> detail(QueryOrgTypeParam param, CloudwalkCallContext cloudwalkContext) throws ServiceException {
|
public CloudwalkResult<OrganizationTypeResult> detail(QueryOrgTypeParam param, CloudwalkCallContext cloudwalkContext) throws ServiceException {
|
||||||
@@ -366,7 +366,7 @@ implements OrganizationTypeService {
|
|||||||
proQuery.setOrganizationTypeId(param.getId());
|
proQuery.setOrganizationTypeId(param.getId());
|
||||||
List typeProperties = this.orgTypePropertiesMapper.select(proQuery);
|
List typeProperties = this.orgTypePropertiesMapper.select(proQuery);
|
||||||
result.setProperties(BeanCopyUtils.copy((Collection)typeProperties, OrganizationTypePropertyParam.class));
|
result.setProperties(BeanCopyUtils.copy((Collection)typeProperties, OrganizationTypePropertyParam.class));
|
||||||
return CloudwalkResult.success((Object)result);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<List<OrganizationTypePropertyCommonResult>> commonList(CloudwalkCallContext cloudwalkContext) throws ServiceException {
|
public CloudwalkResult<List<OrganizationTypePropertyCommonResult>> commonList(CloudwalkCallContext cloudwalkContext) throws ServiceException {
|
||||||
@@ -378,7 +378,7 @@ implements OrganizationTypeService {
|
|||||||
if (select != null && select.size() > 0) {
|
if (select != null && select.size() > 0) {
|
||||||
result = BeanCopyUtils.copy((Collection)select, OrganizationTypePropertyCommonResult.class);
|
result = BeanCopyUtils.copy((Collection)select, OrganizationTypePropertyCommonResult.class);
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success(result);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(rollbackFor={Exception.class})
|
@Transactional(rollbackFor={Exception.class})
|
||||||
@@ -409,7 +409,7 @@ implements OrganizationTypeService {
|
|||||||
property.setCreateUserId(cloudwalkContext.getUser().getCaller());
|
property.setCreateUserId(cloudwalkContext.getUser().getCaller());
|
||||||
this.orgTypePropertiesMapper.insertSelective(property);
|
this.orgTypePropertiesMapper.insertSelective(property);
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)Boolean.TRUE);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
String[] initNameArray = new String[]{"地址", "邮编", "电话", "传真", "面积", "财务是否独立核算"};
|
String[] initNameArray = new String[]{"地址", "邮编", "电话", "传真", "面积", "财务是否独立核算"};
|
||||||
int index = 1;
|
int index = 1;
|
||||||
@@ -426,7 +426,7 @@ implements OrganizationTypeService {
|
|||||||
property.setCreateUserId(cloudwalkContext.getUser().getCaller());
|
property.setCreateUserId(cloudwalkContext.getUser().getCaller());
|
||||||
this.orgTypePropertiesMapper.insertSelective(property);
|
this.orgTypePropertiesMapper.insertSelective(property);
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)Boolean.TRUE);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(rollbackFor={Exception.class})
|
@Transactional(rollbackFor={Exception.class})
|
||||||
@@ -457,7 +457,7 @@ implements OrganizationTypeService {
|
|||||||
property.setCreateTime(Long.valueOf(System.currentTimeMillis()));
|
property.setCreateTime(Long.valueOf(System.currentTimeMillis()));
|
||||||
this.orgTypePropertiesMapper.insertSelective(property);
|
this.orgTypePropertiesMapper.insertSelective(property);
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)Boolean.TRUE);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
-5
@@ -153,7 +153,7 @@ implements OrganizationService {
|
|||||||
result.setHasLowerLevel(null);
|
result.setHasLowerLevel(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success(resultList);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -164,21 +164,21 @@ implements OrganizationService {
|
|||||||
List ids = param.getIds();
|
List ids = param.getIds();
|
||||||
List orgByIds = this.organizationMapper.getOrgByIds(ids, businessId);
|
List orgByIds = this.organizationMapper.getOrgByIds(ids, businessId);
|
||||||
if (orgByIds.size() != param.getIds().size()) {
|
if (orgByIds.size() != param.getIds().size()) {
|
||||||
return CloudwalkResult.fail((String)"53060411", (String)this.getMessage("53060411"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
List personCount = this.organizationMapper.getPersonCount(ids);
|
List personCount = this.organizationMapper.getPersonCount(ids);
|
||||||
for (OrgCountDTO orgCountDTO : personCount) {
|
for (OrgCountDTO orgCountDTO : personCount) {
|
||||||
if (orgCountDTO.getCount() <= 0) continue;
|
if (orgCountDTO.getCount() <= 0) continue;
|
||||||
return CloudwalkResult.fail((String)"53003315", (String)"单位人员数量大于0,请将人员从单位中移除后再删除");
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
this.organizationMapper.batchDel(param.getIds(), System.currentTimeMillis(), context.getUser().getCaller(), businessId);
|
this.organizationMapper.batchDel(param.getIds(), System.currentTimeMillis(), context.getUser().getCaller(), businessId);
|
||||||
this.personOrganizationMapper.deleteByOrgIds(param.getIds());
|
this.personOrganizationMapper.deleteByOrgIds(param.getIds());
|
||||||
return CloudwalkResult.success((Object)Boolean.TRUE);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CloudwalkResult<String> add(AddOrganizationParam param, CloudwalkCallContext context) {
|
public CloudwalkResult<String> add(AddOrganizationParam param, CloudwalkCallContext context) {
|
||||||
return CloudwalkResult.success((Object)"暂不支持新增单位");
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+6
-6
@@ -73,7 +73,7 @@ extends AbstractImagStoreService {
|
|||||||
results.add(typeResult);
|
results.add(typeResult);
|
||||||
}
|
}
|
||||||
CloudwalkPageAble pageAble = new CloudwalkPageAble(results, page, gets.getTotal());
|
CloudwalkPageAble pageAble = new CloudwalkPageAble(results, page, gets.getTotal());
|
||||||
return CloudwalkResult.success((Object)pageAble);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
this.logger.error("分页查询机构类型信息失败,原因:", e);
|
this.logger.error("分页查询机构类型信息失败,原因:", e);
|
||||||
@@ -107,7 +107,7 @@ extends AbstractImagStoreService {
|
|||||||
}
|
}
|
||||||
results.add(typeResult);
|
results.add(typeResult);
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success(results);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<Boolean> defaultInitOrgType(String businessId, boolean isSuperCorp) {
|
public CloudwalkResult<Boolean> defaultInitOrgType(String businessId, boolean isSuperCorp) {
|
||||||
@@ -118,7 +118,7 @@ extends AbstractImagStoreService {
|
|||||||
List count = this.orgTypeMapper.selectByCondition(queryDto);
|
List count = this.orgTypeMapper.selectByCondition(queryDto);
|
||||||
if (count.size() > 0) {
|
if (count.size() > 0) {
|
||||||
this.logger.info("类型已初始化,请勿重复调用");
|
this.logger.info("类型已初始化,请勿重复调用");
|
||||||
return CloudwalkResult.success((Object)Boolean.TRUE);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
if (isSuperCorp) {
|
if (isSuperCorp) {
|
||||||
OrganizationType unitType = new OrganizationType();
|
OrganizationType unitType = new OrganizationType();
|
||||||
@@ -142,7 +142,7 @@ extends AbstractImagStoreService {
|
|||||||
this.orgTypePropertiesMapper.insertSelective(properties);
|
this.orgTypePropertiesMapper.insertSelective(properties);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)Boolean.TRUE);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(rollbackFor={Exception.class})
|
@Transactional(rollbackFor={Exception.class})
|
||||||
@@ -185,7 +185,7 @@ extends AbstractImagStoreService {
|
|||||||
record.setHasDefault(Integer.valueOf(1));
|
record.setHasDefault(Integer.valueOf(1));
|
||||||
List exists = this.orgTypeMapper.select(record);
|
List exists = this.orgTypeMapper.select(record);
|
||||||
if (!exists.isEmpty()) {
|
if (!exists.isEmpty()) {
|
||||||
return CloudwalkResult.success((Object)Boolean.TRUE);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
record = new OrganizationTypeQueryDto();
|
record = new OrganizationTypeQueryDto();
|
||||||
record.setBusinessId("cloudwalk");
|
record.setBusinessId("cloudwalk");
|
||||||
@@ -224,7 +224,7 @@ extends AbstractImagStoreService {
|
|||||||
this.organizationMapper.insertSelective(organization);
|
this.organizationMapper.insertSelective(organization);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)Boolean.TRUE);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+13
-13
@@ -217,7 +217,7 @@ implements IPersonAuditServcie {
|
|||||||
this.logger.error("人员注册新增失败,原因:{}", (Object)e.getMessage());
|
this.logger.error("人员注册新增失败,原因:{}", (Object)e.getMessage());
|
||||||
throw new ServiceException("53060535", this.messageSource.getMessage("53060535", null, LocaleContextHolder.getLocale()));
|
throw new ServiceException("53060535", this.messageSource.getMessage("53060535", null, LocaleContextHolder.getLocale()));
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)auditId);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<String> getZoneIdByUnitId(String unitId) {
|
private List<String> getZoneIdByUnitId(String unitId) {
|
||||||
@@ -393,7 +393,7 @@ implements IPersonAuditServcie {
|
|||||||
this.logger.error("人员注册修改失败,原因:{}", e);
|
this.logger.error("人员注册修改失败,原因:{}", e);
|
||||||
throw new ServiceException("53060535", this.messageSource.getMessage("53060535", null, LocaleContextHolder.getLocale()));
|
throw new ServiceException("53060535", this.messageSource.getMessage("53060535", null, LocaleContextHolder.getLocale()));
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)personAudit.getId());
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getDeviceName(String deviceCode, List<DeviceResult> deviceResultList) {
|
private String getDeviceName(String deviceCode, List<DeviceResult> deviceResultList) {
|
||||||
@@ -641,7 +641,7 @@ implements IPersonAuditServcie {
|
|||||||
if (Collections3.isNotEmpty(imageIdResultList)) {
|
if (Collections3.isNotEmpty(imageIdResultList)) {
|
||||||
imageIdResultList.parallelStream().forEach(imageId -> this.cpImageStorePersonSynManager.handleGroupPersonSynTask((String)imageId));
|
imageIdResultList.parallelStream().forEach(imageId -> this.cpImageStorePersonSynManager.handleGroupPersonSynTask((String)imageId));
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)personId);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
catch (ServiceException e) {
|
catch (ServiceException e) {
|
||||||
this.logger.error("人员注册审核通过失败,原因:{}", (Object)e.getMessage());
|
this.logger.error("人员注册审核通过失败,原因:{}", (Object)e.getMessage());
|
||||||
@@ -702,7 +702,7 @@ implements IPersonAuditServcie {
|
|||||||
this.logger.error("人员注册审核拒绝失败,原因:", e);
|
this.logger.error("人员注册审核拒绝失败,原因:", e);
|
||||||
throw new ServiceException("53060539", this.messageSource.getMessage("53060539", null, LocaleContextHolder.getLocale()));
|
throw new ServiceException("53060539", this.messageSource.getMessage("53060539", null, LocaleContextHolder.getLocale()));
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)true);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
@CloudwalkParamsValidate
|
@CloudwalkParamsValidate
|
||||||
@@ -713,7 +713,7 @@ implements IPersonAuditServcie {
|
|||||||
try {
|
try {
|
||||||
List auditList = this.imgStorePersonAuditMapper.queryByIds(ids, CpPersonAuditEnum.INIT.getCode());
|
List auditList = this.imgStorePersonAuditMapper.queryByIds(ids, CpPersonAuditEnum.INIT.getCode());
|
||||||
if (CollectionUtils.isEmpty((Collection)auditList)) {
|
if (CollectionUtils.isEmpty((Collection)auditList)) {
|
||||||
return CloudwalkResult.fail((String)"53060538", (String)this.messageSource.getMessage("53060538", null, LocaleContextHolder.getLocale()));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
String updateUserId = context.getUser().getCaller();
|
String updateUserId = context.getUser().getCaller();
|
||||||
List<String> imageIdResultList = this.imgPersonHandler.batchAgreeTransactional(context, auditList, updateUserId);
|
List<String> imageIdResultList = this.imgPersonHandler.batchAgreeTransactional(context, auditList, updateUserId);
|
||||||
@@ -729,7 +729,7 @@ implements IPersonAuditServcie {
|
|||||||
this.logger.error("人员注册批量同构失败,原因:{}", e);
|
this.logger.error("人员注册批量同构失败,原因:{}", e);
|
||||||
throw new ServiceException("53060539", this.messageSource.getMessage("53060539", null, LocaleContextHolder.getLocale()));
|
throw new ServiceException("53060539", this.messageSource.getMessage("53060539", null, LocaleContextHolder.getLocale()));
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)true);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(propagation=Propagation.REQUIRED, rollbackFor={Exception.class}, value="transactionManager")
|
@Transactional(propagation=Propagation.REQUIRED, rollbackFor={Exception.class}, value="transactionManager")
|
||||||
@@ -748,7 +748,7 @@ implements IPersonAuditServcie {
|
|||||||
this.logger.error("人员注册批量拒绝失败,原因:", e);
|
this.logger.error("人员注册批量拒绝失败,原因:", e);
|
||||||
throw new ServiceException("53060539", this.messageSource.getMessage("53060539", null, LocaleContextHolder.getLocale()));
|
throw new ServiceException("53060539", this.messageSource.getMessage("53060539", null, LocaleContextHolder.getLocale()));
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)true);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<CloudwalkPageAble<PersonAuditGetResult>> page(PersonAuditQueryParam param, CloudwalkPageInfo page, CloudwalkCallContext context) throws ServiceException {
|
public CloudwalkResult<CloudwalkPageAble<PersonAuditGetResult>> page(PersonAuditQueryParam param, CloudwalkPageInfo page, CloudwalkCallContext context) throws ServiceException {
|
||||||
@@ -773,7 +773,7 @@ implements IPersonAuditServcie {
|
|||||||
this.logger.error("分页查询人员注册信息失败,原因:", e);
|
this.logger.error("分页查询人员注册信息失败,原因:", e);
|
||||||
throw new ServiceException("53060540", this.messageSource.getMessage("53060540", null, LocaleContextHolder.getLocale()));
|
throw new ServiceException("53060540", this.messageSource.getMessage("53060540", null, LocaleContextHolder.getLocale()));
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)pageAble);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<UserProperties> getUserProperties(ImgStorePersonAudit audit, Map<String, ImgStorePersonProperties> propertyMap) {
|
private List<UserProperties> getUserProperties(ImgStorePersonAudit audit, Map<String, ImgStorePersonProperties> propertyMap) {
|
||||||
@@ -840,21 +840,21 @@ implements IPersonAuditServcie {
|
|||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
this.logger.error("人员注册查询失败,原因:{}", (Object)e.getMessage());
|
this.logger.error("人员注册查询失败,原因:{}", (Object)e.getMessage());
|
||||||
return CloudwalkResult.fail((String)"53060548", (String)this.messageSource.getMessage("53060548", null, LocaleContextHolder.getLocale()));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
if (personAudit == null) {
|
if (personAudit == null) {
|
||||||
return CloudwalkResult.fail((String)"53060548", (String)this.messageSource.getMessage("53060548", null, LocaleContextHolder.getLocale()));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
Short auditStatus = personAudit.getAuditStatus();
|
Short auditStatus = personAudit.getAuditStatus();
|
||||||
PersonAuditResult auditResult = new PersonAuditResult();
|
PersonAuditResult auditResult = new PersonAuditResult();
|
||||||
auditResult.setAuditStatus(auditStatus);
|
auditResult.setAuditStatus(auditStatus);
|
||||||
auditResult.setAuditStatusStr(CpPersonAuditEnum.getMessage((Short)auditStatus));
|
auditResult.setAuditStatusStr(CpPersonAuditEnum.getMessage((Short)auditStatus));
|
||||||
return CloudwalkResult.success((Object)auditResult);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<PersonAuditGetResult> checkById(PersonAuditParam param, CloudwalkCallContext context) throws ServiceException {
|
public CloudwalkResult<PersonAuditGetResult> checkById(PersonAuditParam param, CloudwalkCallContext context) throws ServiceException {
|
||||||
if (StringUtils.isBlank((CharSequence)param.getId())) {
|
if (StringUtils.isBlank((CharSequence)param.getId())) {
|
||||||
return CloudwalkResult.fail((String)"53060545", (String)this.messageSource.getMessage("53060545", null, LocaleContextHolder.getLocale()));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
ImgStorePersonAudit personAudit = this.imgStorePersonAuditMapper.selectByPrimaryKey(param.getId(), null);
|
ImgStorePersonAudit personAudit = this.imgStorePersonAuditMapper.selectByPrimaryKey(param.getId(), null);
|
||||||
if (null == personAudit) {
|
if (null == personAudit) {
|
||||||
@@ -864,7 +864,7 @@ implements IPersonAuditServcie {
|
|||||||
Map<String, ImgStorePersonProperties> propertyMap = propertyList.stream().collect(Collectors.toMap(ImgStorePersonProperties::getCode, pro -> pro));
|
Map<String, ImgStorePersonProperties> propertyMap = propertyList.stream().collect(Collectors.toMap(ImgStorePersonProperties::getCode, pro -> pro));
|
||||||
PersonAuditGetResult result = (PersonAuditGetResult)cn.cloudwalk.cloud.utils.BeanCopyUtils.copyProperties((Object)personAudit, PersonAuditGetResult.class);
|
PersonAuditGetResult result = (PersonAuditGetResult)cn.cloudwalk.cloud.utils.BeanCopyUtils.copyProperties((Object)personAudit, PersonAuditGetResult.class);
|
||||||
result.setUserPropertiesList(this.getUserProperties(personAudit, propertyMap));
|
result.setUserPropertiesList(this.getUserProperties(personAudit, propertyMap));
|
||||||
return CloudwalkResult.success((Object)result);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+12
-12
@@ -83,11 +83,11 @@ implements PersonFileService {
|
|||||||
public CloudwalkResult<String> upload(String fileName, byte[] content) {
|
public CloudwalkResult<String> upload(String fileName, byte[] content) {
|
||||||
MultipartFile multipartFile = this.buildMultipartFile(fileName, content);
|
MultipartFile multipartFile = this.buildMultipartFile(fileName, content);
|
||||||
try {
|
try {
|
||||||
return CloudwalkResult.success((Object)this.fileStorageManager.fileUpload(this.PERSON_NAME_SPACE, multipartFile));
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
this.logger.error("file upload error", e);
|
this.logger.error("file upload error", e);
|
||||||
return CloudwalkResult.fail((String)"80014001", (String)this.getMessage("80014001"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -98,7 +98,7 @@ implements PersonFileService {
|
|||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
this.logger.error("file upload error", e);
|
this.logger.error("file upload error", e);
|
||||||
return CloudwalkResult.fail((String)"80014001", (String)this.getMessage("80014001"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -106,12 +106,12 @@ implements PersonFileService {
|
|||||||
try {
|
try {
|
||||||
byte[] bytes = this.fileStorageManager.fileDownload(filePath);
|
byte[] bytes = this.fileStorageManager.fileDownload(filePath);
|
||||||
if (bytes == null) {
|
if (bytes == null) {
|
||||||
return CloudwalkResult.fail((String)"80014016", (String)this.getMessage("80014016"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)bytes);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
return CloudwalkResult.fail((String)"80014016", (String)this.getMessage("80014016"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -119,12 +119,12 @@ implements PersonFileService {
|
|||||||
try {
|
try {
|
||||||
InputStream inputStream = this.filePartManager.bigFileDownload(filePath);
|
InputStream inputStream = this.filePartManager.bigFileDownload(filePath);
|
||||||
if (inputStream == null) {
|
if (inputStream == null) {
|
||||||
return CloudwalkResult.fail((String)"80014016", (String)this.getMessage("80014016"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)inputStream);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
return CloudwalkResult.fail((String)"80014016", (String)this.getMessage("80014016"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -132,10 +132,10 @@ implements PersonFileService {
|
|||||||
FileRemoveDTO removeDTO = new FileRemoveDTO();
|
FileRemoveDTO removeDTO = new FileRemoveDTO();
|
||||||
removeDTO.setFileList(filePathList);
|
removeDTO.setFileList(filePathList);
|
||||||
try {
|
try {
|
||||||
return CloudwalkResult.success((Object)this.fileStorageManager.remove(removeDTO));
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
return CloudwalkResult.fail((String)"80014017", (String)"80014017");
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -178,7 +178,7 @@ implements PersonFileService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return CloudwalkResult.fail((String)"53060437", (String)this.getMessage("53060437"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<String> uploadCompressImage2(MultipartFile file) throws ServiceException {
|
public CloudwalkResult<String> uploadCompressImage2(MultipartFile file) throws ServiceException {
|
||||||
|
|||||||
+14
-14
@@ -73,26 +73,26 @@ implements IPersonRegistryHandler {
|
|||||||
} else {
|
} else {
|
||||||
this.insert(param, context);
|
this.insert(param, context);
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)true);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
private CloudwalkResult<Boolean> validateParams(AddPersonRegistryParam param, CloudwalkCallContext context) throws ServiceException {
|
private CloudwalkResult<Boolean> validateParams(AddPersonRegistryParam param, CloudwalkCallContext context) throws ServiceException {
|
||||||
if (null == param.getCodeStatus()) {
|
if (null == param.getCodeStatus()) {
|
||||||
return CloudwalkResult.fail((String)"53014502", (String)this.getMessage("53014502"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
if (CollectionUtils.isEmpty((Collection)param.getPropertyIdList())) {
|
if (CollectionUtils.isEmpty((Collection)param.getPropertyIdList())) {
|
||||||
return CloudwalkResult.fail((String)"53014503", (String)this.getMessage("53014503"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
List dbPersonProList = this.imgStorePersonPropertiesMapper.selectByIds(param.getBusinessId(), param.getPropertyIdList());
|
List dbPersonProList = this.imgStorePersonPropertiesMapper.selectByIds(param.getBusinessId(), param.getPropertyIdList());
|
||||||
if (CollectionUtils.isEmpty((Collection)dbPersonProList) || dbPersonProList.size() != param.getPropertyIdList().size()) {
|
if (CollectionUtils.isEmpty((Collection)dbPersonProList) || dbPersonProList.size() != param.getPropertyIdList().size()) {
|
||||||
this.logger.warn("注册属性不属于人员基本属性,注册属性Id列表:[{}]", (Object)JSONObject.toJSONString((Object)param.getPropertyIdList()));
|
this.logger.warn("注册属性不属于人员基本属性,注册属性Id列表:[{}]", (Object)JSONObject.toJSONString((Object)param.getPropertyIdList()));
|
||||||
return CloudwalkResult.fail((String)"53014508", (String)this.getMessage("53014508"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
for (DefaultPropertyEnum default_property : DefaultPropertyEnum.values()) {
|
for (DefaultPropertyEnum default_property : DefaultPropertyEnum.values()) {
|
||||||
Optional<ImgStorePersonProperties> requiredOptional = dbPersonProList.stream().filter(property -> default_property.getValue().equals(property.getCode())).findFirst();
|
Optional<ImgStorePersonProperties> requiredOptional = dbPersonProList.stream().filter(property -> default_property.getValue().equals(property.getCode())).findFirst();
|
||||||
if (requiredOptional.isPresent()) continue;
|
if (requiredOptional.isPresent()) continue;
|
||||||
this.logger.warn("{}未勾选,注册属性Id列表:[{}]", (Object)default_property.getDescription(), (Object)JSONObject.toJSONString((Object)param.getPropertyIdList()));
|
this.logger.warn("{}未勾选,注册属性Id列表:[{}]", (Object)default_property.getDescription(), (Object)JSONObject.toJSONString((Object)param.getPropertyIdList()));
|
||||||
return CloudwalkResult.fail((String)"53014511", (String)("注册属性" + default_property.getDescription() + "必须勾选"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
if (Objects.equals(param.getDeviceStatus(), StatusEnum.CLOSE.getValue()) || Objects.equals(param.getCodeStatus(), StatusEnum.CLOSE.getValue())) {
|
if (Objects.equals(param.getDeviceStatus(), StatusEnum.CLOSE.getValue()) || Objects.equals(param.getCodeStatus(), StatusEnum.CLOSE.getValue())) {
|
||||||
ImgStorePersonProperties queryPersonPro = new ImgStorePersonProperties();
|
ImgStorePersonProperties queryPersonPro = new ImgStorePersonProperties();
|
||||||
@@ -104,14 +104,14 @@ implements IPersonRegistryHandler {
|
|||||||
List requiredPersonProIdList = Collections3.extractToList((Collection)requiredPersonProList, (String)"id");
|
List requiredPersonProIdList = Collections3.extractToList((Collection)requiredPersonProList, (String)"id");
|
||||||
if ((dbPersonProList = dbPersonProList.stream().filter(pro -> requiredPersonProIdList.contains(pro.getId())).collect(Collectors.toList())).size() != requiredPersonProList.size()) {
|
if ((dbPersonProList = dbPersonProList.stream().filter(pro -> requiredPersonProIdList.contains(pro.getId())).collect(Collectors.toList())).size() != requiredPersonProList.size()) {
|
||||||
this.logger.warn("设备注册审核和扫码注册审核未同时打开,有未勾选的必填属性,注册属性Id列表:[{}]", (Object)JSONObject.toJSONString((Object)param.getPropertyIdList()));
|
this.logger.warn("设备注册审核和扫码注册审核未同时打开,有未勾选的必填属性,注册属性Id列表:[{}]", (Object)JSONObject.toJSONString((Object)param.getPropertyIdList()));
|
||||||
return CloudwalkResult.fail((String)"53014511", (String)this.getMessage("53014511"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.commonPersonRegistryService.validateOrg(param);
|
this.commonPersonRegistryService.validateOrg(param);
|
||||||
this.commonPersonRegistryService.validateLabel(param);
|
this.commonPersonRegistryService.validateLabel(param);
|
||||||
this.commonPersonRegistryService.validateDevice(param, context);
|
this.commonPersonRegistryService.validateDevice(param, context);
|
||||||
return CloudwalkResult.success((Object)true);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
private CloudwalkResult<Boolean> insert(AddPersonRegistryParam param, CloudwalkCallContext context) throws ServiceException {
|
private CloudwalkResult<Boolean> insert(AddPersonRegistryParam param, CloudwalkCallContext context) throws ServiceException {
|
||||||
@@ -119,14 +119,14 @@ implements IPersonRegistryHandler {
|
|||||||
this.commonPersonRegistryService.insertPersonRegistry(id, param, context);
|
this.commonPersonRegistryService.insertPersonRegistry(id, param, context);
|
||||||
this.commonPersonRegistryService.batchInsertPersonRegistryProperty(id, param);
|
this.commonPersonRegistryService.batchInsertPersonRegistryProperty(id, param);
|
||||||
this.commonPersonRegistryService.batchInsertPersonRegistryDevice(id, param, context, false);
|
this.commonPersonRegistryService.batchInsertPersonRegistryDevice(id, param, context, false);
|
||||||
return CloudwalkResult.success((Object)true);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
private CloudwalkResult<Boolean> update(AddPersonRegistryParam param, CloudwalkCallContext context) throws ServiceException {
|
private CloudwalkResult<Boolean> update(AddPersonRegistryParam param, CloudwalkCallContext context) throws ServiceException {
|
||||||
this.commonPersonRegistryService.updatePersonRegistry(param, context);
|
this.commonPersonRegistryService.updatePersonRegistry(param, context);
|
||||||
this.commonPersonRegistryService.batchUpdatePersonRegistryProperty(param);
|
this.commonPersonRegistryService.batchUpdatePersonRegistryProperty(param);
|
||||||
this.commonPersonRegistryService.batchUpdatePersonRegistryDevice(param, context, false);
|
this.commonPersonRegistryService.batchUpdatePersonRegistryDevice(param, context, false);
|
||||||
return CloudwalkResult.success((Object)true);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
@CloudwalkParamsValidate
|
@CloudwalkParamsValidate
|
||||||
@@ -142,7 +142,7 @@ implements IPersonRegistryHandler {
|
|||||||
List personPropertyList = this.imgStorePersonPropertiesMapper.select(queryPersonPro);
|
List personPropertyList = this.imgStorePersonPropertiesMapper.select(queryPersonPro);
|
||||||
if (CollectionUtils.isEmpty((Collection)personPropertyList)) {
|
if (CollectionUtils.isEmpty((Collection)personPropertyList)) {
|
||||||
this.logger.warn("不存在人员属性");
|
this.logger.warn("不存在人员属性");
|
||||||
return CloudwalkResult.fail((String)"53014524", (String)this.getMessage("53014524"));
|
return (CloudwalkResult) CloudwalkResult.fail($$$);
|
||||||
}
|
}
|
||||||
List<PersonPropertiesResult> proResultList = BeanCopyUtils.copy((Collection)personPropertyList, PersonPropertiesResult.class);
|
List<PersonPropertiesResult> proResultList = BeanCopyUtils.copy((Collection)personPropertyList, PersonPropertiesResult.class);
|
||||||
proResultList.forEach(propertyResult -> {
|
proResultList.forEach(propertyResult -> {
|
||||||
@@ -184,7 +184,7 @@ implements IPersonRegistryHandler {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return CloudwalkResult.success((Object)result);
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
@CloudwalkParamsValidate
|
@CloudwalkParamsValidate
|
||||||
@@ -195,7 +195,7 @@ implements IPersonRegistryHandler {
|
|||||||
}
|
}
|
||||||
PersonRegistry dbPersonRegistry = (PersonRegistry)this.commonPersonRegistryService.getResultByBusinessAndType(businessId, RegistryTypeEnum.SELF_REGISTRY.getValue()).getData();
|
PersonRegistry dbPersonRegistry = (PersonRegistry)this.commonPersonRegistryService.getResultByBusinessAndType(businessId, RegistryTypeEnum.SELF_REGISTRY.getValue()).getData();
|
||||||
this.commonPersonRegistryService.validateDevice(param, dbPersonRegistry);
|
this.commonPersonRegistryService.validateDevice(param, dbPersonRegistry);
|
||||||
return CloudwalkResult.success(this.getPersonPropertyList(dbPersonRegistry, true));
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
@CloudwalkParamsValidate
|
@CloudwalkParamsValidate
|
||||||
@@ -205,7 +205,7 @@ implements IPersonRegistryHandler {
|
|||||||
businessId = context.getCompany().getCompanyId();
|
businessId = context.getCompany().getCompanyId();
|
||||||
}
|
}
|
||||||
PersonRegistry dbPersonRegistry = (PersonRegistry)this.commonPersonRegistryService.getResultByBusinessAndType(businessId, RegistryTypeEnum.SELF_REGISTRY.getValue()).getData();
|
PersonRegistry dbPersonRegistry = (PersonRegistry)this.commonPersonRegistryService.getResultByBusinessAndType(businessId, RegistryTypeEnum.SELF_REGISTRY.getValue()).getData();
|
||||||
return CloudwalkResult.success(this.getPersonPropertyList(dbPersonRegistry, false));
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<PersonPropertiesResult> getPersonPropertyList(PersonRegistry personRegistry, boolean isChecked) {
|
private List<PersonPropertiesResult> getPersonPropertyList(PersonRegistry personRegistry, boolean isChecked) {
|
||||||
@@ -245,7 +245,7 @@ implements IPersonRegistryHandler {
|
|||||||
List<PersonPropertiesResult> propertyList = this.getPersonPropertyList(dbPersonRegistry, true);
|
List<PersonPropertiesResult> propertyList = this.getPersonPropertyList(dbPersonRegistry, true);
|
||||||
AtomicReference result = new AtomicReference();
|
AtomicReference result = new AtomicReference();
|
||||||
propertyList.stream().filter(property -> UniquePropertyEnum.hasProperty((String)property.getCode())).findFirst().ifPresent(personPropertiesResult -> result.set(personPropertiesResult));
|
propertyList.stream().filter(property -> UniquePropertyEnum.hasProperty((String)property.getCode())).findFirst().ifPresent(personPropertiesResult -> result.set(personPropertiesResult));
|
||||||
return CloudwalkResult.success(result.get());
|
return (CloudwalkResult) CloudwalkResult.success($$$);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloudwalkResult<PersonPropertiesResult> getBindProperty(QueryPersonRegistryParam param, CloudwalkCallContext context) throws ServiceException {
|
public CloudwalkResult<PersonPropertiesResult> getBindProperty(QueryPersonRegistryParam param, CloudwalkCallContext context) throws ServiceException {
|
||||||
|
|||||||
-586
@@ -1,586 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*
|
|
||||||
* Could not load the following classes:
|
|
||||||
* cn.cloudwalk.client.aggregate.application.service.ApplicationImageStoreService
|
|
||||||
* cn.cloudwalk.client.aggregate.common.enums.DelStatusEnum
|
|
||||||
* cn.cloudwalk.client.aggregate.common.enums.GroupModelStatusEnum
|
|
||||||
* cn.cloudwalk.client.aggregate.group.param.AgImageStoreImageSyncParam
|
|
||||||
* cn.cloudwalk.client.aggregate.group.result.AgImageStoreImageResult
|
|
||||||
* cn.cloudwalk.client.aggregate.group.service.AgImageStoreImageService
|
|
||||||
* cn.cloudwalk.client.aggregate.group.service.AgImageStoreService
|
|
||||||
* cn.cloudwalk.client.organization.common.enums.CpImageStoreMatchPatternEnum
|
|
||||||
* cn.cloudwalk.client.organization.result.BatchSearchFaceResult
|
|
||||||
* cn.cloudwalk.client.organization.result.SearchFaceResult
|
|
||||||
* cn.cloudwalk.client.organization.service.store.param.CpSearchFaceParam
|
|
||||||
* cn.cloudwalk.client.organization.service.store.result.AssociatedResult
|
|
||||||
* cn.cloudwalk.client.organization.service.store.service.CpImageStoreToolService
|
|
||||||
* cn.cloudwalk.cloud.context.CloudwalkCallContext
|
|
||||||
* cn.cloudwalk.cloud.exception.ServiceException
|
|
||||||
* cn.cloudwalk.cloud.result.CloudwalkResult
|
|
||||||
* cn.cloudwalk.cloud.utils.BeanCopyUtils
|
|
||||||
* cn.cloudwalk.data.organization.dto.GetsImageStoreAssociatedDTO
|
|
||||||
* cn.cloudwalk.data.organization.dto.GroupPersonRefDTO
|
|
||||||
* cn.cloudwalk.data.organization.dto.ImgStorePersonQueryDto
|
|
||||||
* cn.cloudwalk.data.organization.dto.LabelCriteriesDTO
|
|
||||||
* cn.cloudwalk.data.organization.dto.OrgCriteriesDTO
|
|
||||||
* cn.cloudwalk.data.organization.dto.QueryGroupPersonDTO
|
|
||||||
* cn.cloudwalk.data.organization.entity.GroupPersonRef
|
|
||||||
* cn.cloudwalk.data.organization.entity.ImgStorePersonLabel
|
|
||||||
* cn.cloudwalk.data.organization.entity.ImgStorePersonOrganization
|
|
||||||
* cn.cloudwalk.data.organization.entity.IsImageStoreAssociated
|
|
||||||
* cn.cloudwalk.data.organization.mapper.DevicePersonSyncLogMapper
|
|
||||||
* cn.cloudwalk.data.organization.mapper.GroupPersonRefMapper
|
|
||||||
* cn.cloudwalk.data.organization.mapper.ImgStorePersonLabelMapper
|
|
||||||
* cn.cloudwalk.data.organization.mapper.ImgStorePersonMapper
|
|
||||||
* cn.cloudwalk.data.organization.mapper.ImgStorePersonOrganizationMapper
|
|
||||||
* cn.cloudwalk.data.organization.mapper.IsImageStoreAssociatedMapper
|
|
||||||
* cn.cloudwalk.service.organization.common.AbstractImagStoreService
|
|
||||||
* cn.cloudwalk.service.organization.service.CpImageStorePersonTxHandler
|
|
||||||
* cn.cloudwalk.service.organization.service.CpImageStoreSyncManager
|
|
||||||
* com.alibaba.fastjson.JSONObject
|
|
||||||
* javax.annotation.PostConstruct
|
|
||||||
* javax.annotation.Resource
|
|
||||||
* org.springframework.beans.factory.annotation.Autowired
|
|
||||||
* org.springframework.data.redis.core.StringRedisTemplate
|
|
||||||
* org.springframework.stereotype.Service
|
|
||||||
* org.springframework.transaction.annotation.Isolation
|
|
||||||
* org.springframework.transaction.annotation.Transactional
|
|
||||||
* org.springframework.transaction.support.TransactionSynchronizationManager
|
|
||||||
* org.springframework.util.CollectionUtils
|
|
||||||
* org.springframework.util.StringUtils
|
|
||||||
* org.springside.modules.utils.Collections3
|
|
||||||
*/
|
|
||||||
package cn.cloudwalk.service.organization.service;
|
|
||||||
|
|
||||||
import cn.cloudwalk.client.aggregate.application.service.ApplicationImageStoreService;
|
|
||||||
import cn.cloudwalk.client.aggregate.common.enums.DelStatusEnum;
|
|
||||||
import cn.cloudwalk.client.aggregate.common.enums.GroupModelStatusEnum;
|
|
||||||
import cn.cloudwalk.client.aggregate.group.param.AgImageStoreImageSyncParam;
|
|
||||||
import cn.cloudwalk.client.aggregate.group.result.AgImageStoreImageResult;
|
|
||||||
import cn.cloudwalk.client.aggregate.group.service.AgImageStoreImageService;
|
|
||||||
import cn.cloudwalk.client.aggregate.group.service.AgImageStoreService;
|
|
||||||
import cn.cloudwalk.client.organization.common.enums.CpImageStoreMatchPatternEnum;
|
|
||||||
import cn.cloudwalk.client.organization.result.BatchSearchFaceResult;
|
|
||||||
import cn.cloudwalk.client.organization.result.SearchFaceResult;
|
|
||||||
import cn.cloudwalk.client.organization.service.store.param.CpSearchFaceParam;
|
|
||||||
import cn.cloudwalk.client.organization.service.store.result.AssociatedResult;
|
|
||||||
import cn.cloudwalk.client.organization.service.store.service.CpImageStoreToolService;
|
|
||||||
import cn.cloudwalk.cloud.context.CloudwalkCallContext;
|
|
||||||
import cn.cloudwalk.cloud.exception.ServiceException;
|
|
||||||
import cn.cloudwalk.cloud.result.CloudwalkResult;
|
|
||||||
import cn.cloudwalk.cloud.utils.BeanCopyUtils;
|
|
||||||
import cn.cloudwalk.data.organization.dto.GetsImageStoreAssociatedDTO;
|
|
||||||
import cn.cloudwalk.data.organization.dto.GroupPersonRefDTO;
|
|
||||||
import cn.cloudwalk.data.organization.dto.ImgStorePersonQueryDto;
|
|
||||||
import cn.cloudwalk.data.organization.dto.LabelCriteriesDTO;
|
|
||||||
import cn.cloudwalk.data.organization.dto.OrgCriteriesDTO;
|
|
||||||
import cn.cloudwalk.data.organization.dto.QueryGroupPersonDTO;
|
|
||||||
import cn.cloudwalk.data.organization.entity.GroupPersonRef;
|
|
||||||
import cn.cloudwalk.data.organization.entity.ImgStorePersonLabel;
|
|
||||||
import cn.cloudwalk.data.organization.entity.ImgStorePersonOrganization;
|
|
||||||
import cn.cloudwalk.data.organization.entity.IsImageStoreAssociated;
|
|
||||||
import cn.cloudwalk.data.organization.mapper.DevicePersonSyncLogMapper;
|
|
||||||
import cn.cloudwalk.data.organization.mapper.GroupPersonRefMapper;
|
|
||||||
import cn.cloudwalk.data.organization.mapper.ImgStorePersonLabelMapper;
|
|
||||||
import cn.cloudwalk.data.organization.mapper.ImgStorePersonMapper;
|
|
||||||
import cn.cloudwalk.data.organization.mapper.ImgStorePersonOrganizationMapper;
|
|
||||||
import cn.cloudwalk.data.organization.mapper.IsImageStoreAssociatedMapper;
|
|
||||||
import cn.cloudwalk.service.organization.common.AbstractImagStoreService;
|
|
||||||
import cn.cloudwalk.service.organization.service.CpImageStorePersonTxHandler;
|
|
||||||
import cn.cloudwalk.service.organization.service.CpImageStoreSyncManager;
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
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.Optional;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
import javax.annotation.PostConstruct;
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.springframework.transaction.annotation.Isolation;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
import org.springframework.transaction.support.TransactionSynchronizationManager;
|
|
||||||
import org.springframework.util.CollectionUtils;
|
|
||||||
import org.springframework.util.StringUtils;
|
|
||||||
import org.springside.modules.utils.Collections3;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class CpImageStorePersonManager
|
|
||||||
extends AbstractImagStoreService {
|
|
||||||
private static final String LAST_SYNC_IMAGE_KEY = "cp_image_syn_last_flag";
|
|
||||||
@Autowired
|
|
||||||
private AgImageStoreService agImageStoreService;
|
|
||||||
@Autowired
|
|
||||||
private AgImageStoreImageService agImageStoreImageService;
|
|
||||||
@Autowired
|
|
||||||
private IsImageStoreAssociatedMapper imageStoreAssociatedMapper;
|
|
||||||
@Autowired
|
|
||||||
private ImgStorePersonLabelMapper imgStorePersonLabelMapper;
|
|
||||||
@Autowired
|
|
||||||
private ImgStorePersonMapper personMapper;
|
|
||||||
@Autowired
|
|
||||||
private ImgStorePersonOrganizationMapper imgStorePersonOrganizationMapper;
|
|
||||||
@Autowired
|
|
||||||
private GroupPersonRefMapper groupPersonRefMapper;
|
|
||||||
@Resource
|
|
||||||
private DevicePersonSyncLogMapper devicePersonSyncLogMapper;
|
|
||||||
@Autowired
|
|
||||||
private CpImageStoreSyncManager cpImageStoreSyncManager;
|
|
||||||
@Resource
|
|
||||||
private CpImageStorePersonTxHandler cpImageStorePersonTxHandler;
|
|
||||||
@Autowired
|
|
||||||
private StringRedisTemplate redisTemplate;
|
|
||||||
@Resource
|
|
||||||
private CpImageStoreToolService cpImageStoreToolService;
|
|
||||||
@Resource
|
|
||||||
private ApplicationImageStoreService appImageStoreService;
|
|
||||||
private CloudwalkCallContext context;
|
|
||||||
|
|
||||||
@PostConstruct
|
|
||||||
public void init() {
|
|
||||||
this.context = this.getCloudwalkContext();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Set<String> getImageStoreIdsByObjId(String objId, Integer associatedAction) {
|
|
||||||
HashSet<String> imageStoreIdSet = new HashSet<String>();
|
|
||||||
GetsImageStoreAssociatedDTO associatedParam = new GetsImageStoreAssociatedDTO();
|
|
||||||
associatedParam.setAssociatedObjectId(objId);
|
|
||||||
associatedParam.setAssociatedAction(associatedAction);
|
|
||||||
List associatedList = this.imageStoreAssociatedMapper.gets(associatedParam);
|
|
||||||
if (CollectionUtils.isEmpty((Collection)associatedList)) {
|
|
||||||
return imageStoreIdSet;
|
|
||||||
}
|
|
||||||
associatedList.parallelStream().forEach(associated -> imageStoreIdSet.add(associated.getImageStoreId()));
|
|
||||||
return imageStoreIdSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Transactional(rollbackFor={Exception.class}, isolation=Isolation.READ_COMMITTED)
|
|
||||||
public Map<String, GroupPersonRef> getGroupPersonRefByPersons(String imageStoreId, List<String> personIds) {
|
|
||||||
HashMap<String, GroupPersonRef> personResultMap = new HashMap<String, GroupPersonRef>(500);
|
|
||||||
personIds.stream().forEach(personId -> {
|
|
||||||
GroupPersonRef groupPersonRef;
|
|
||||||
List<String> associatedObjectIds = this.getAssociatedObjectIdsByPersonId((String)personId);
|
|
||||||
GetsImageStoreAssociatedDTO associatedParam = new GetsImageStoreAssociatedDTO();
|
|
||||||
associatedParam.setImageStoreId(imageStoreId);
|
|
||||||
associatedParam.setAssociatedObjectIds(associatedObjectIds);
|
|
||||||
List associatedList = this.imageStoreAssociatedMapper.gets(associatedParam);
|
|
||||||
if (Collections3.isNotEmpty((Collection)associatedList) && (groupPersonRef = this.matchGroupPersonRef(imageStoreId, (String)personId, associatedList)) != null) {
|
|
||||||
personResultMap.put((String)personId, groupPersonRef);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return personResultMap;
|
|
||||||
}
|
|
||||||
|
|
||||||
private List<String> getAssociatedObjectIdsByPersonId(String personId) {
|
|
||||||
ArrayList<String> associatedObjectIds = new ArrayList<String>();
|
|
||||||
ImgStorePersonOrganization personOrgParam = new ImgStorePersonOrganization();
|
|
||||||
personOrgParam.setPersonId(personId);
|
|
||||||
List personOrgResult = this.imgStorePersonOrganizationMapper.select(personOrgParam);
|
|
||||||
if (!CollectionUtils.isEmpty((Collection)personOrgResult)) {
|
|
||||||
associatedObjectIds.addAll(Collections3.extractToList((Collection)personOrgResult, (String)"orgId"));
|
|
||||||
}
|
|
||||||
ImgStorePersonLabel personLabelParam = new ImgStorePersonLabel();
|
|
||||||
personLabelParam.setPersonId(personId);
|
|
||||||
List personLabelResult = this.imgStorePersonLabelMapper.select(personLabelParam);
|
|
||||||
if (!CollectionUtils.isEmpty((Collection)personLabelResult)) {
|
|
||||||
associatedObjectIds.addAll(Collections3.extractToList((Collection)personLabelResult, (String)"labelId"));
|
|
||||||
}
|
|
||||||
associatedObjectIds.add(personId);
|
|
||||||
return associatedObjectIds;
|
|
||||||
}
|
|
||||||
|
|
||||||
private GroupPersonRef matchGroupPersonRef(String imageStoreId, String personId, List<IsImageStoreAssociated> associatedList) {
|
|
||||||
String matchPattern = CpImageStoreMatchPatternEnum.UNITE.getCode();
|
|
||||||
GetsImageStoreAssociatedDTO matchParam = new GetsImageStoreAssociatedDTO();
|
|
||||||
matchParam.setImageStoreId(imageStoreId);
|
|
||||||
matchParam.setAssociatedObjectIdType(Integer.valueOf(4));
|
|
||||||
List matchResultList = this.imageStoreAssociatedMapper.gets(matchParam);
|
|
||||||
if (matchResultList != null && matchResultList.size() > 0) {
|
|
||||||
matchPattern = ((IsImageStoreAssociated)matchResultList.get(0)).getAssociatedObjectId();
|
|
||||||
}
|
|
||||||
GetsImageStoreAssociatedDTO imageStoreAssociatedDTO = new GetsImageStoreAssociatedDTO();
|
|
||||||
imageStoreAssociatedDTO.setImageStoreId(imageStoreId);
|
|
||||||
imageStoreAssociatedDTO.setAssociatedAction(Integer.valueOf(0));
|
|
||||||
imageStoreAssociatedDTO.setAssociatedObjectIdType(Integer.valueOf(5));
|
|
||||||
List imageStoreAssociatedList = this.imageStoreAssociatedMapper.gets(imageStoreAssociatedDTO);
|
|
||||||
IsImageStoreAssociated imageStoreAssociated = CollectionUtils.isEmpty((Collection)imageStoreAssociatedList) ? new IsImageStoreAssociated() : (IsImageStoreAssociated)imageStoreAssociatedList.get(0);
|
|
||||||
int includeLabelNum = 0;
|
|
||||||
int includeOrganizationNum = 0;
|
|
||||||
int includePersonNum = 0;
|
|
||||||
int excludeLabelNum = 0;
|
|
||||||
int excludePersonNum = 0;
|
|
||||||
GroupPersonRef groupPersonRef = new GroupPersonRef();
|
|
||||||
groupPersonRef.setImageStoreId(imageStoreId);
|
|
||||||
groupPersonRef.setPersonId(personId);
|
|
||||||
groupPersonRef.setStatus(Short.valueOf((short)0));
|
|
||||||
groupPersonRef.setExpiryBeginDate(imageStoreAssociated.getExpiryBeginDate());
|
|
||||||
groupPersonRef.setExpiryEndDate(imageStoreAssociated.getExpiryEndDate());
|
|
||||||
groupPersonRef.setValidDateCron(imageStoreAssociated.getValidDateCron());
|
|
||||||
groupPersonRef.setStatus(Short.valueOf(this.checkGroupPersonStatus(imageStoreAssociated.getExpiryBeginDate(), imageStoreAssociated.getExpiryEndDate())));
|
|
||||||
for (IsImageStoreAssociated associated : associatedList) {
|
|
||||||
if (0 == associated.getAssociatedAction()) {
|
|
||||||
if (1 == associated.getAssociatedObjectIdType()) {
|
|
||||||
++includeOrganizationNum;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (2 == associated.getAssociatedObjectIdType()) {
|
|
||||||
++includeLabelNum;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (3 != associated.getAssociatedObjectIdType()) continue;
|
|
||||||
++includePersonNum;
|
|
||||||
groupPersonRef.setExpiryBeginDate(associated.getExpiryBeginDate());
|
|
||||||
groupPersonRef.setExpiryEndDate(associated.getExpiryEndDate());
|
|
||||||
groupPersonRef.setValidDateCron(associated.getValidDateCron());
|
|
||||||
groupPersonRef.setStatus(Short.valueOf(this.checkGroupPersonStatus(associated.getExpiryBeginDate(), associated.getExpiryEndDate())));
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (1 != associated.getAssociatedAction()) continue;
|
|
||||||
if (2 == associated.getAssociatedObjectIdType()) {
|
|
||||||
++excludeLabelNum;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (3 != associated.getAssociatedObjectIdType()) continue;
|
|
||||||
++excludePersonNum;
|
|
||||||
}
|
|
||||||
boolean match = false;
|
|
||||||
if (CpImageStoreMatchPatternEnum.UNITE.getCode().equals(matchPattern)) {
|
|
||||||
if (includeLabelNum > 0 && includeOrganizationNum > 0) {
|
|
||||||
match = true;
|
|
||||||
}
|
|
||||||
} else if (includeLabelNum > 0 || includeOrganizationNum > 0) {
|
|
||||||
match = true;
|
|
||||||
}
|
|
||||||
if (excludeLabelNum > 0) {
|
|
||||||
match = false;
|
|
||||||
}
|
|
||||||
if (includePersonNum > 0) {
|
|
||||||
match = true;
|
|
||||||
}
|
|
||||||
if (excludePersonNum > 0) {
|
|
||||||
match = false;
|
|
||||||
}
|
|
||||||
if (match) {
|
|
||||||
return groupPersonRef;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String, GroupPersonRef> getImageStoreIdsByPerson(String personId) {
|
|
||||||
HashMap<String, GroupPersonRef> personResultMap = new HashMap<String, GroupPersonRef>(500);
|
|
||||||
List<String> associatedObjectIds = this.getAssociatedObjectIdsByPersonId(personId);
|
|
||||||
GetsImageStoreAssociatedDTO associatedParam = new GetsImageStoreAssociatedDTO();
|
|
||||||
associatedParam.setAssociatedObjectIds(associatedObjectIds);
|
|
||||||
List associatedList = this.imageStoreAssociatedMapper.gets(associatedParam);
|
|
||||||
if (CollectionUtils.isEmpty((Collection)associatedList)) {
|
|
||||||
return personResultMap;
|
|
||||||
}
|
|
||||||
Map<String, List<IsImageStoreAssociated>> imageStoreAssociatedMap = associatedList.stream().collect(Collectors.groupingBy(IsImageStoreAssociated::getImageStoreId));
|
|
||||||
imageStoreAssociatedMap.keySet().forEach(key -> {
|
|
||||||
GroupPersonRef groupPersonRef = this.matchGroupPersonRef((String)key, personId, (List)imageStoreAssociatedMap.get(key));
|
|
||||||
if (groupPersonRef != null) {
|
|
||||||
personResultMap.put((String)key, groupPersonRef);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return personResultMap;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Transactional(rollbackFor={Exception.class}, isolation=Isolation.READ_COMMITTED)
|
|
||||||
public Map<String, GroupPersonRef> getCurrentAssociatedPersonIds(String imageStoreId) {
|
|
||||||
IsImageStoreAssociated finalIncludeImageStoreAssociated;
|
|
||||||
HashSet addPersonIds;
|
|
||||||
GetsImageStoreAssociatedDTO getsImageStoreAssociatedDTO = new GetsImageStoreAssociatedDTO();
|
|
||||||
getsImageStoreAssociatedDTO.setImageStoreId(imageStoreId);
|
|
||||||
List associatedList = this.imageStoreAssociatedMapper.gets(getsImageStoreAssociatedDTO);
|
|
||||||
String matchPattern = null;
|
|
||||||
ArrayList<String> includeLabelIds = new ArrayList<String>();
|
|
||||||
ArrayList<String> includeOrganizationIds = new ArrayList<String>();
|
|
||||||
ArrayList<String> includePersonIds = new ArrayList<String>();
|
|
||||||
HashMap<String, AssociatedResult> includePersonMap = new HashMap<String, AssociatedResult>();
|
|
||||||
ArrayList<String> excludeLabelIds = new ArrayList<String>();
|
|
||||||
ArrayList<String> excludePersonIds = new ArrayList<String>();
|
|
||||||
IsImageStoreAssociated includeImageStoreAssociated = null;
|
|
||||||
for (IsImageStoreAssociated associated : associatedList) {
|
|
||||||
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;
|
|
||||||
includeImageStoreAssociated = associated;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (1 != associated.getAssociatedAction()) continue;
|
|
||||||
if (2 == associated.getAssociatedObjectIdType()) {
|
|
||||||
excludeLabelIds.add(associated.getAssociatedObjectId());
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (3 != associated.getAssociatedObjectIdType()) continue;
|
|
||||||
excludePersonIds.add(associated.getAssociatedObjectId());
|
|
||||||
}
|
|
||||||
LabelCriteriesDTO criteries = new LabelCriteriesDTO();
|
|
||||||
HashMap<String, GroupPersonRef> personResultMap = new HashMap<String, GroupPersonRef>(500);
|
|
||||||
Set addLabelPersonIds = null;
|
|
||||||
Set addOrgPersonIds = null;
|
|
||||||
if (!CollectionUtils.isEmpty(includeLabelIds)) {
|
|
||||||
criteries.setLabelList(includeLabelIds);
|
|
||||||
addLabelPersonIds = this.imgStorePersonLabelMapper.getPersonIdsByLabelAndCriteries(criteries);
|
|
||||||
}
|
|
||||||
if (!CollectionUtils.isEmpty(includeOrganizationIds)) {
|
|
||||||
OrgCriteriesDTO orgCriteries = new OrgCriteriesDTO();
|
|
||||||
orgCriteries.setOrgIds(includeOrganizationIds);
|
|
||||||
addOrgPersonIds = this.imgStorePersonOrganizationMapper.getPersonIdsByOrgIdsAndCriteries(orgCriteries);
|
|
||||||
}
|
|
||||||
if (CpImageStoreMatchPatternEnum.UNITE.getCode().equals(matchPattern)) {
|
|
||||||
if (addLabelPersonIds != null && addOrgPersonIds != null) {
|
|
||||||
addPersonIds = new HashSet(500);
|
|
||||||
addPersonIds.addAll(addLabelPersonIds);
|
|
||||||
addPersonIds.retainAll(addOrgPersonIds);
|
|
||||||
finalIncludeImageStoreAssociated = includeImageStoreAssociated;
|
|
||||||
addPersonIds.forEach(personId -> {
|
|
||||||
GroupPersonRef groupPersonRef = new GroupPersonRef();
|
|
||||||
groupPersonRef.setImageStoreId(imageStoreId);
|
|
||||||
groupPersonRef.setPersonId(personId);
|
|
||||||
groupPersonRef.setExpiryBeginDate((Long)Optional.ofNullable(finalIncludeImageStoreAssociated).map(associated -> associated.getExpiryBeginDate()).orElse(null));
|
|
||||||
groupPersonRef.setExpiryEndDate((Long)Optional.ofNullable(finalIncludeImageStoreAssociated).map(associated -> associated.getExpiryEndDate()).orElse(null));
|
|
||||||
groupPersonRef.setValidDateCron((String)Optional.ofNullable(finalIncludeImageStoreAssociated).map(associated -> associated.getValidDateCron()).orElse(null));
|
|
||||||
groupPersonRef.setStatus(Short.valueOf(this.checkGroupPersonStatus(groupPersonRef.getExpiryBeginDate(), groupPersonRef.getExpiryEndDate())));
|
|
||||||
personResultMap.put((String)personId, groupPersonRef);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
addPersonIds = new HashSet(500);
|
|
||||||
if (addLabelPersonIds != null) {
|
|
||||||
addPersonIds.addAll(addLabelPersonIds);
|
|
||||||
}
|
|
||||||
if (addOrgPersonIds != null) {
|
|
||||||
addPersonIds.addAll(addOrgPersonIds);
|
|
||||||
}
|
|
||||||
finalIncludeImageStoreAssociated = includeImageStoreAssociated;
|
|
||||||
addPersonIds.forEach(personId -> {
|
|
||||||
GroupPersonRef groupPersonRef = new GroupPersonRef();
|
|
||||||
groupPersonRef.setImageStoreId(imageStoreId);
|
|
||||||
groupPersonRef.setPersonId(personId);
|
|
||||||
groupPersonRef.setExpiryBeginDate((Long)Optional.ofNullable(finalIncludeImageStoreAssociated).map(associated -> associated.getExpiryBeginDate()).orElse(null));
|
|
||||||
groupPersonRef.setExpiryEndDate((Long)Optional.ofNullable(finalIncludeImageStoreAssociated).map(associated -> associated.getExpiryEndDate()).orElse(null));
|
|
||||||
groupPersonRef.setValidDateCron((String)Optional.ofNullable(finalIncludeImageStoreAssociated).map(associated -> associated.getValidDateCron()).orElse(null));
|
|
||||||
groupPersonRef.setStatus(Short.valueOf(this.checkGroupPersonStatus(groupPersonRef.getExpiryBeginDate(), groupPersonRef.getExpiryEndDate())));
|
|
||||||
personResultMap.put((String)personId, groupPersonRef);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (!CollectionUtils.isEmpty(excludeLabelIds)) {
|
|
||||||
criteries = new LabelCriteriesDTO();
|
|
||||||
criteries.setLabelList(excludeLabelIds);
|
|
||||||
Set removePersonIds = this.imgStorePersonLabelMapper.getPersonIdsByLabelAndCriteries(criteries);
|
|
||||||
removePersonIds.forEach(personResultMap::remove);
|
|
||||||
}
|
|
||||||
if (!CollectionUtils.isEmpty(includePersonIds)) {
|
|
||||||
ImgStorePersonQueryDto record = new ImgStorePersonQueryDto();
|
|
||||||
record.setIds(includePersonIds);
|
|
||||||
record.setIsDel(Short.valueOf((short)0));
|
|
||||||
List gets = this.personMapper.gets(record);
|
|
||||||
if (gets != null && gets.size() > 0) {
|
|
||||||
gets.forEach(imgStorePerson -> {
|
|
||||||
AssociatedResult associatedResult = (AssociatedResult)includePersonMap.get(imgStorePerson.getId());
|
|
||||||
GroupPersonRef groupPersonRef = new GroupPersonRef();
|
|
||||||
groupPersonRef.setImageStoreId(imageStoreId);
|
|
||||||
groupPersonRef.setPersonId(associatedResult.getObjectId());
|
|
||||||
groupPersonRef.setExpiryBeginDate(associatedResult.getExpiryBeginDate());
|
|
||||||
groupPersonRef.setExpiryEndDate(associatedResult.getExpiryEndDate());
|
|
||||||
groupPersonRef.setValidDateCron(associatedResult.getValidDateCron());
|
|
||||||
groupPersonRef.setStatus(Short.valueOf(this.checkGroupPersonStatus(associatedResult.getExpiryBeginDate(), associatedResult.getExpiryEndDate())));
|
|
||||||
personResultMap.put(imgStorePerson.getId(), groupPersonRef);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!CollectionUtils.isEmpty(excludePersonIds)) {
|
|
||||||
excludePersonIds.forEach(personResultMap::remove);
|
|
||||||
}
|
|
||||||
if (!TransactionSynchronizationManager.isActualTransactionActive()) {
|
|
||||||
this.logger.error("getCurrentAssociatedPersonIds\u63a5\u53e3 \u4e8b\u52a1\u672a\u751f\u6548");
|
|
||||||
}
|
|
||||||
return personResultMap;
|
|
||||||
}
|
|
||||||
|
|
||||||
Map<String, GroupPersonRef> getOldAssociatedPersonIds(String imageStoreId, List<String> personIds) {
|
|
||||||
QueryGroupPersonDTO queryGroupPersonDTO = new QueryGroupPersonDTO();
|
|
||||||
queryGroupPersonDTO.setImageStoreId(imageStoreId);
|
|
||||||
if (Collections3.isNotEmpty(personIds)) {
|
|
||||||
queryGroupPersonDTO.setPersonIds(personIds);
|
|
||||||
}
|
|
||||||
List oldPersonList = this.groupPersonRefMapper.query(queryGroupPersonDTO);
|
|
||||||
HashMap<String, GroupPersonRef> oldPersonResultMap = new HashMap<String, GroupPersonRef>(500);
|
|
||||||
oldPersonList.forEach(groupPersonRef -> oldPersonResultMap.put(groupPersonRef.getPersonId(), (GroupPersonRef)groupPersonRef));
|
|
||||||
return oldPersonResultMap;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void handleGroupPersonChange() throws ServiceException {
|
|
||||||
this.logger.info("\u5f00\u59cb\u56fe\u5e93\u56fe\u7247\u540c\u6b65:[{}]", (Object)System.currentTimeMillis());
|
|
||||||
Long lastSynTime = 0L;
|
|
||||||
String lastImageId = "0";
|
|
||||||
String lastImageStoreId = null;
|
|
||||||
ImgStorePersonQueryDto imgStorePersonQuery = null;
|
|
||||||
GroupPersonRef groupPersonRef = null;
|
|
||||||
AgImageStoreImageResult lastResult = null;
|
|
||||||
while (true) {
|
|
||||||
if (this.redisTemplate.hasKey((Object)LAST_SYNC_IMAGE_KEY).booleanValue()) {
|
|
||||||
String lastFlagValue = (String)this.redisTemplate.opsForValue().get((Object)LAST_SYNC_IMAGE_KEY);
|
|
||||||
lastSynTime = Long.valueOf(lastFlagValue.split(",")[0]);
|
|
||||||
lastImageId = lastFlagValue.split(",")[1];
|
|
||||||
this.logger.info("\u83b7\u53d6\u7f13\u5b58\u6570\u636e,key={},value={}", (Object)LAST_SYNC_IMAGE_KEY, (Object)lastFlagValue);
|
|
||||||
}
|
|
||||||
AgImageStoreImageSyncParam imageQuery = new AgImageStoreImageSyncParam();
|
|
||||||
imageQuery.setLastSynTime(lastSynTime);
|
|
||||||
imageQuery.setLastImageId(lastImageId);
|
|
||||||
imageQuery.setImageStoreId(lastImageStoreId);
|
|
||||||
CloudwalkResult imageQueryResult = this.agImageStoreImageService.sync(imageQuery);
|
|
||||||
if (!imageQueryResult.isSuccess()) {
|
|
||||||
this.logger.error("\u56fe\u5e93\u56fe\u7247\u540c\u6b65\u5931\u8d25,result:{}", (Object)JSONObject.toJSONString((Object)imageQueryResult));
|
|
||||||
throw new ServiceException(imageQueryResult.getCode(), imageQueryResult.getMessage());
|
|
||||||
}
|
|
||||||
List resultList = (List)imageQueryResult.getData();
|
|
||||||
if (CollectionUtils.isEmpty((Collection)resultList)) break;
|
|
||||||
for (AgImageStoreImageResult result : resultList) {
|
|
||||||
try {
|
|
||||||
boolean needChangeStatus;
|
|
||||||
imgStorePersonQuery = new ImgStorePersonQueryDto();
|
|
||||||
imgStorePersonQuery.setImageId(result.getImageId());
|
|
||||||
List getsResult = this.personMapper.gets(imgStorePersonQuery);
|
|
||||||
if (CollectionUtils.isEmpty((Collection)getsResult)) {
|
|
||||||
this.logger.warn("\u56fe\u5e93\u56fe\u7247\u540c\u6b65\u5931\u8d25,\u6839\u636eimageId:[{}]\u83b7\u53d6\u4e0d\u5230\u4eba\u5458\u4fe1\u606f", (Object)result.getImageId());
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
groupPersonRef = new GroupPersonRef();
|
|
||||||
groupPersonRef.setImageStoreId(result.getImageStoreId());
|
|
||||||
List groupPersonRefList = this.groupPersonRefMapper.selectByCondition(groupPersonRef, Collections3.extractToList((Collection)getsResult, (String)"id"));
|
|
||||||
if (CollectionUtils.isEmpty((Collection)groupPersonRefList)) {
|
|
||||||
this.logger.warn("\u56fe\u5e93\u56fe\u7247\u540c\u6b65\u5931\u8d25,\u6839\u636eimageStoreId:[{}],personId:[{}]\u83b7\u53d6\u4e0d\u5230\u56fe\u5e93\u4eba\u5458\u5217\u8868\u4fe1\u606f", (Object)result.getImageStoreId(), (Object)Collections3.extractToString((Collection)getsResult, (String)"id", (String)","));
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
groupPersonRef.setGender(result.getGender());
|
|
||||||
groupPersonRef.setAge(result.getAge());
|
|
||||||
groupPersonRef.setGroupTime(result.getGroupTime());
|
|
||||||
boolean bl = needChangeStatus = DelStatusEnum.DELETED.getCode().shortValue() == result.getIsDel().shortValue() && (GroupModelStatusEnum.MODEL_ING.getCode().shortValue() == result.getStatus().shortValue() || GroupModelStatusEnum.MODEL_COMPLETED.getCode().shortValue() == result.getStatus().shortValue());
|
|
||||||
if (needChangeStatus) {
|
|
||||||
groupPersonRef.setGroupStatus(GroupModelStatusEnum.MODEL_WAIT.getCode());
|
|
||||||
} else {
|
|
||||||
groupPersonRef.setGroupStatus(result.getStatus());
|
|
||||||
}
|
|
||||||
groupPersonRef.setErrorMessage(result.getErrorMessage());
|
|
||||||
this.groupPersonRefMapper.updateImageDataByIds(groupPersonRef, Collections3.extractToList((Collection)groupPersonRefList, (String)"id"));
|
|
||||||
}
|
|
||||||
catch (Exception e) {
|
|
||||||
this.logger.error("handleGroupPersonChange exception,imageStoreId:[{}],imageId:[{}]", new Object[]{result.getImageStoreId(), result.getImageId(), e});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
lastResult = (AgImageStoreImageResult)resultList.get(resultList.size() - 1);
|
|
||||||
if (null == lastResult) continue;
|
|
||||||
if (null == lastResult.getLastUpdateTime()) {
|
|
||||||
lastResult.setLastUpdateTime(lastSynTime);
|
|
||||||
this.logger.warn("\u6700\u540e\u66f4\u65b0\u65f6\u95f4\u4e3a\u7a7a,imageStoreId:[{}],imageId:[{}]", (Object)lastResult.getImageStoreId(), (Object)lastResult.getImageId());
|
|
||||||
}
|
|
||||||
this.redisTemplate.opsForValue().set((Object)LAST_SYNC_IMAGE_KEY, (Object)(lastResult.getLastUpdateTime() + "," + lastResult.getImageId()));
|
|
||||||
this.logger.info("\u8bbe\u7f6e\u7f13\u5b58\u6570\u636e,key={},value={}", (Object)LAST_SYNC_IMAGE_KEY, (Object)(lastResult.getLastUpdateTime() + "," + lastResult.getImageId()));
|
|
||||||
}
|
|
||||||
this.logger.warn("\u6ca1\u6709\u9700\u8981\u540c\u6b65\u7684\u56fe\u5e93\u56fe\u7247");
|
|
||||||
this.logger.info("\u7ed3\u675f\u56fe\u5e93\u56fe\u7247\u540c\u6b65:{}", (Object)System.currentTimeMillis());
|
|
||||||
}
|
|
||||||
|
|
||||||
public void handleGroupPersonChange2() throws ServiceException {
|
|
||||||
this.logger.info("\u5f00\u59cb\u56fe\u5e93\u56fe\u7247\u540c\u6b65:[{}]", (Object)System.currentTimeMillis());
|
|
||||||
Long syncTime = System.currentTimeMillis() - 600000L;
|
|
||||||
List syncList = this.groupPersonRefMapper.waitSyncList(syncTime);
|
|
||||||
if (CollectionUtils.isEmpty((Collection)syncList)) {
|
|
||||||
this.logger.warn("\u6ca1\u6709\u9700\u8981\u540c\u6b65\u7684\u56fe\u5e93\u56fe\u7247");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Map<String, List<GroupPersonRefDTO>> groupSyncList = syncList.stream().collect(Collectors.groupingBy(GroupPersonRef::getImageStoreId));
|
|
||||||
for (Map.Entry<String, List<GroupPersonRefDTO>> entry : groupSyncList.entrySet()) {
|
|
||||||
String imageStoreId = entry.getKey();
|
|
||||||
this.updateGroupPerson(imageStoreId, entry.getValue());
|
|
||||||
}
|
|
||||||
this.logger.info("\u7ed3\u675f\u56fe\u5e93\u56fe\u7247\u540c\u6b65:{}", (Object)System.currentTimeMillis());
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateGroupPerson(String imageStoreId, List<GroupPersonRefDTO> list) {
|
|
||||||
CpSearchFaceParam param = new CpSearchFaceParam();
|
|
||||||
param.setImageStoreId(imageStoreId);
|
|
||||||
param.setImageIds(String.join((CharSequence)",", Collections3.extractToList(list, (String)"imageId")));
|
|
||||||
List<SearchFaceResult> resultList = null;
|
|
||||||
if (list.size() > 1) {
|
|
||||||
CloudwalkResult batchSearchFaceResult = this.cpImageStoreToolService.batchSearchFace(param);
|
|
||||||
if (null == batchSearchFaceResult || !batchSearchFaceResult.isSuccess()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
resultList = ((BatchSearchFaceResult)batchSearchFaceResult.getData()).getItems();
|
|
||||||
} else {
|
|
||||||
CloudwalkResult searchFaceResult = this.cpImageStoreToolService.searchFace(param);
|
|
||||||
if (null == searchFaceResult || !searchFaceResult.isSuccess()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
resultList = Arrays.asList((SearchFaceResult)searchFaceResult.getData());
|
|
||||||
}
|
|
||||||
if (null == resultList) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
ImgStorePersonQueryDto imgStorePersonQuery = null;
|
|
||||||
GroupPersonRef groupPersonRef = null;
|
|
||||||
for (SearchFaceResult result : resultList) {
|
|
||||||
if (StringUtils.isEmpty((Object)result.getUserId())) {
|
|
||||||
this.logger.warn("\u56fe\u5e93\u56fe\u7247\u540c\u6b65\u5931\u8d25,imageId\u4e3a\u7a7a:[{}]", (Object)result.getUserId());
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
imgStorePersonQuery = new ImgStorePersonQueryDto();
|
|
||||||
imgStorePersonQuery.setImageId(result.getUserId());
|
|
||||||
List getsResult = this.personMapper.gets(imgStorePersonQuery);
|
|
||||||
if (CollectionUtils.isEmpty((Collection)getsResult)) {
|
|
||||||
this.logger.warn("\u56fe\u5e93\u56fe\u7247\u540c\u6b65\u5931\u8d25,\u6839\u636eimageId:[{}]\u83b7\u53d6\u4e0d\u5230\u4eba\u5458\u4fe1\u606f", (Object)result.getUserId());
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
groupPersonRef = new GroupPersonRef();
|
|
||||||
groupPersonRef.setImageStoreId(imageStoreId);
|
|
||||||
List groupPersonRefList = this.groupPersonRefMapper.selectByCondition(groupPersonRef, Collections3.extractToList((Collection)getsResult, (String)"id"));
|
|
||||||
if (CollectionUtils.isEmpty((Collection)groupPersonRefList)) {
|
|
||||||
this.logger.warn("\u56fe\u5e93\u56fe\u7247\u540c\u6b65\u5931\u8d25,\u6839\u636eimageStoreId:[{}],personId:[{}]\u83b7\u53d6\u4e0d\u5230\u56fe\u5e93\u4eba\u5458\u5217\u8868\u4fe1\u606f", (Object)imageStoreId, (Object)Collections3.extractToString((Collection)getsResult, (String)"id", (String)","));
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
groupPersonRef.setGroupStatus(GroupModelStatusEnum.MODEL_WAIT.getCode());
|
|
||||||
if (result.getResult() == 0) {
|
|
||||||
groupPersonRef.setGroupStatus(GroupModelStatusEnum.MODEL_COMPLETED.getCode());
|
|
||||||
}
|
|
||||||
groupPersonRef.setGroupTime(result.getTime());
|
|
||||||
groupPersonRef.setErrorMessage(result.getInfo());
|
|
||||||
if (!StringUtils.isEmpty((Object)result.getQualityScore())) {
|
|
||||||
List<String> qualityScoreList = Arrays.asList(result.getQualityScore().split(","));
|
|
||||||
groupPersonRef.setAge(Integer.valueOf(new BigDecimal(qualityScoreList.get(10)).setScale(0, 3).intValue()));
|
|
||||||
groupPersonRef.setGender(Short.valueOf(new BigDecimal(qualityScoreList.get(11)).shortValue()));
|
|
||||||
}
|
|
||||||
this.groupPersonRefMapper.updateImageDataByIds(groupPersonRef, Collections3.extractToList((Collection)groupPersonRefList, (String)"id"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-546
@@ -1,546 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*
|
|
||||||
* Could not load the following classes:
|
|
||||||
* cn.cloudwalk.client.aggregate.application.service.ApplicationImageStoreService
|
|
||||||
* cn.cloudwalk.client.aggregate.common.enums.DelStatusEnum
|
|
||||||
* cn.cloudwalk.client.aggregate.common.enums.SyncStatusEnum
|
|
||||||
* cn.cloudwalk.client.aggregate.group.param.AgImageStoreEditParam
|
|
||||||
* cn.cloudwalk.client.aggregate.group.param.AgImageStoreQueryParam
|
|
||||||
* cn.cloudwalk.client.aggregate.group.result.AgImageStoreResult
|
|
||||||
* cn.cloudwalk.client.aggregate.group.service.AgImageStoreService
|
|
||||||
* cn.cloudwalk.cloud.context.CloudwalkCallContext
|
|
||||||
* cn.cloudwalk.cloud.result.CloudwalkResult
|
|
||||||
* cn.cloudwalk.data.organization.dto.GroupPersonSynData
|
|
||||||
* cn.cloudwalk.data.organization.entity.GroupPersonRef
|
|
||||||
* cn.cloudwalk.data.organization.entity.ImgStorePerson
|
|
||||||
* cn.cloudwalk.data.organization.mapper.ImgStorePersonMapper
|
|
||||||
* cn.cloudwalk.service.organization.common.AbstractImagStoreService
|
|
||||||
* cn.cloudwalk.service.organization.common.JsonUtils
|
|
||||||
* cn.cloudwalk.service.organization.service.CpImageStorePersonTxHandler
|
|
||||||
* cn.cloudwalk.service.organization.service.CpImageStorePersonValidateManager
|
|
||||||
* cn.hutool.core.collection.CollectionUtil
|
|
||||||
* com.alibaba.fastjson.JSONObject
|
|
||||||
* com.google.common.collect.Lists
|
|
||||||
* com.google.common.collect.Sets
|
|
||||||
* javax.annotation.PostConstruct
|
|
||||||
* javax.annotation.Resource
|
|
||||||
* org.apache.commons.lang3.StringUtils
|
|
||||||
* org.springframework.beans.factory.annotation.Autowired
|
|
||||||
* org.springframework.beans.factory.annotation.Qualifier
|
|
||||||
* org.springframework.beans.factory.annotation.Value
|
|
||||||
* org.springframework.data.redis.connection.ReturnType
|
|
||||||
* org.springframework.data.redis.core.StringRedisTemplate
|
|
||||||
* org.springframework.data.redis.core.script.DefaultRedisScript
|
|
||||||
* org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
|
|
||||||
* org.springframework.stereotype.Service
|
|
||||||
* org.springside.modules.utils.Collections3
|
|
||||||
*/
|
|
||||||
package cn.cloudwalk.service.organization.service;
|
|
||||||
|
|
||||||
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.group.param.AgImageStoreEditParam;
|
|
||||||
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.cloud.context.CloudwalkCallContext;
|
|
||||||
import cn.cloudwalk.cloud.result.CloudwalkResult;
|
|
||||||
import cn.cloudwalk.data.organization.dto.GroupPersonSynData;
|
|
||||||
import cn.cloudwalk.data.organization.entity.GroupPersonRef;
|
|
||||||
import cn.cloudwalk.data.organization.entity.ImgStorePerson;
|
|
||||||
import cn.cloudwalk.data.organization.mapper.ImgStorePersonMapper;
|
|
||||||
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.CpImageStorePersonTxHandler;
|
|
||||||
import cn.cloudwalk.service.organization.service.CpImageStorePersonValidateManager;
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.google.common.collect.Lists;
|
|
||||||
import com.google.common.collect.Sets;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
import javax.annotation.PostConstruct;
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.beans.factory.annotation.Qualifier;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.data.redis.connection.ReturnType;
|
|
||||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
|
||||||
import org.springframework.data.redis.core.script.DefaultRedisScript;
|
|
||||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.springside.modules.utils.Collections3;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class CpImageStorePersonSynManager
|
|
||||||
extends AbstractImagStoreService {
|
|
||||||
public static final String TASK_IS_ALL = "isAll";
|
|
||||||
public static final String TASK_JSON_ADD_KEY = "addPersonIds";
|
|
||||||
public static final String TASK_JSON_MOD_KEY = "modPersonIds";
|
|
||||||
public static final String TASK_JSON_DEL_KEY = "delPersonIds";
|
|
||||||
private static final String WAIT_SYN_TASK_KEY = "group_person_wait_syn_task:";
|
|
||||||
private static final String SYN_QUEUE_HEAD_DATA = "group_person_syn_queue_head_data:";
|
|
||||||
@Value(value="${server.instance-id:null}")
|
|
||||||
private String serverInstanceId;
|
|
||||||
@Value(value="${group-person.syn.config.lock-handle-syn-task-second:150}")
|
|
||||||
private String lockHandleSynTaskSecond;
|
|
||||||
@Value(value="${group-person.syn.config.task_is_all.threshold:200}")
|
|
||||||
private int taskIsAllThreshold;
|
|
||||||
@Autowired
|
|
||||||
@Qualifier(value="groupPersonSynExecutor")
|
|
||||||
private ThreadPoolTaskExecutor taskExecutor;
|
|
||||||
@Autowired
|
|
||||||
private StringRedisTemplate redisTemplate;
|
|
||||||
@Autowired
|
|
||||||
private DefaultRedisScript<String> addWaitSynTaskRedisScript;
|
|
||||||
@Autowired
|
|
||||||
private DefaultRedisScript<String> lockHandleSynTaskRedisScript;
|
|
||||||
@Autowired
|
|
||||||
private DefaultRedisScript<String> lockHeadSynTaskRedisScript;
|
|
||||||
@Autowired
|
|
||||||
private DefaultRedisScript<String> handleSuccessSynTaskRedisScript;
|
|
||||||
@Autowired
|
|
||||||
private DefaultRedisScript<String> handleFailSynTaskRedisScript;
|
|
||||||
@Autowired
|
|
||||||
private DefaultRedisScript<String> refreshHandleSynTaskRedisScript;
|
|
||||||
@Resource
|
|
||||||
private CpImageStorePersonManager cpImageStorePersonManager;
|
|
||||||
@Resource
|
|
||||||
private CpImageStorePersonTxHandler cpImageStorePersonTxHandler;
|
|
||||||
@Resource
|
|
||||||
private CpImageStorePersonValidateManager cpImageStorePersonValidateManager;
|
|
||||||
@Resource
|
|
||||||
private ImgStorePersonMapper imgStorePersonMapper;
|
|
||||||
@Autowired
|
|
||||||
private AgImageStoreService agImageStoreService;
|
|
||||||
@Resource
|
|
||||||
private ApplicationImageStoreService appImageStoreService;
|
|
||||||
private CloudwalkCallContext context;
|
|
||||||
|
|
||||||
@PostConstruct
|
|
||||||
public void init() {
|
|
||||||
this.context = this.getCloudwalkContext();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addGroupPersonSynTask(List<String> imageStoreIdList, String jsonData) {
|
|
||||||
this.logger.info("CpImageStorePersonSynManager addGroupPersonSynTask params : {},{}", imageStoreIdList, (Object)jsonData);
|
|
||||||
for (String imageStoreId : imageStoreIdList) {
|
|
||||||
Long addWaitSynTaskRes = this.addWaitSynTask(imageStoreId, jsonData);
|
|
||||||
if (0 == addWaitSynTaskRes.intValue()) {
|
|
||||||
this.logger.info("CpImageStorePersonSynManager addGroupPersonSynTask addWaitSynTaskRes : \u65b0\u589e\u56fe\u5e93\u3010{}\u3011\u4efb\u52a1", (Object)imageStoreId);
|
|
||||||
} else {
|
|
||||||
this.logger.info("CpImageStorePersonSynManager addGroupPersonSynTask addWaitSynTaskRes : \u56fe\u5e93\u3010{}\u3011\u5df2\u5b58\u5728\u5168\u91cf\u4efb\u52a1", (Object)imageStoreId);
|
|
||||||
}
|
|
||||||
this.handleGroupPersonSynTask(imageStoreId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addGroupPersonSynTask(String imageStoreId, String personId, boolean isAdd) {
|
|
||||||
GroupPersonSynData groupPersonSynData = new GroupPersonSynData();
|
|
||||||
if (isAdd) {
|
|
||||||
groupPersonSynData.setAddPersonIds((List)Lists.newArrayList((Object[])new String[]{personId}));
|
|
||||||
} else {
|
|
||||||
groupPersonSynData.setDelPersonIds((List)Lists.newArrayList((Object[])new String[]{personId}));
|
|
||||||
}
|
|
||||||
String jsonData = JsonUtils.toJson((Object)groupPersonSynData);
|
|
||||||
this.addWaitSynTask(imageStoreId, jsonData);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addGroupPersonSynTask(List<String> imageStoreIds, List<String> personIds, boolean isAdd) {
|
|
||||||
if (Collections3.isNotEmpty(imageStoreIds) && Collections3.isNotEmpty(personIds)) {
|
|
||||||
String jsonData;
|
|
||||||
if (personIds.size() >= this.taskIsAllThreshold) {
|
|
||||||
jsonData = TASK_IS_ALL;
|
|
||||||
} else {
|
|
||||||
GroupPersonSynData groupPersonSynData = new GroupPersonSynData();
|
|
||||||
if (isAdd) {
|
|
||||||
groupPersonSynData.setAddPersonIds(personIds);
|
|
||||||
} else {
|
|
||||||
groupPersonSynData.setDelPersonIds(personIds);
|
|
||||||
}
|
|
||||||
jsonData = JsonUtils.toJson((Object)groupPersonSynData);
|
|
||||||
}
|
|
||||||
this.addGroupPersonSynTask(new ArrayList<String>(imageStoreIds), jsonData);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<String> addGroupPersonSynTask(String personId) {
|
|
||||||
Map<String, GroupPersonRef> imageStoreIdsMap;
|
|
||||||
ArrayList imageStoreIds;
|
|
||||||
this.logger.info("addGroupPersonSynTask - \u65b0\u589e\u56fe\u5e93\u5f85\u540c\u6b65\u4efb\u52a1(\u65b0\u589e\u4eba\u5458\u6ce8\u518c\u7167) personId\uff1a{}", (Object)personId);
|
|
||||||
ArrayList imageIdResultList = Lists.newArrayList();
|
|
||||||
if (StringUtils.isNotBlank((CharSequence)personId) && Collections3.isNotEmpty((Collection)(imageStoreIds = Lists.newArrayList((imageStoreIdsMap = this.cpImageStorePersonManager.getImageStoreIdsByPerson(personId)).keySet())))) {
|
|
||||||
GroupPersonSynData groupPersonSynData = new GroupPersonSynData();
|
|
||||||
groupPersonSynData.setAddPersonIds((List)Lists.newArrayList((Object[])new String[]{personId}));
|
|
||||||
String jsonData = JsonUtils.toJson((Object)groupPersonSynData);
|
|
||||||
for (String imageStoreId : imageStoreIds) {
|
|
||||||
this.addWaitSynTask(imageStoreId, jsonData);
|
|
||||||
}
|
|
||||||
imageIdResultList.addAll(imageStoreIds);
|
|
||||||
}
|
|
||||||
return imageIdResultList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<String> addGroupPersonSynTask(String personId, String oldImageId, List<String> oldImageStoreIds) {
|
|
||||||
this.logger.info("addGroupPersonSynTask - \u65b0\u589e\u56fe\u5e93\u5f85\u540c\u6b65\u4efb\u52a1(\u66f4\u65b0\u4eba\u5458\u6ce8\u518c\u7167) personId\uff1a{}\uff1boldImageId: {}\uff1boldImageStoreIds: {}", new Object[]{personId, oldImageId, oldImageStoreIds});
|
|
||||||
ArrayList imageIdResultList = Lists.newArrayList();
|
|
||||||
if (StringUtils.isNotBlank((CharSequence)personId)) {
|
|
||||||
Map<String, GroupPersonRef> imageStoreIdsMap = this.cpImageStorePersonManager.getImageStoreIdsByPerson(personId);
|
|
||||||
ArrayList imageStoreIds = Lists.newArrayList(imageStoreIdsMap.keySet());
|
|
||||||
if (Collections3.isNotEmpty((Collection)imageStoreIds)) {
|
|
||||||
GroupPersonSynData groupPersonSynData = new GroupPersonSynData();
|
|
||||||
groupPersonSynData.setPersonId(personId);
|
|
||||||
groupPersonSynData.setOldImageId(oldImageId);
|
|
||||||
String jsonData = JsonUtils.toJson((Object)groupPersonSynData);
|
|
||||||
for (String imageStoreId : imageStoreIds) {
|
|
||||||
this.addWaitSynTask(imageStoreId, jsonData);
|
|
||||||
}
|
|
||||||
imageIdResultList.addAll(imageStoreIds);
|
|
||||||
}
|
|
||||||
HashSet imageStoreIdsBefore = Sets.newHashSet(oldImageStoreIds);
|
|
||||||
HashSet imageStoreIdsAfter = Sets.newHashSet((Iterable)imageStoreIds);
|
|
||||||
imageStoreIdsBefore.removeAll(imageStoreIdsAfter);
|
|
||||||
ArrayList imageStoreIdsNeedDelete = Lists.newArrayList((Iterable)imageStoreIdsBefore);
|
|
||||||
this.logger.info("addGroupPersonSynTask - \u65b0\u589e\u56fe\u5e93\u5f85\u540c\u6b65\u4efb\u52a1(\u66f4\u65b0\u4eba\u5458\u6ce8\u518c\u7167) imageStoreIdsAfter\uff1a{}\uff1bimageStoreIdsNeedDelete: {}", (Object)imageStoreIds, (Object)imageStoreIdsNeedDelete);
|
|
||||||
if (Collections3.isNotEmpty((Collection)imageStoreIdsNeedDelete)) {
|
|
||||||
GroupPersonSynData groupPersonSynData = new GroupPersonSynData();
|
|
||||||
groupPersonSynData.setDelPersonIds((List)Lists.newArrayList((Object[])new String[]{personId}));
|
|
||||||
String jsonData = JsonUtils.toJson((Object)groupPersonSynData);
|
|
||||||
for (String imageStoreId : imageStoreIdsNeedDelete) {
|
|
||||||
this.addWaitSynTask(imageStoreId, jsonData);
|
|
||||||
}
|
|
||||||
imageIdResultList.addAll(imageStoreIdsNeedDelete);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return imageIdResultList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<String> addGroupPersonSynTask(String objId, List<String> personIds, boolean isAdd) {
|
|
||||||
ArrayList imageStoreIdResultList = Lists.newArrayList();
|
|
||||||
if (Collections3.isNotEmpty(personIds)) {
|
|
||||||
String jsonData;
|
|
||||||
GroupPersonSynData groupPersonSynData;
|
|
||||||
Set<String> includeList = this.cpImageStorePersonManager.getImageStoreIdsByObjId(objId, 0);
|
|
||||||
Set<String> excludeList = this.cpImageStorePersonManager.getImageStoreIdsByObjId(objId, 1);
|
|
||||||
includeList.removeAll(excludeList);
|
|
||||||
if (Collections3.isNotEmpty(includeList)) {
|
|
||||||
groupPersonSynData = new GroupPersonSynData();
|
|
||||||
if (isAdd) {
|
|
||||||
groupPersonSynData.setAddPersonIds(personIds);
|
|
||||||
} else {
|
|
||||||
groupPersonSynData.setDelPersonIds(personIds);
|
|
||||||
}
|
|
||||||
jsonData = JsonUtils.toJson((Object)groupPersonSynData);
|
|
||||||
includeList.parallelStream().forEach(imageStoreId -> this.addWaitSynTask((String)imageStoreId, jsonData));
|
|
||||||
imageStoreIdResultList.addAll(includeList);
|
|
||||||
}
|
|
||||||
if (Collections3.isNotEmpty(excludeList)) {
|
|
||||||
groupPersonSynData = new GroupPersonSynData();
|
|
||||||
if (isAdd) {
|
|
||||||
groupPersonSynData.setDelPersonIds(personIds);
|
|
||||||
} else {
|
|
||||||
groupPersonSynData.setAddPersonIds(personIds);
|
|
||||||
}
|
|
||||||
jsonData = JsonUtils.toJson((Object)groupPersonSynData);
|
|
||||||
excludeList.parallelStream().forEach(imageStoreId -> this.addWaitSynTask((String)imageStoreId, jsonData));
|
|
||||||
imageStoreIdResultList.addAll(excludeList);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return imageStoreIdResultList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void handleGroupPersonSynTask(String imageStoreId) {
|
|
||||||
Long lockHandleSynTaskRes = this.lockHandleSynTask(imageStoreId);
|
|
||||||
if (0 == lockHandleSynTaskRes.intValue()) {
|
|
||||||
this.taskExecutor.submit(() -> {
|
|
||||||
try {
|
|
||||||
this.logger.info("CpImageStorePersonSynManager handleGroupPersonSynTask lockHandleSynTaskRes : \u52a0\u9501\u6d88\u8d39\u56fe\u5e93{}\u6210\u529f", (Object)imageStoreId);
|
|
||||||
String synQueueHeadDataKey = SYN_QUEUE_HEAD_DATA + imageStoreId;
|
|
||||||
if (this.redisTemplate.hasKey((Object)synQueueHeadDataKey).booleanValue()) {
|
|
||||||
this.logger.warn("CpImageStorePersonSynManager handleGroupPersonSynTask synQueueHeadDataKey : \u5df2\u5b58\u5728\u540c\u6b65\u4efb\u52a1\u961f\u9996\u6570\u636e{}", (Object)synQueueHeadDataKey);
|
|
||||||
this.groupPersonSyn(imageStoreId, synQueueHeadDataKey);
|
|
||||||
} else {
|
|
||||||
Long lockHeadSynTaskRes = this.lockHeadSynTask(imageStoreId);
|
|
||||||
if (0 == lockHeadSynTaskRes.intValue()) {
|
|
||||||
this.groupPersonSyn(imageStoreId, synQueueHeadDataKey);
|
|
||||||
} else {
|
|
||||||
this.logger.info("CpImageStorePersonSynManager handleGroupPersonSynTask lockHeadSynTaskRes : \u56fe\u5e93{}\u5f85\u540c\u6b65\u961f\u5217\u5df2\u7a7a", (Object)imageStoreId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception e) {
|
|
||||||
this.logger.error("CpImageStorePersonSynManager handleGroupPersonSynTask taskExecutor : {0}", (Throwable)e);
|
|
||||||
this.handleFailSynTask(imageStoreId);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.logger.info("CpImageStorePersonSynManager handleGroupPersonSynTask lockHandleSynTaskRes : \u5df2\u5b58\u5728\u670d\u52a1\u8282\u70b9\u6d88\u8d39\u56fe\u5e93{}", (Object)imageStoreId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* WARNING - Removed try catching itself - possible behaviour change.
|
|
||||||
*/
|
|
||||||
private void groupPersonSyn(String imageStoreId, String synQueueHeadDataKey) {
|
|
||||||
try {
|
|
||||||
String synQueueHeadData = (String)this.redisTemplate.opsForValue().get((Object)synQueueHeadDataKey);
|
|
||||||
this.logger.info("CpImageStorePersonSynManager groupPersonSyn params : {},{}", (Object)imageStoreId, (Object)synQueueHeadData);
|
|
||||||
AgImageStoreResult waitSyncImageStore = this.getImageStoreById(imageStoreId);
|
|
||||||
if (waitSyncImageStore != null) {
|
|
||||||
if (TASK_IS_ALL.equals(synQueueHeadData)) {
|
|
||||||
this.handleImageStoreFullSyn(waitSyncImageStore);
|
|
||||||
} else {
|
|
||||||
this.handleImageStoreIncrementSyn(waitSyncImageStore, synQueueHeadData);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.handleSuccessSynTask(imageStoreId);
|
|
||||||
}
|
|
||||||
catch (Exception e) {
|
|
||||||
this.logger.error("CpImageStorePersonSynManager groupPersonSyn Exception :", (Throwable)e);
|
|
||||||
this.handleFailSynTask(imageStoreId);
|
|
||||||
}
|
|
||||||
finally {
|
|
||||||
this.handleGroupPersonSynTask(imageStoreId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void handleImageStoreFullSyn(AgImageStoreResult waitSyncImageStore) throws Exception {
|
|
||||||
this.logger.info("CpImageStorePersonSynManager handleImageStoreFullSyn\u5904\u7406\u5f85\u540c\u6b65\u56fe\u5e93start");
|
|
||||||
this.logger.info("CpImageStorePersonSynManager handleImageStoreFullSyn params : {}", (Object)waitSyncImageStore.getId());
|
|
||||||
AgImageStoreEditParam updateParam = new AgImageStoreEditParam();
|
|
||||||
updateParam.setId(waitSyncImageStore.getId());
|
|
||||||
updateParam.setName(waitSyncImageStore.getName());
|
|
||||||
updateParam.setStatus(SyncStatusEnum.SYNC_ING.getCode());
|
|
||||||
CloudwalkResult updateResult = this.agImageStoreService.edit(updateParam, this.context);
|
|
||||||
if (!updateResult.isSuccess()) {
|
|
||||||
this.logger.warn("CpImageStorePersonSynManager handleImageStoreFullSyn error\uff0cupdateResult:[{}]", (Object)JsonUtils.toJson((Object)updateResult));
|
|
||||||
throw new Exception("cwos\u66f4\u65b0\u56fe\u5e93\u4fe1\u606f\u5931\u8d25");
|
|
||||||
}
|
|
||||||
this.logger.info("CpImageStorePersonSynManager handleImageStoreFullSyn \u6574\u7406\u5f85\u5904\u7406\u56fe\u5e93\u4eba\u5458\u6570\u636estart");
|
|
||||||
Map<String, GroupPersonRef> associatedPersonResultsAfterUpdate = this.cpImageStorePersonManager.getCurrentAssociatedPersonIds(waitSyncImageStore.getId());
|
|
||||||
HashSet associatedPersonIdsAfterUpdate = Sets.newHashSet(associatedPersonResultsAfterUpdate.keySet());
|
|
||||||
List associatedPersonExpiryDateAfterUpdate = CollectionUtil.isNotEmpty((Collection)associatedPersonIdsAfterUpdate) ? this.imgStorePersonMapper.selectExpiryDateByIds((List)Lists.newArrayList((Iterable)associatedPersonIdsAfterUpdate)) : Lists.newArrayList();
|
|
||||||
Map<String, ImgStorePerson> associatedPersonExpiryDateAfterUpdateMap = associatedPersonExpiryDateAfterUpdate.stream().collect(Collectors.toMap(ImgStorePerson::getId, o -> o));
|
|
||||||
Map<String, GroupPersonRef> associatedPersonResultsBeforeUpdate = this.cpImageStorePersonManager.getOldAssociatedPersonIds(waitSyncImageStore.getId(), null);
|
|
||||||
HashSet associatedPersonIdsBeforeUpdate = Sets.newHashSet(associatedPersonResultsBeforeUpdate.keySet());
|
|
||||||
HashSet personIdsNeedDelete = new HashSet(associatedPersonIdsBeforeUpdate);
|
|
||||||
personIdsNeedDelete.removeAll(associatedPersonIdsAfterUpdate);
|
|
||||||
ArrayList refNeedAdd = Lists.newArrayList();
|
|
||||||
ArrayList refNeedUpdate = Lists.newArrayList();
|
|
||||||
ArrayList refNeedDelete = Lists.newArrayList();
|
|
||||||
associatedPersonIdsAfterUpdate.forEach(personId -> {
|
|
||||||
ImgStorePerson personExpiryDate;
|
|
||||||
this.logger.info("CpImageStorePersonSynManager handleImageStoreFullSyn \u904d\u5386\u83b7\u53d6\u56fe\u5e93\u4e2d\u6709\u6548\u4eba\u5458");
|
|
||||||
GroupPersonRef refAfterUpdate = (GroupPersonRef)associatedPersonResultsAfterUpdate.get(personId);
|
|
||||||
if (associatedPersonExpiryDateAfterUpdateMap.containsKey(refAfterUpdate.getPersonId()) && ((personExpiryDate = (ImgStorePerson)associatedPersonExpiryDateAfterUpdateMap.get(refAfterUpdate.getPersonId())).getExpiryBeginDate() != null || personExpiryDate.getExpiryEndDate() != null)) {
|
|
||||||
refAfterUpdate.setExpiryBeginDate(personExpiryDate.getExpiryBeginDate());
|
|
||||||
refAfterUpdate.setExpiryEndDate(personExpiryDate.getExpiryEndDate());
|
|
||||||
refAfterUpdate.setStatus(Short.valueOf(this.checkGroupPersonStatus(personExpiryDate.getExpiryBeginDate(), personExpiryDate.getExpiryEndDate())));
|
|
||||||
}
|
|
||||||
if (associatedPersonResultsBeforeUpdate.containsKey(personId)) {
|
|
||||||
GroupPersonRef refBeforeUpdate = (GroupPersonRef)associatedPersonResultsBeforeUpdate.get(personId);
|
|
||||||
if (!refBeforeUpdate.compare(refAfterUpdate)) {
|
|
||||||
refBeforeUpdate.setOldExpiryBeginDate(refBeforeUpdate.getExpiryBeginDate());
|
|
||||||
refBeforeUpdate.setOldExpiryEndDate(refBeforeUpdate.getExpiryEndDate());
|
|
||||||
refBeforeUpdate.setOldValidDateCron(refBeforeUpdate.getValidDateCron());
|
|
||||||
refBeforeUpdate.setExpiryBeginDate(refAfterUpdate.getExpiryBeginDate());
|
|
||||||
refBeforeUpdate.setExpiryEndDate(refAfterUpdate.getExpiryEndDate());
|
|
||||||
refBeforeUpdate.setValidDateCron(refAfterUpdate.getValidDateCron());
|
|
||||||
refBeforeUpdate.setStatus(refAfterUpdate.getStatus());
|
|
||||||
refNeedUpdate.add(refBeforeUpdate);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
refNeedAdd.add(refAfterUpdate);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
personIdsNeedDelete.forEach(personId -> {
|
|
||||||
GroupPersonRef refBeforeUpdate = (GroupPersonRef)associatedPersonResultsBeforeUpdate.get(personId);
|
|
||||||
if (refBeforeUpdate.getStatus() != -1) {
|
|
||||||
refNeedDelete.add(refBeforeUpdate);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
this.logger.info("CpImageStorePersonSynManager handleImageStoreFullSyn \u6574\u7406\u5f85\u5904\u7406\u56fe\u5e93\u4eba\u5458\u6570\u636eend");
|
|
||||||
List syncPersonList = this.cpImageStorePersonTxHandler.handleImageStoreChange(waitSyncImageStore, (List)refNeedAdd, (List)refNeedUpdate, (List)refNeedDelete);
|
|
||||||
this.logger.info("CpImageStorePersonSynManager handleImageStoreFullSyn \u6dfb\u52a0\u6709\u6548\u671f\u4efb\u52a1\uff0c\u5e76\u5224\u65ad\u4e0b\u53d1");
|
|
||||||
this.cpImageStorePersonValidateManager.addValidateData(syncPersonList);
|
|
||||||
updateParam.setStatus(SyncStatusEnum.SYNC_COMPLETED.getCode());
|
|
||||||
try {
|
|
||||||
updateResult = this.agImageStoreService.edit(updateParam, this.context);
|
|
||||||
if (!updateResult.isSuccess()) {
|
|
||||||
this.logger.warn("CpImageStorePersonSynManager handleImageStoreFullSyn error\uff0cupdateResult:[{}]", (Object)JSONObject.toJSONString((Object)updateResult));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception e) {
|
|
||||||
this.logger.error("CpImageStorePersonSynManager handleImageStoreFullSyn exception,imageStoreId:[{}]", (Object)waitSyncImageStore.getId(), (Object)e);
|
|
||||||
}
|
|
||||||
this.logger.info("CpImageStorePersonSynManager handleImageStoreFullSyn\u5904\u7406\u5f85\u540c\u6b65\u56fe\u5e93end");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void handleImageStoreIncrementSyn(AgImageStoreResult waitSyncImageStore, String jsonData) throws Exception {
|
|
||||||
Map<String, GroupPersonRef> associatedPersonResultsAfterUpdate;
|
|
||||||
this.logger.info("CpImageStorePersonSynManager handleImageStoreIncrementSyn\u589e\u91cf\u5904\u7406\u5f85\u540c\u6b65\u56fe\u5e93start: {};{}", (Object)waitSyncImageStore.getId(), (Object)jsonData);
|
|
||||||
ArrayList refNeedAdd = Lists.newArrayList();
|
|
||||||
ArrayList refNeedUpdate = Lists.newArrayList();
|
|
||||||
ArrayList refNeedDelete = Lists.newArrayList();
|
|
||||||
GroupPersonSynData synData = (GroupPersonSynData)JsonUtils.toObj((String)jsonData, GroupPersonSynData.class);
|
|
||||||
if (synData == null) {
|
|
||||||
this.logger.error("CpImageStorePersonSynManager handleImageStoreIncrementSyn \u540c\u6b65\u6570\u636e\u4e3anull");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (Collections3.isNotEmpty((Collection)synData.getAddPersonIds())) {
|
|
||||||
associatedPersonResultsAfterUpdate = this.cpImageStorePersonManager.getGroupPersonRefByPersons(waitSyncImageStore.getId(), synData.getAddPersonIds());
|
|
||||||
List associatedPersonExpiryDateAfterUpdate = this.imgStorePersonMapper.selectExpiryDateByIds(synData.getAddPersonIds());
|
|
||||||
Map<String, ImgStorePerson> associatedPersonExpiryDateAfterUpdateMap = associatedPersonExpiryDateAfterUpdate.stream().collect(Collectors.toMap(ImgStorePerson::getId, o -> o));
|
|
||||||
Map<String, GroupPersonRef> associatedPersonResultsBeforeUpdate = this.cpImageStorePersonManager.getOldAssociatedPersonIds(waitSyncImageStore.getId(), synData.getAddPersonIds());
|
|
||||||
synData.getAddPersonIds().forEach(personId -> {
|
|
||||||
if (associatedPersonResultsAfterUpdate.containsKey(personId)) {
|
|
||||||
ImgStorePerson personExpiryDate;
|
|
||||||
GroupPersonRef refAfterUpdate = (GroupPersonRef)associatedPersonResultsAfterUpdate.get(personId);
|
|
||||||
if (associatedPersonExpiryDateAfterUpdateMap.containsKey(refAfterUpdate.getPersonId()) && ((personExpiryDate = (ImgStorePerson)associatedPersonExpiryDateAfterUpdateMap.get(refAfterUpdate.getPersonId())).getExpiryBeginDate() != null || personExpiryDate.getExpiryEndDate() != null)) {
|
|
||||||
refAfterUpdate.setExpiryBeginDate(personExpiryDate.getExpiryBeginDate());
|
|
||||||
refAfterUpdate.setExpiryEndDate(personExpiryDate.getExpiryEndDate());
|
|
||||||
refAfterUpdate.setStatus(Short.valueOf(this.checkGroupPersonStatus(personExpiryDate.getExpiryBeginDate(), personExpiryDate.getExpiryEndDate())));
|
|
||||||
}
|
|
||||||
if (associatedPersonResultsBeforeUpdate.containsKey(personId)) {
|
|
||||||
GroupPersonRef refBeforeUpdate = (GroupPersonRef)associatedPersonResultsBeforeUpdate.get(personId);
|
|
||||||
if (!refBeforeUpdate.compare(refAfterUpdate)) {
|
|
||||||
refBeforeUpdate.setOldExpiryBeginDate(refBeforeUpdate.getExpiryBeginDate());
|
|
||||||
refBeforeUpdate.setOldExpiryEndDate(refBeforeUpdate.getExpiryEndDate());
|
|
||||||
refBeforeUpdate.setOldValidDateCron(refBeforeUpdate.getValidDateCron());
|
|
||||||
refBeforeUpdate.setExpiryBeginDate(refAfterUpdate.getExpiryBeginDate());
|
|
||||||
refBeforeUpdate.setExpiryEndDate(refAfterUpdate.getExpiryEndDate());
|
|
||||||
refBeforeUpdate.setValidDateCron(refAfterUpdate.getValidDateCron());
|
|
||||||
refBeforeUpdate.setStatus(refAfterUpdate.getStatus());
|
|
||||||
refNeedUpdate.add(refBeforeUpdate);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
refNeedAdd.add(refAfterUpdate);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (Collections3.isNotEmpty((Collection)synData.getDelPersonIds())) {
|
|
||||||
associatedPersonResultsAfterUpdate = this.cpImageStorePersonManager.getGroupPersonRefByPersons(waitSyncImageStore.getId(), synData.getDelPersonIds());
|
|
||||||
Map<String, GroupPersonRef> associatedPersonResultsBeforeUpdate = this.cpImageStorePersonManager.getOldAssociatedPersonIds(waitSyncImageStore.getId(), synData.getDelPersonIds());
|
|
||||||
synData.getDelPersonIds().forEach(personId -> {
|
|
||||||
if (!associatedPersonResultsAfterUpdate.containsKey(personId) && associatedPersonResultsBeforeUpdate.containsKey(personId)) {
|
|
||||||
GroupPersonRef refBeforeUpdate = (GroupPersonRef)associatedPersonResultsBeforeUpdate.get(personId);
|
|
||||||
refNeedDelete.add(refBeforeUpdate);
|
|
||||||
} else if (associatedPersonResultsBeforeUpdate.containsKey(personId)) {
|
|
||||||
ImgStorePerson person = this.imgStorePersonMapper.selectByPrimaryKey(personId);
|
|
||||||
if (DelStatusEnum.DELETED.getCode().shortValue() == person.getIsDel().shortValue()) {
|
|
||||||
GroupPersonRef refBeforeUpdate = (GroupPersonRef)associatedPersonResultsBeforeUpdate.get(personId);
|
|
||||||
refNeedDelete.add(refBeforeUpdate);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this.logger.info("CpImageStorePersonSynManager handleImageStoreIncrementSyn \u6574\u7406\u5f85\u5904\u7406\u56fe\u5e93\u4eba\u5458\u6570\u636eend");
|
|
||||||
ArrayList syncPersonList = Lists.newArrayList();
|
|
||||||
if (StringUtils.isNotBlank((CharSequence)synData.getPersonId())) {
|
|
||||||
ImgStorePerson personExpiryDate;
|
|
||||||
List associatedPersonExpiryDateAfterUpdate;
|
|
||||||
this.logger.info("CpImageStorePersonSynManager handleImageStoreIncrementSyn \u5355\u4eba\u5458\u66f4\u65b0\u6ce8\u518c\u7167\uff1a{}\uff0c{}", (Object)synData.getPersonId(), (Object)synData.getOldImageId());
|
|
||||||
Map<String, GroupPersonRef> associatedPersonResultsAfterUpdate2 = this.cpImageStorePersonManager.getGroupPersonRefByPersons(waitSyncImageStore.getId(), Lists.newArrayList((Object[])new String[]{synData.getPersonId()}));
|
|
||||||
Map<String, GroupPersonRef> associatedPersonResultsBeforeUpdate = this.cpImageStorePersonManager.getOldAssociatedPersonIds(waitSyncImageStore.getId(), Lists.newArrayList((Object[])new String[]{synData.getPersonId()}));
|
|
||||||
GroupPersonRef refAfterUpdate = associatedPersonResultsAfterUpdate2.get(synData.getPersonId());
|
|
||||||
if (refAfterUpdate != null && CollectionUtil.isNotEmpty((Collection)(associatedPersonExpiryDateAfterUpdate = this.imgStorePersonMapper.selectExpiryDateByIds((List)Lists.newArrayList((Object[])new String[]{synData.getPersonId()})))) && ((personExpiryDate = (ImgStorePerson)associatedPersonExpiryDateAfterUpdate.get(0)).getExpiryBeginDate() != null || personExpiryDate.getExpiryEndDate() != null)) {
|
|
||||||
refAfterUpdate.setExpiryBeginDate(personExpiryDate.getExpiryBeginDate());
|
|
||||||
refAfterUpdate.setExpiryEndDate(personExpiryDate.getExpiryEndDate());
|
|
||||||
refAfterUpdate.setStatus(Short.valueOf(this.checkGroupPersonStatus(personExpiryDate.getExpiryBeginDate(), personExpiryDate.getExpiryEndDate())));
|
|
||||||
}
|
|
||||||
GroupPersonRef refBeforeUpdate = associatedPersonResultsBeforeUpdate.get(synData.getPersonId());
|
|
||||||
if (refAfterUpdate != null && refBeforeUpdate != null) {
|
|
||||||
refBeforeUpdate.setExpiryBeginDate(refAfterUpdate.getExpiryBeginDate());
|
|
||||||
refBeforeUpdate.setExpiryEndDate(refAfterUpdate.getExpiryEndDate());
|
|
||||||
refBeforeUpdate.setOldExpiryBeginDate(refBeforeUpdate.getExpiryBeginDate());
|
|
||||||
refBeforeUpdate.setOldExpiryEndDate(refBeforeUpdate.getExpiryEndDate());
|
|
||||||
refBeforeUpdate.setStatus(refAfterUpdate.getStatus());
|
|
||||||
syncPersonList.add(this.cpImageStorePersonTxHandler.handleImageStorePersonUpdate(refBeforeUpdate, synData.getOldImageId()));
|
|
||||||
} else if (refAfterUpdate == null && refBeforeUpdate != null) {
|
|
||||||
refNeedDelete.add(refBeforeUpdate);
|
|
||||||
} else if (refAfterUpdate != null) {
|
|
||||||
refNeedAdd.add(refAfterUpdate);
|
|
||||||
} else {
|
|
||||||
this.logger.warn("CpImageStorePersonSynManager handleImageStoreIncrementSyn \u66f4\u65b0\u524d\u540e\u6570\u636e\u4e22\u5931");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
syncPersonList.addAll(this.cpImageStorePersonTxHandler.handleImageStoreChange(waitSyncImageStore, (List)refNeedAdd, (List)refNeedUpdate, (List)refNeedDelete));
|
|
||||||
this.logger.info("CpImageStorePersonSynManager handleImageStoreIncrementSyn \u6dfb\u52a0\u6709\u6548\u671f\u4efb\u52a1\uff0c\u5e76\u5224\u65ad\u4e0b\u53d1");
|
|
||||||
this.cpImageStorePersonValidateManager.addValidateData((List)syncPersonList);
|
|
||||||
this.logger.info("CpImageStorePersonSynManager handleImageStoreIncrementSyn \u589e\u91cf\u5904\u7406\u5f85\u540c\u6b65\u56fe\u5e93end");
|
|
||||||
}
|
|
||||||
|
|
||||||
private AgImageStoreResult getImageStoreById(String imageStoreId) throws Exception {
|
|
||||||
AgImageStoreQueryParam imageStoreQueryParamChange = new AgImageStoreQueryParam();
|
|
||||||
imageStoreQueryParamChange.setId(imageStoreId);
|
|
||||||
imageStoreQueryParamChange.setType(Short.valueOf((short)1));
|
|
||||||
CloudwalkResult waitSyncImageStoreChangeResult = this.agImageStoreService.query(imageStoreQueryParamChange);
|
|
||||||
if (!waitSyncImageStoreChangeResult.isSuccess()) {
|
|
||||||
this.logger.warn("CpImageStorePersonSynManager handleImageStoreFullSyn query is_del change list fail,result:{}", (Object)JSONObject.toJSONString((Object)waitSyncImageStoreChangeResult));
|
|
||||||
throw new Exception("cwos\u67e5\u8be2\u56fe\u5e93\u4fe1\u606f\u5931\u8d25");
|
|
||||||
}
|
|
||||||
if (Collections3.isEmpty((Collection)((Collection)waitSyncImageStoreChangeResult.getData()))) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return (AgImageStoreResult)((List)waitSyncImageStoreChangeResult.getData()).get(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long addWaitSynTask(String imageStoreId, String jsonData) {
|
|
||||||
this.logger.info("addWaitSynTask - \u56fe\u5e93\u5f85\u540c\u6b65\u4efb\u52a1\u961f\u5217\u961f\u5c3e\u65b0\u589e\u4efb\u52a1 imageStoreId\uff1a{}; jsonData: {}", (Object)imageStoreId, (Object)jsonData);
|
|
||||||
return (Long)this.redisTemplate.execute(connection -> (Long)connection.eval(this.addWaitSynTaskRedisScript.getScriptAsString().getBytes(), ReturnType.INTEGER, 0, (byte[][])new byte[][]{imageStoreId.getBytes(), jsonData.getBytes()}));
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long lockHandleSynTask(String imageStoreId) {
|
|
||||||
return (Long)this.redisTemplate.execute(connection -> (Long)connection.eval(this.lockHandleSynTaskRedisScript.getScriptAsString().getBytes(), ReturnType.INTEGER, 0, (byte[][])new byte[][]{imageStoreId.getBytes(), this.serverInstanceId.getBytes(), this.lockHandleSynTaskSecond.getBytes()}));
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long lockHeadSynTask(String imageStoreId) {
|
|
||||||
return (Long)this.redisTemplate.execute(connection -> (Long)connection.eval(this.lockHeadSynTaskRedisScript.getScriptAsString().getBytes(), ReturnType.INTEGER, 1, (byte[][])new byte[][]{imageStoreId.getBytes(), imageStoreId.getBytes(), this.serverInstanceId.getBytes(), String.valueOf(this.taskIsAllThreshold).getBytes()}));
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long handleSuccessSynTask(String imageStoreId) {
|
|
||||||
return (Long)this.redisTemplate.execute(connection -> (Long)connection.eval(this.handleSuccessSynTaskRedisScript.getScriptAsString().getBytes(), ReturnType.INTEGER, 0, (byte[][])new byte[][]{imageStoreId.getBytes(), this.serverInstanceId.getBytes()}));
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long handleFailSynTask(String imageStoreId) {
|
|
||||||
return (Long)this.redisTemplate.execute(connection -> (Long)connection.eval(this.handleFailSynTaskRedisScript.getScriptAsString().getBytes(), ReturnType.INTEGER, 0, (byte[][])new byte[][]{imageStoreId.getBytes(), this.serverInstanceId.getBytes()}));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void refreshHandleSynTaskLockExpireTime() {
|
|
||||||
byte[] res = (byte[])this.redisTemplate.execute(connection -> (byte[])connection.eval(this.refreshHandleSynTaskRedisScript.getScriptAsString().getBytes(), ReturnType.VALUE, 0, (byte[][])new byte[][]{this.serverInstanceId.getBytes(), this.lockHandleSynTaskSecond.getBytes()}));
|
|
||||||
this.logger.info("CpImageStorePersonSynManager refreshHandleSynTaskLockExpireTime : {}", (Object)new String(res));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void checkHandleSynTaskException() {
|
|
||||||
Set synQueueHeadDataKeys = this.redisTemplate.keys((Object)"group_person_syn_queue_head_data:*");
|
|
||||||
synQueueHeadDataKeys.forEach(synQueueHeadDataKey -> {
|
|
||||||
String imageStoreId = synQueueHeadDataKey.replaceFirst(SYN_QUEUE_HEAD_DATA, "");
|
|
||||||
Set lockKeys = this.redisTemplate.keys((Object)(imageStoreId + ":*"));
|
|
||||||
if (Collections3.isEmpty((Collection)lockKeys)) {
|
|
||||||
this.logger.info("CpImageStorePersonSynManager checkHandleSynTaskException \u6d88\u8d39\u52a0\u9501");
|
|
||||||
this.handleFailSynTask(imageStoreId);
|
|
||||||
this.handleGroupPersonSynTask(imageStoreId);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
Set waitSynTaskKeys = this.redisTemplate.keys((Object)"group_person_wait_syn_task:*");
|
|
||||||
waitSynTaskKeys.forEach(waitSynTaskKey -> {
|
|
||||||
String imageStoreId = waitSynTaskKey.replaceFirst(WAIT_SYN_TASK_KEY, "");
|
|
||||||
Set lockKeys = this.redisTemplate.keys((Object)(imageStoreId + ":*"));
|
|
||||||
if (Collections3.isEmpty((Collection)lockKeys)) {
|
|
||||||
this.logger.info("CpImageStorePersonSynManager checkHandleSynTaskException \u672a\u6d88\u8d39");
|
|
||||||
this.handleFailSynTask(imageStoreId);
|
|
||||||
this.handleGroupPersonSynTask(imageStoreId);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-475
@@ -1,475 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*
|
|
||||||
* Could not load the following classes:
|
|
||||||
* cn.cloudwalk.client.aggregate.common.enums.DelStatusEnum
|
|
||||||
* cn.cloudwalk.client.aggregate.common.enums.GroupModelStatusEnum
|
|
||||||
* cn.cloudwalk.client.aggregate.group.param.AgFeatureExtractParam
|
|
||||||
* cn.cloudwalk.client.aggregate.group.result.AgFeatureExtractResult
|
|
||||||
* cn.cloudwalk.client.aggregate.group.result.AgImageStoreResult
|
|
||||||
* cn.cloudwalk.client.organization.common.enums.SyncStatusEnum
|
|
||||||
* cn.cloudwalk.client.organization.result.HandleFaceResult
|
|
||||||
* cn.cloudwalk.client.organization.service.store.param.CpHandleFaceParam
|
|
||||||
* cn.cloudwalk.client.organization.service.store.service.CpImageStoreToolService
|
|
||||||
* cn.cloudwalk.cloud.context.CloudwalkCallContext
|
|
||||||
* cn.cloudwalk.cloud.exception.ServiceException
|
|
||||||
* cn.cloudwalk.cloud.result.CloudwalkResult
|
|
||||||
* cn.cloudwalk.cloud.utils.CloudwalkDateUtils
|
|
||||||
* cn.cloudwalk.data.organization.dto.DelGroupPersonDTO
|
|
||||||
* cn.cloudwalk.data.organization.dto.DevicePersonSyncLogDTO
|
|
||||||
* cn.cloudwalk.data.organization.dto.GroupPersonRefDTO
|
|
||||||
* cn.cloudwalk.data.organization.dto.ImgStorePersonQueryDto
|
|
||||||
* cn.cloudwalk.data.organization.dto.SyncPersonDTO
|
|
||||||
* cn.cloudwalk.data.organization.entity.GroupPersonRef
|
|
||||||
* cn.cloudwalk.data.organization.entity.ImgStorePerson
|
|
||||||
* cn.cloudwalk.data.organization.mapper.DevicePersonSyncLogMapper
|
|
||||||
* cn.cloudwalk.data.organization.mapper.GroupPersonRefMapper
|
|
||||||
* cn.cloudwalk.data.organization.mapper.ImgStorePersonMapper
|
|
||||||
* cn.cloudwalk.service.organization.common.AbstractImagStoreService
|
|
||||||
* com.alibaba.fastjson.JSON
|
|
||||||
* com.google.common.collect.Lists
|
|
||||||
* com.google.common.collect.Sets
|
|
||||||
* javax.annotation.PostConstruct
|
|
||||||
* javax.annotation.Resource
|
|
||||||
* org.springframework.beans.factory.annotation.Value
|
|
||||||
* org.springframework.scheduling.annotation.Async
|
|
||||||
* org.springframework.stereotype.Component
|
|
||||||
* org.springframework.transaction.annotation.Propagation
|
|
||||||
* org.springframework.transaction.annotation.Transactional
|
|
||||||
* org.springframework.util.CollectionUtils
|
|
||||||
* org.springframework.util.StringUtils
|
|
||||||
* org.springside.modules.utils.Collections3
|
|
||||||
*/
|
|
||||||
package cn.cloudwalk.service.organization.service;
|
|
||||||
|
|
||||||
import cn.cloudwalk.client.aggregate.common.enums.DelStatusEnum;
|
|
||||||
import cn.cloudwalk.client.aggregate.common.enums.GroupModelStatusEnum;
|
|
||||||
import cn.cloudwalk.client.aggregate.group.param.AgFeatureExtractParam;
|
|
||||||
import cn.cloudwalk.client.aggregate.group.result.AgFeatureExtractResult;
|
|
||||||
import cn.cloudwalk.client.aggregate.group.result.AgImageStoreResult;
|
|
||||||
import cn.cloudwalk.client.organization.common.enums.SyncStatusEnum;
|
|
||||||
import cn.cloudwalk.client.organization.result.HandleFaceResult;
|
|
||||||
import cn.cloudwalk.client.organization.service.store.param.CpHandleFaceParam;
|
|
||||||
import cn.cloudwalk.client.organization.service.store.service.CpImageStoreToolService;
|
|
||||||
import cn.cloudwalk.cloud.context.CloudwalkCallContext;
|
|
||||||
import cn.cloudwalk.cloud.exception.ServiceException;
|
|
||||||
import cn.cloudwalk.cloud.result.CloudwalkResult;
|
|
||||||
import cn.cloudwalk.cloud.utils.CloudwalkDateUtils;
|
|
||||||
import cn.cloudwalk.data.organization.dto.DelGroupPersonDTO;
|
|
||||||
import cn.cloudwalk.data.organization.dto.DevicePersonSyncLogDTO;
|
|
||||||
import cn.cloudwalk.data.organization.dto.GroupPersonRefDTO;
|
|
||||||
import cn.cloudwalk.data.organization.dto.ImgStorePersonQueryDto;
|
|
||||||
import cn.cloudwalk.data.organization.dto.SyncPersonDTO;
|
|
||||||
import cn.cloudwalk.data.organization.entity.GroupPersonRef;
|
|
||||||
import cn.cloudwalk.data.organization.entity.ImgStorePerson;
|
|
||||||
import cn.cloudwalk.data.organization.mapper.DevicePersonSyncLogMapper;
|
|
||||||
import cn.cloudwalk.data.organization.mapper.GroupPersonRefMapper;
|
|
||||||
import cn.cloudwalk.data.organization.mapper.ImgStorePersonMapper;
|
|
||||||
import cn.cloudwalk.service.organization.common.AbstractImagStoreService;
|
|
||||||
import com.alibaba.fastjson.JSON;
|
|
||||||
import com.google.common.collect.Lists;
|
|
||||||
import com.google.common.collect.Sets;
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
import javax.annotation.PostConstruct;
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.scheduling.annotation.Async;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
import org.springframework.transaction.annotation.Propagation;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
import org.springframework.util.CollectionUtils;
|
|
||||||
import org.springframework.util.StringUtils;
|
|
||||||
import org.springside.modules.utils.Collections3;
|
|
||||||
|
|
||||||
@Component
|
|
||||||
public class CpImageStorePersonTxHandler
|
|
||||||
extends AbstractImagStoreService {
|
|
||||||
@Value(value="${cloudwalk.imagestore.person.sync.batchsize:100}")
|
|
||||||
private int batchSize;
|
|
||||||
@Value(value="${cloudwalk.imagestore.person.sync.del.batchsize:100}")
|
|
||||||
private int delBatchSize;
|
|
||||||
@Resource
|
|
||||||
private CpImageStoreToolService cpImageStoreToolService;
|
|
||||||
@Resource
|
|
||||||
private GroupPersonRefMapper groupPersonRefMapper;
|
|
||||||
@Resource
|
|
||||||
private DevicePersonSyncLogMapper devicePersonSyncLogMapper;
|
|
||||||
@Resource
|
|
||||||
private ImgStorePersonMapper imgStorePersonMapper;
|
|
||||||
private CloudwalkCallContext context;
|
|
||||||
|
|
||||||
@PostConstruct
|
|
||||||
public void init() {
|
|
||||||
this.context = this.getCloudwalkContext();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Transactional(rollbackFor={Exception.class}, propagation=Propagation.REQUIRED)
|
|
||||||
public List<SyncPersonDTO> handleImageStoreChange(AgImageStoreResult waitSyncImageStore, List<GroupPersonRef> personIdsNeedAdd, List<GroupPersonRef> personIdsNeedUpdate, List<GroupPersonRef> personIdsNeedDelete) {
|
|
||||||
ArrayList<SyncPersonDTO> resultList = new ArrayList<SyncPersonDTO>();
|
|
||||||
this.logger.info("CpImageStorePersonUpdateTask\uff0c\u5904\u7406\u65b0\u589e\u4eba\u5458start");
|
|
||||||
resultList.addAll(this.handleImageStorePersonChange(personIdsNeedAdd, true));
|
|
||||||
this.logger.info("CpImageStorePersonUpdateTask\uff0c\u5904\u7406\u65b0\u589e\u4eba\u5458end");
|
|
||||||
this.logger.info("CpImageStorePersonUpdateTask\uff0c\u5904\u7406\u66f4\u65b0\u4eba\u5458start");
|
|
||||||
resultList.addAll(this.handleImageStorePersonChange(personIdsNeedUpdate, false));
|
|
||||||
this.logger.info("CpImageStorePersonUpdateTask\uff0c\u5904\u7406\u66f4\u65b0\u4eba\u5458end");
|
|
||||||
this.logger.info("CpImageStorePersonUpdateTask\uff0c\u5904\u7406\u5220\u9664\u4eba\u5458start");
|
|
||||||
for (GroupPersonRef delGroupPersonRef : personIdsNeedDelete) {
|
|
||||||
resultList.add(this.generateDelSyncPersonDTO(delGroupPersonRef, -1, delGroupPersonRef.getExpiryBeginDate(), delGroupPersonRef.getExpiryEndDate()));
|
|
||||||
}
|
|
||||||
this.handleImageStorePersonDelete(waitSyncImageStore.getId(), personIdsNeedDelete.stream().map(GroupPersonRef::getPersonId).collect(Collectors.toList()));
|
|
||||||
this.logger.info("CpImageStorePersonUpdateTask\uff0c\u5904\u7406\u5220\u9664\u4eba\u5458end");
|
|
||||||
return resultList;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Transactional(rollbackFor={Exception.class}, propagation=Propagation.REQUIRED)
|
|
||||||
public void handlePersonDelete(ImgStorePerson imgStorePerson, Set<String> imageStoreIdsNeedDelete) {
|
|
||||||
this.deletePersonFromImageStores(imgStorePerson, imageStoreIdsNeedDelete);
|
|
||||||
}
|
|
||||||
|
|
||||||
private List<SyncPersonDTO> handleImageStorePersonChange(List<GroupPersonRef> changePersonIds, boolean add) {
|
|
||||||
ArrayList<SyncPersonDTO> syncPersonList = new ArrayList<SyncPersonDTO>();
|
|
||||||
if (Collections3.isEmpty(changePersonIds)) {
|
|
||||||
return syncPersonList;
|
|
||||||
}
|
|
||||||
if (add) {
|
|
||||||
ArrayList<GroupPersonRef> groupPersonRefList = new ArrayList<GroupPersonRef>(this.batchSize);
|
|
||||||
int total = 0;
|
|
||||||
for (GroupPersonRef changePersonId : changePersonIds) {
|
|
||||||
GroupPersonRef addGroupPersonRef = this.generateGroupPersonRefAdd(changePersonId);
|
|
||||||
SyncPersonDTO addSyncPersonDTO = this.generateSyncPersonDTO(addGroupPersonRef, 0, null, null);
|
|
||||||
if (StringUtils.isEmpty((Object)addSyncPersonDTO.getImageId())) {
|
|
||||||
syncPersonList.add(addSyncPersonDTO);
|
|
||||||
addGroupPersonRef.resetGroupStatus(Short.valueOf((short)0));
|
|
||||||
} else {
|
|
||||||
syncPersonList.add(addSyncPersonDTO);
|
|
||||||
addGroupPersonRef.resetGroupStatus(GroupModelStatusEnum.MODEL_WAIT.getCode());
|
|
||||||
}
|
|
||||||
groupPersonRefList.add(addGroupPersonRef);
|
|
||||||
if (++total < this.batchSize) continue;
|
|
||||||
this.groupPersonRefMapper.batchInsert(groupPersonRefList);
|
|
||||||
groupPersonRefList = new ArrayList(this.batchSize);
|
|
||||||
total = 0;
|
|
||||||
}
|
|
||||||
if (!CollectionUtils.isEmpty(groupPersonRefList)) {
|
|
||||||
this.groupPersonRefMapper.batchInsert(groupPersonRefList);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
for (GroupPersonRef changePersonId : changePersonIds) {
|
|
||||||
Short oldIsDel = changePersonId.getIsDel();
|
|
||||||
GroupPersonRef modGroupPersonRef = this.generateGroupPersonRefMod(changePersonId);
|
|
||||||
int personAction = DelStatusEnum.DELETED.getCode().shortValue() == oldIsDel.shortValue() && DelStatusEnum.NORAML.getCode().shortValue() == modGroupPersonRef.getIsDel().shortValue() ? 0 : (DelStatusEnum.NORAML.getCode().shortValue() == oldIsDel.shortValue() && DelStatusEnum.DELETED.getCode().shortValue() == modGroupPersonRef.getIsDel().shortValue() ? -1 : 1);
|
|
||||||
SyncPersonDTO modSyncPersonDTO = this.generateSyncPersonDTO(modGroupPersonRef, personAction, modGroupPersonRef.getOldExpiryBeginDate(), modGroupPersonRef.getOldExpiryEndDate());
|
|
||||||
boolean flag = personAction == 1 && DelStatusEnum.NORAML.getCode().shortValue() == modGroupPersonRef.getIsDel().shortValue() && DelStatusEnum.NORAML.getCode().shortValue() == oldIsDel.shortValue();
|
|
||||||
this.logger.debug("CpImageStorePersonUpdateTask handleImageStorePersonChange mod flag: {}", (Object)flag);
|
|
||||||
if (StringUtils.isEmpty((Object)modSyncPersonDTO.getImageId())) {
|
|
||||||
modGroupPersonRef.resetGroupStatus(Short.valueOf((short)0));
|
|
||||||
} else if (!flag) {
|
|
||||||
modGroupPersonRef.resetGroupStatus(GroupModelStatusEnum.MODEL_WAIT.getCode());
|
|
||||||
}
|
|
||||||
modGroupPersonRef.setExpiryBeginDateStatus(Integer.valueOf(0));
|
|
||||||
modGroupPersonRef.setExpiryEndDateStatus(Integer.valueOf(0));
|
|
||||||
syncPersonList.add(modSyncPersonDTO);
|
|
||||||
if (!flag) {
|
|
||||||
this.groupPersonRefMapper.updateByPrimaryKey(modGroupPersonRef);
|
|
||||||
} else {
|
|
||||||
this.groupPersonRefMapper.updateByPrimaryKeySelective(modGroupPersonRef);
|
|
||||||
}
|
|
||||||
DevicePersonSyncLogDTO dto = new DevicePersonSyncLogDTO();
|
|
||||||
dto.setGroupPersonRefId(modGroupPersonRef.getId());
|
|
||||||
dto.setStatus(Integer.valueOf(SyncStatusEnum.NOT_PULL.getValue()));
|
|
||||||
dto.setCode("");
|
|
||||||
dto.setErrorMessage("");
|
|
||||||
dto.setLastUpdateTime(modGroupPersonRef.getLastUpdateTime());
|
|
||||||
dto.setUpdateInfo("\u66f4\u65b0\u56fe\u5e93\u4eba\u5458\u4fe1\u606f,\u66f4\u65b0\u540c\u6b65\u8bb0\u5f55\u72b6\u6001:\u8bbe\u5907\u672a\u62c9\u53d6");
|
|
||||||
int res = this.devicePersonSyncLogMapper.updateStatusByGroupPersonRef(dto);
|
|
||||||
this.logger.debug("\u66f4\u65b0\u56fe\u5e93\u4eba\u5458\u4fe1\u606f[{}],\u66f4\u65b0[{}]\u6761\u540c\u6b65\u8bb0\u5f55\u72b6\u6001\u4e3a\u672a\u62c9\u53d6", (Object)modGroupPersonRef.getId(), (Object)res);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return syncPersonList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public SyncPersonDTO handleImageStorePersonUpdate(GroupPersonRef groupPersonRef, String oldImageId) {
|
|
||||||
SyncPersonDTO result;
|
|
||||||
GroupPersonRef modGroupPersonRef = this.generateGroupPersonRefMod(groupPersonRef);
|
|
||||||
if (StringUtils.isEmpty((Object)oldImageId)) {
|
|
||||||
result = this.generateSyncPersonDTO(modGroupPersonRef, 0, modGroupPersonRef.getOldExpiryBeginDate(), modGroupPersonRef.getOldExpiryEndDate());
|
|
||||||
if (!StringUtils.isEmpty((Object)result.getImageId())) {
|
|
||||||
modGroupPersonRef.resetGroupStatus(GroupModelStatusEnum.MODEL_WAIT.getCode());
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
result = this.generateSyncPersonDTO(modGroupPersonRef, 1, modGroupPersonRef.getOldExpiryBeginDate(), modGroupPersonRef.getOldExpiryEndDate());
|
|
||||||
result.setOldImageId(oldImageId);
|
|
||||||
if (!StringUtils.isEmpty((Object)result.getImageId()) && !oldImageId.equals(result.getImageId())) {
|
|
||||||
modGroupPersonRef.resetGroupStatus(GroupModelStatusEnum.MODEL_WAIT.getCode());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (StringUtils.isEmpty((Object)result.getImageId())) {
|
|
||||||
modGroupPersonRef.resetGroupStatus(Short.valueOf((short)0));
|
|
||||||
}
|
|
||||||
this.groupPersonRefMapper.updateByPrimaryKey(modGroupPersonRef);
|
|
||||||
DevicePersonSyncLogDTO syncLogDTO = new DevicePersonSyncLogDTO();
|
|
||||||
syncLogDTO.setGroupPersonRefIds(Arrays.asList(modGroupPersonRef.getId()));
|
|
||||||
syncLogDTO.setLastUpdateTime(modGroupPersonRef.getLastUpdateTime());
|
|
||||||
this.devicePersonSyncLogMapper.updateLastTimeByGroupPersonRef(syncLogDTO);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void handleImageStorePersonDelete(String imageStoreId, List<String> changePersonIds) {
|
|
||||||
if (Collections3.isEmpty(changePersonIds)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
DelGroupPersonDTO deleteParam = new DelGroupPersonDTO();
|
|
||||||
deleteParam.setImageStoreId(imageStoreId);
|
|
||||||
deleteParam.setLastUpdateTime(Long.valueOf(System.currentTimeMillis()));
|
|
||||||
deleteParam.setLastUpdateUserId(this.context.getUser().getCaller());
|
|
||||||
deleteParam.setExpiryBeginDateStatus(Integer.valueOf(0));
|
|
||||||
deleteParam.setExpiryEndDateStatus(Integer.valueOf(0));
|
|
||||||
DevicePersonSyncLogDTO devicePersonSyncLogDTO = new DevicePersonSyncLogDTO();
|
|
||||||
devicePersonSyncLogDTO.setImageStoreId(imageStoreId);
|
|
||||||
devicePersonSyncLogDTO.setStatus(Integer.valueOf(SyncStatusEnum.NOT_PULL.getValue()));
|
|
||||||
devicePersonSyncLogDTO.setCode("");
|
|
||||||
devicePersonSyncLogDTO.setErrorMessage("");
|
|
||||||
devicePersonSyncLogDTO.setLastUpdateTime(deleteParam.getLastUpdateTime());
|
|
||||||
devicePersonSyncLogDTO.setUpdateInfo("\u5220\u9664\u4eba\u5458,\u66f4\u65b0\u540c\u6b65\u8bb0\u5f55\u72b6\u6001:\u8bbe\u5907\u672a\u62c9\u53d6");
|
|
||||||
devicePersonSyncLogDTO.setIsDel(Integer.valueOf(DelStatusEnum.DELETED.getCode().shortValue()));
|
|
||||||
List partition = Lists.partition(changePersonIds, (int)this.delBatchSize);
|
|
||||||
for (List list : partition) {
|
|
||||||
deleteParam.setPersonIds((Collection)list);
|
|
||||||
devicePersonSyncLogDTO.setPersonIds(list);
|
|
||||||
this.groupPersonRefMapper.logicDeleteExpireNullByParam(deleteParam);
|
|
||||||
int res = this.devicePersonSyncLogMapper.updateStatusByCondition(devicePersonSyncLogDTO);
|
|
||||||
this.logger.debug("\u5220\u9664\u4eba\u5458,\u66f4\u65b0[{}]\u6761\u540c\u6b65\u8bb0\u5f55,\u56fe\u5e93Id:[{}],\u4eba\u5458Id\u5217\u8868[{}]", new Object[]{res, imageStoreId, JSON.toJSONString((Object)list)});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void deletePersonFromImageStores(ImgStorePerson imgStorePerson, Set<String> imageStoreIdsNeedDelete) {
|
|
||||||
if (!CollectionUtils.isEmpty(imageStoreIdsNeedDelete)) {
|
|
||||||
DelGroupPersonDTO deleteParam = new DelGroupPersonDTO();
|
|
||||||
deleteParam.setPersonId(imgStorePerson.getId());
|
|
||||||
deleteParam.setImageStoreIds(imageStoreIdsNeedDelete);
|
|
||||||
deleteParam.setLastUpdateTime(Long.valueOf(System.currentTimeMillis()));
|
|
||||||
deleteParam.setLastUpdateUserId(this.context.getUser().getCaller());
|
|
||||||
this.groupPersonRefMapper.logicDeleteExpireNullByParam(deleteParam);
|
|
||||||
}
|
|
||||||
for (String deleteImageStoreId : imageStoreIdsNeedDelete) {
|
|
||||||
this.handleImageStoreImageChange(deleteImageStoreId, Sets.newHashSet((Object[])new String[]{imgStorePerson.getImageId()}), false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Async(value="handleImageTaskExecutor")
|
|
||||||
public void handleImageStoreImageChange(String imageStoreId, Set<String> changeImageIds, boolean add) {
|
|
||||||
if (Collections3.isEmpty(changeImageIds)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
ArrayList<String> changeImageList = new ArrayList<String>(changeImageIds);
|
|
||||||
if (add) {
|
|
||||||
CpHandleFaceParam handleFaceParam = new CpHandleFaceParam();
|
|
||||||
handleFaceParam.setImageStoreId(imageStoreId);
|
|
||||||
changeImageList.stream().forEach(imageId -> {
|
|
||||||
try {
|
|
||||||
handleFaceParam.setImageId(imageId);
|
|
||||||
CloudwalkResult addFaceResult = this.cpImageStoreToolService.addFace(handleFaceParam);
|
|
||||||
this.updateGroupPersonRef(imageStoreId, (String)imageId, add, (CloudwalkResult<HandleFaceResult>)addFaceResult);
|
|
||||||
}
|
|
||||||
catch (ServiceException e) {
|
|
||||||
this.logger.warn("handleImageStoreImageChange exception,errorCode:[{}], errorMessage:[{}]", (Object)e.getCode(), (Object)e.getMessage());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
CpHandleFaceParam cpHandleFaceParam = new CpHandleFaceParam();
|
|
||||||
cpHandleFaceParam.setImageStoreId(imageStoreId);
|
|
||||||
changeImageList.stream().forEach(imageId -> {
|
|
||||||
try {
|
|
||||||
cpHandleFaceParam.setImageId(imageId);
|
|
||||||
CloudwalkResult removeFaceResult = this.cpImageStoreToolService.removeFace(cpHandleFaceParam);
|
|
||||||
this.updateGroupPersonRef(imageStoreId, (String)imageId, add, (CloudwalkResult<HandleFaceResult>)removeFaceResult);
|
|
||||||
}
|
|
||||||
catch (ServiceException e) {
|
|
||||||
this.logger.warn("handleImageStoreImageChange exception,errorCode:[{}], errorMessage:[{}]", (Object)e.getCode(), (Object)e.getMessage());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private int updateGroupPersonRef(String imageStoreId, String imageId, boolean add, CloudwalkResult<HandleFaceResult> handleFaceResult) throws ServiceException {
|
|
||||||
ImgStorePersonQueryDto queryDto = new ImgStorePersonQueryDto();
|
|
||||||
queryDto.setImageIds(Arrays.asList(imageId));
|
|
||||||
List personList = this.imgStorePersonMapper.getByImageId(queryDto);
|
|
||||||
if (CollectionUtils.isEmpty((Collection)personList)) {
|
|
||||||
this.logger.warn("\u6839\u636eimageId[{}]\u83b7\u53d6\u4e0d\u5230\u4eba\u5458\u4fe1\u606f", (Object)imageId);
|
|
||||||
throw new ServiceException("\u4eba\u5458\u4fe1\u606f\u8be6\u60c5\u67e5\u8be2\u5931\u8d25\uff0c\u539f\u56e0\uff1a{}", this.getMessage("\u4eba\u5458\u4fe1\u606f\u8be6\u60c5\u67e5\u8be2\u5931\u8d25\uff0c\u539f\u56e0\uff1a{}"));
|
|
||||||
}
|
|
||||||
GroupPersonRef groupPersonRef = new GroupPersonRef();
|
|
||||||
groupPersonRef.setImageStoreId(imageStoreId);
|
|
||||||
List groupPersonRefList = this.groupPersonRefMapper.selectByCondition(groupPersonRef, personList.stream().map(ImgStorePerson::getId).collect(Collectors.toList()));
|
|
||||||
if (CollectionUtils.isEmpty((Collection)groupPersonRefList)) {
|
|
||||||
this.logger.warn("\u56fe\u5e93\u56fe\u7247\u540c\u6b65\u5931\u8d25,\u6839\u636eimageStoreId:[{}],personId:[{}]\u83b7\u53d6\u4e0d\u5230\u56fe\u5e93\u4eba\u5458\u5217\u8868\u4fe1\u606f", (Object)imageStoreId, (Object)((HandleFaceResult)handleFaceResult.getData()).getPersonId());
|
|
||||||
throw new ServiceException("53014702", this.getMessage("53014702"));
|
|
||||||
}
|
|
||||||
groupPersonRef.setGroupStatus(add ? GroupModelStatusEnum.MODEL_FAILED.getCode() : GroupModelStatusEnum.MODEL_DEL_FAILED.getCode());
|
|
||||||
groupPersonRef.setErrorMessage(handleFaceResult.getMessage());
|
|
||||||
if (handleFaceResult.isSuccess() && ((HandleFaceResult)handleFaceResult.getData()).getResult() == 0) {
|
|
||||||
groupPersonRef.setGroupStatus(add ? GroupModelStatusEnum.MODEL_COMPLETED.getCode() : GroupModelStatusEnum.MODEL_WAIT.getCode());
|
|
||||||
groupPersonRef.setGroupTime(add ? Long.valueOf(System.currentTimeMillis()) : null);
|
|
||||||
groupPersonRef.setErrorMessage(((HandleFaceResult)handleFaceResult.getData()).getInfo());
|
|
||||||
groupPersonRef.setGender(((HandleFaceResult)handleFaceResult.getData()).getGender());
|
|
||||||
groupPersonRef.setAge(((HandleFaceResult)handleFaceResult.getData()).getAge());
|
|
||||||
}
|
|
||||||
return this.groupPersonRefMapper.updateImageDataByIds(groupPersonRef, Arrays.asList(((GroupPersonRef)groupPersonRefList.get(0)).getId()));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Transactional(rollbackFor={Exception.class}, propagation=Propagation.REQUIRED)
|
|
||||||
public void updateGroupPersonRefStatus(short status, Set<String> ids) {
|
|
||||||
GroupPersonRef record = new GroupPersonRef();
|
|
||||||
record.setStatus(Short.valueOf(status));
|
|
||||||
if (0 == status) {
|
|
||||||
record.setIsDel(DelStatusEnum.NORAML.getCode());
|
|
||||||
} else {
|
|
||||||
record.setIsDel(DelStatusEnum.DELETED.getCode());
|
|
||||||
}
|
|
||||||
record.setLastUpdateTime(Long.valueOf(System.currentTimeMillis()));
|
|
||||||
this.groupPersonRefMapper.updateStatusByIds(record, ids);
|
|
||||||
DevicePersonSyncLogDTO syncLogDTO = new DevicePersonSyncLogDTO();
|
|
||||||
syncLogDTO.setGroupPersonRefIds(new ArrayList<String>(ids));
|
|
||||||
syncLogDTO.setLastUpdateTime(record.getLastUpdateTime());
|
|
||||||
this.devicePersonSyncLogMapper.updateLastTimeByGroupPersonRef(syncLogDTO);
|
|
||||||
}
|
|
||||||
|
|
||||||
private GroupPersonRef generateGroupPersonRefAdd(GroupPersonRef groupPersonRef) {
|
|
||||||
groupPersonRef.setId(CloudwalkDateUtils.getUUID());
|
|
||||||
long time = System.currentTimeMillis();
|
|
||||||
groupPersonRef.setCreateTime(Long.valueOf(time));
|
|
||||||
groupPersonRef.setCreateUserId("system");
|
|
||||||
groupPersonRef.setLastUpdateUserId("system");
|
|
||||||
groupPersonRef.setLastUpdateTime(Long.valueOf(time));
|
|
||||||
if (groupPersonRef.getStatus() == null) {
|
|
||||||
groupPersonRef.setIsDel(DelStatusEnum.NORAML.getCode());
|
|
||||||
} else if (0 == groupPersonRef.getStatus()) {
|
|
||||||
groupPersonRef.setIsDel(DelStatusEnum.NORAML.getCode());
|
|
||||||
} else {
|
|
||||||
groupPersonRef.setIsDel(DelStatusEnum.DELETED.getCode());
|
|
||||||
}
|
|
||||||
return groupPersonRef;
|
|
||||||
}
|
|
||||||
|
|
||||||
public SyncPersonDTO generateSyncPersonDTO(GroupPersonRef groupPersonRef, int action, Long oldExpiryBeginDate, Long oldExpiryEndDate) {
|
|
||||||
ImgStorePerson person = this.imgStorePersonMapper.selectByPrimaryKey(groupPersonRef.getPersonId());
|
|
||||||
SyncPersonDTO syncPersonDTO = new SyncPersonDTO(groupPersonRef.getId(), groupPersonRef.getImageStoreId(), person.getImageId(), action);
|
|
||||||
syncPersonDTO.setOldExpiryBeginDate(oldExpiryBeginDate);
|
|
||||||
syncPersonDTO.setOldExpiryEndDate(oldExpiryEndDate);
|
|
||||||
syncPersonDTO.setNewExpiryBeginDate(groupPersonRef.getExpiryBeginDate());
|
|
||||||
syncPersonDTO.setNewExpiryEndDate(groupPersonRef.getExpiryEndDate());
|
|
||||||
return syncPersonDTO;
|
|
||||||
}
|
|
||||||
|
|
||||||
private SyncPersonDTO generateDelSyncPersonDTO(GroupPersonRef groupPersonRef, int action, Long oldExpiryBeginDate, Long oldExpiryEndDate) {
|
|
||||||
ImgStorePerson person = this.imgStorePersonMapper.selectByPrimaryKey(groupPersonRef.getPersonId());
|
|
||||||
SyncPersonDTO syncPersonDTO = new SyncPersonDTO(groupPersonRef.getId(), groupPersonRef.getImageStoreId(), person.getImageId(), action);
|
|
||||||
syncPersonDTO.setOldExpiryBeginDate(oldExpiryBeginDate);
|
|
||||||
syncPersonDTO.setOldExpiryEndDate(oldExpiryEndDate);
|
|
||||||
syncPersonDTO.setNewExpiryBeginDate(null);
|
|
||||||
syncPersonDTO.setNewExpiryEndDate(null);
|
|
||||||
return syncPersonDTO;
|
|
||||||
}
|
|
||||||
|
|
||||||
private GroupPersonRef generateGroupPersonRefMod(GroupPersonRef groupPersonRef) {
|
|
||||||
if (groupPersonRef.getStatus() == null) {
|
|
||||||
groupPersonRef.setIsDel(DelStatusEnum.NORAML.getCode());
|
|
||||||
} else if (0 == groupPersonRef.getStatus()) {
|
|
||||||
groupPersonRef.setIsDel(DelStatusEnum.NORAML.getCode());
|
|
||||||
} else {
|
|
||||||
groupPersonRef.setIsDel(DelStatusEnum.DELETED.getCode());
|
|
||||||
}
|
|
||||||
long time = System.currentTimeMillis();
|
|
||||||
groupPersonRef.setLastUpdateUserId("system");
|
|
||||||
groupPersonRef.setLastUpdateTime(Long.valueOf(time));
|
|
||||||
return groupPersonRef;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Async
|
|
||||||
public void executeHandleGroupFace() {
|
|
||||||
long s1 = System.currentTimeMillis();
|
|
||||||
List list = this.groupPersonRefMapper.queryHandleFaceException(DelStatusEnum.NORAML.getCode(), Arrays.asList(GroupModelStatusEnum.MODEL_WAIT.getCode(), GroupModelStatusEnum.MODEL_FAILED.getCode()));
|
|
||||||
long e1 = System.currentTimeMillis();
|
|
||||||
this.logger.debug("HandleGroupFaceExceptionTask \u67e5\u8be2\u4eba\u5458\u6b63\u5e38\u4f46\u672a\u5165\u5e93\u3001\u5165\u5e93\u5931\u8d25 \u8017\u65f6\uff1a[{}]", (Object)(e1 - s1));
|
|
||||||
Map<Short, List<GroupPersonRefDTO>> groupPersonMap = list.stream().collect(Collectors.groupingBy(GroupPersonRef::getGroupStatus));
|
|
||||||
if (!CollectionUtils.isEmpty((Collection)list)) {
|
|
||||||
List<GroupPersonRefDTO> modelWaitList = groupPersonMap.get(GroupModelStatusEnum.MODEL_WAIT.getCode());
|
|
||||||
List<GroupPersonRefDTO> modelFailedList = groupPersonMap.get(GroupModelStatusEnum.MODEL_FAILED.getCode());
|
|
||||||
if (!CollectionUtils.isEmpty(modelWaitList)) {
|
|
||||||
this.logger.debug("HandleGroupFaceExceptionTask \u5904\u7406\u672a\u5165\u5e93[{}]", (Object)modelWaitList.size());
|
|
||||||
modelWaitList.stream().forEach(groupPersonRef -> this.addFace((GroupPersonRefDTO)groupPersonRef));
|
|
||||||
}
|
|
||||||
if (!CollectionUtils.isEmpty(modelFailedList)) {
|
|
||||||
this.logger.debug("HandleGroupFaceExceptionTask \u5904\u7406\u5165\u5e93\u5931\u8d25[{}]", (Object)modelFailedList.size());
|
|
||||||
modelFailedList.stream().forEach(groupPersonRef -> this.addFace((GroupPersonRefDTO)groupPersonRef));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (CollectionUtils.isEmpty((Collection)list) || list.size() < 1000) {
|
|
||||||
long s2 = System.currentTimeMillis();
|
|
||||||
list = this.groupPersonRefMapper.queryHandleFaceException(DelStatusEnum.DELETED.getCode(), Arrays.asList(GroupModelStatusEnum.MODEL_COMPLETED.getCode(), GroupModelStatusEnum.MODEL_DEL_FAILED.getCode()));
|
|
||||||
long e2 = System.currentTimeMillis();
|
|
||||||
this.logger.debug("HandleGroupFaceExceptionTask \u67e5\u8be2\u4eba\u5458\u5220\u9664\u4f46\u5165\u5e93\u5b8c\u6210\u3001\u5220\u9664\u5931\u8d25 \u8017\u65f6\uff1a[{}]", (Object)(e2 - s2));
|
|
||||||
groupPersonMap = list.stream().collect(Collectors.groupingBy(GroupPersonRef::getGroupStatus));
|
|
||||||
List<GroupPersonRefDTO> modelCompleteList = groupPersonMap.get(GroupModelStatusEnum.MODEL_COMPLETED.getCode());
|
|
||||||
List<GroupPersonRefDTO> modelDelFailedList = groupPersonMap.get(GroupModelStatusEnum.MODEL_DEL_FAILED.getCode());
|
|
||||||
if (!CollectionUtils.isEmpty(modelCompleteList)) {
|
|
||||||
this.logger.debug("HandleGroupFaceExceptionTask \u5904\u7406\u5165\u5e93\u6210\u529f[{}]", (Object)modelCompleteList.size());
|
|
||||||
modelCompleteList.stream().forEach(groupPersonRef -> this.removeFace((GroupPersonRefDTO)groupPersonRef));
|
|
||||||
}
|
|
||||||
if (!CollectionUtils.isEmpty(modelDelFailedList)) {
|
|
||||||
this.logger.debug("HandleGroupFaceExceptionTask \u5904\u7406\u5220\u9664\u5931\u8d25[{}]", (Object)modelDelFailedList.size());
|
|
||||||
modelDelFailedList.stream().forEach(groupPersonRef -> this.removeFace((GroupPersonRefDTO)groupPersonRef));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void addFace(GroupPersonRefDTO groupPersonRef) {
|
|
||||||
try {
|
|
||||||
CpHandleFaceParam param = new CpHandleFaceParam();
|
|
||||||
param.setImageStoreId(groupPersonRef.getImageStoreId());
|
|
||||||
param.setImageId(groupPersonRef.getImageId());
|
|
||||||
CloudwalkResult addFaceResult = this.cpImageStoreToolService.addFace(param);
|
|
||||||
this.updateGroupPersonRef(groupPersonRef.getImageStoreId(), groupPersonRef.getImageId(), true, (CloudwalkResult<HandleFaceResult>)addFaceResult);
|
|
||||||
}
|
|
||||||
catch (ServiceException e) {
|
|
||||||
this.logger.error("HandleGroupFaceExceptionTask executeHandleGroupFace[{}] addFace exception:{}", (Object)groupPersonRef.getId(), (Object)e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void removeFace(GroupPersonRefDTO groupPersonRef) {
|
|
||||||
try {
|
|
||||||
CpHandleFaceParam param = new CpHandleFaceParam();
|
|
||||||
param.setImageStoreId(groupPersonRef.getImageStoreId());
|
|
||||||
param.setImageId(groupPersonRef.getImageId());
|
|
||||||
CloudwalkResult removeFaceResult = this.cpImageStoreToolService.removeFace(param);
|
|
||||||
this.updateGroupPersonRef(groupPersonRef.getImageStoreId(), groupPersonRef.getImageId(), false, (CloudwalkResult<HandleFaceResult>)removeFaceResult);
|
|
||||||
}
|
|
||||||
catch (Exception e) {
|
|
||||||
this.logger.error("HandleGroupFaceExceptionTask executeHandleGroupFace[{}] removeFace exception:{}", (Object)groupPersonRef.getId(), (Object)e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setPersonProperty(GroupPersonRefDTO groupPersonRef, GroupPersonRef cpGroupPersonRef) {
|
|
||||||
AgFeatureExtractParam extractParam = new AgFeatureExtractParam();
|
|
||||||
extractParam.setImageUrl(groupPersonRef.getComparePicture());
|
|
||||||
try {
|
|
||||||
CloudwalkResult extractResult = this.cpImageStoreToolService.extractFeature(extractParam);
|
|
||||||
if (extractResult.isSuccess()) {
|
|
||||||
List qualityScoreList = ((AgFeatureExtractResult)extractResult.getData()).getQuality().stream().map(x -> x + "").collect(Collectors.toList());
|
|
||||||
cpGroupPersonRef.setAge(Integer.valueOf(new BigDecimal((String)qualityScoreList.get(10)).setScale(2, 3).intValue()));
|
|
||||||
cpGroupPersonRef.setGender(Short.valueOf(new BigDecimal((String)qualityScoreList.get(11)).shortValue()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (ServiceException e) {
|
|
||||||
this.logger.error("HandleGroupFaceExceptionTask setPersonProperty exception:{}", (Object)e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-570
@@ -1,570 +0,0 @@
|
|||||||
/*
|
|
||||||
* Decompiled with CFR 0.152.
|
|
||||||
*
|
|
||||||
* Could not load the following classes:
|
|
||||||
* cn.cloudwalk.client.organization.service.store.utils.SnowFlake
|
|
||||||
* cn.cloudwalk.data.organization.dto.QueryGroupPersonDTO
|
|
||||||
* cn.cloudwalk.data.organization.dto.SyncPersonDTO
|
|
||||||
* cn.cloudwalk.data.organization.entity.GroupPersonRef
|
|
||||||
* cn.cloudwalk.data.organization.mapper.GroupPersonRefMapper
|
|
||||||
* cn.cloudwalk.service.organization.common.JsonUtils
|
|
||||||
* cn.cloudwalk.service.organization.service.CpImageStorePersonValidateManager$SyncPersonLocal
|
|
||||||
* cn.cloudwalk.service.organization.service.CpImageStoreSyncManager
|
|
||||||
* cn.cloudwalk.service.organization.utils.BeanCopyUtils
|
|
||||||
* cn.cloudwalk.task.sdk.client.TaskExecClient
|
|
||||||
* cn.cloudwalk.task.sdk.starter.config.init.properties.QuartzTaskProperties
|
|
||||||
* cn.hutool.core.collection.ConcurrentHashSet
|
|
||||||
* com.alibaba.fastjson.JSONObject
|
|
||||||
* com.google.common.collect.Lists
|
|
||||||
* com.google.common.collect.Sets
|
|
||||||
* javax.annotation.Resource
|
|
||||||
* org.apache.commons.lang3.StringUtils
|
|
||||||
* org.quartz.Scheduler
|
|
||||||
* org.quartz.SchedulerException
|
|
||||||
* org.quartz.Trigger
|
|
||||||
* org.quartz.TriggerBuilder
|
|
||||||
* org.quartz.TriggerKey
|
|
||||||
* org.slf4j.Logger
|
|
||||||
* org.slf4j.LoggerFactory
|
|
||||||
* org.springframework.beans.factory.annotation.Autowired
|
|
||||||
* org.springframework.beans.factory.annotation.Value
|
|
||||||
* org.springframework.data.redis.connection.ReturnType
|
|
||||||
* org.springframework.data.redis.core.StringRedisTemplate
|
|
||||||
* org.springframework.data.redis.core.script.DefaultRedisScript
|
|
||||||
* org.springframework.stereotype.Service
|
|
||||||
* org.springframework.util.CollectionUtils
|
|
||||||
*/
|
|
||||||
package cn.cloudwalk.service.organization.service;
|
|
||||||
|
|
||||||
import cn.cloudwalk.client.organization.service.store.utils.SnowFlake;
|
|
||||||
import cn.cloudwalk.data.organization.dto.QueryGroupPersonDTO;
|
|
||||||
import cn.cloudwalk.data.organization.dto.SyncPersonDTO;
|
|
||||||
import cn.cloudwalk.data.organization.entity.GroupPersonRef;
|
|
||||||
import cn.cloudwalk.data.organization.mapper.GroupPersonRefMapper;
|
|
||||||
import cn.cloudwalk.service.organization.common.JsonUtils;
|
|
||||||
import cn.cloudwalk.service.organization.service.CpImageStorePersonTxHandler;
|
|
||||||
import cn.cloudwalk.service.organization.service.CpImageStorePersonValidateManager;
|
|
||||||
import cn.cloudwalk.service.organization.service.CpImageStoreSyncManager;
|
|
||||||
import cn.cloudwalk.service.organization.utils.BeanCopyUtils;
|
|
||||||
import cn.cloudwalk.task.sdk.client.TaskExecClient;
|
|
||||||
import cn.cloudwalk.task.sdk.starter.config.init.properties.QuartzTaskProperties;
|
|
||||||
import cn.hutool.core.collection.ConcurrentHashSet;
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.google.common.collect.Lists;
|
|
||||||
import com.google.common.collect.Sets;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.Comparator;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.quartz.Scheduler;
|
|
||||||
import org.quartz.SchedulerException;
|
|
||||||
import org.quartz.Trigger;
|
|
||||||
import org.quartz.TriggerBuilder;
|
|
||||||
import org.quartz.TriggerKey;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.data.redis.connection.ReturnType;
|
|
||||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
|
||||||
import org.springframework.data.redis.core.script.DefaultRedisScript;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.springframework.util.CollectionUtils;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class CpImageStorePersonValidateManager {
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(CpImageStorePersonValidateManager.class);
|
|
||||||
private final String VALIDATE_JOB_GROUP_LOCK = "validate_job_group_lock:";
|
|
||||||
@Value(value="${group-person.syn.config.lock-validate-job-group-second:30}")
|
|
||||||
private String lockValidateJobGroupSecond;
|
|
||||||
@Value(value="${group-person.syn.config.lock-validate-job-group-time-out:120}")
|
|
||||||
private String lockValidateJobGroupTimeOut;
|
|
||||||
@Value(value="${group-person.syn.config.delay-add-validate-data:false}")
|
|
||||||
private Boolean delayAddValidateData;
|
|
||||||
@Value(value="${group-person.syn.config.delay-add-validate-hour:48}")
|
|
||||||
private Long delayAddValidateHour;
|
|
||||||
@Autowired
|
|
||||||
private QuartzTaskProperties quartzTaskProperties;
|
|
||||||
@Autowired
|
|
||||||
private TaskExecClient taskExecClient;
|
|
||||||
@Autowired
|
|
||||||
private CpImageStorePersonTxHandler cpImageStorePersonTxHandler;
|
|
||||||
@Autowired
|
|
||||||
private CpImageStoreSyncManager cpImageStoreSyncManager;
|
|
||||||
@Autowired
|
|
||||||
private StringRedisTemplate redisTemplate;
|
|
||||||
@Autowired
|
|
||||||
private DefaultRedisScript<String> lockValidateJobRedisScript;
|
|
||||||
@Autowired
|
|
||||||
private DefaultRedisScript<String> unlockValidateJobRedisScript;
|
|
||||||
@Resource
|
|
||||||
private GroupPersonRefMapper groupPersonRefMapper;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* WARNING - Removed try catching itself - possible behaviour change.
|
|
||||||
*/
|
|
||||||
public void addValidateData(List<SyncPersonDTO> syncPersonList) {
|
|
||||||
Long lockValue;
|
|
||||||
log.info("bind\u63a5\u53e3service \u67e5\u8be2syncPersonList\uff1a{}", (Object)JSONObject.toJSONString(syncPersonList));
|
|
||||||
ConcurrentHashSet deleteSet = new ConcurrentHashSet();
|
|
||||||
ConcurrentHashMap addMap = new ConcurrentHashMap();
|
|
||||||
ConcurrentHashMap removeMap = new ConcurrentHashMap();
|
|
||||||
ConcurrentHashSet addSet = new ConcurrentHashSet();
|
|
||||||
HashSet changeGroupIdSet = Sets.newHashSet();
|
|
||||||
long currentTime = System.currentTimeMillis();
|
|
||||||
syncPersonList.parallelStream().forEach(arg_0 -> this.lambda$addValidateData$4(changeGroupIdSet, currentTime, (Set)deleteSet, removeMap, addMap, (Set)addSet, arg_0));
|
|
||||||
Iterator iterator = addSet.iterator();
|
|
||||||
while (iterator.hasNext()) {
|
|
||||||
SyncPersonDTO syncPersonDTO = (SyncPersonDTO)iterator.next();
|
|
||||||
if (deleteSet.contains(syncPersonDTO)) {
|
|
||||||
deleteSet.remove(syncPersonDTO);
|
|
||||||
iterator.remove();
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (!StringUtils.isBlank((CharSequence)syncPersonDTO.getImageId())) continue;
|
|
||||||
iterator.remove();
|
|
||||||
}
|
|
||||||
Scheduler scheduler = this.taskExecClient.getScheduler(this.quartzTaskProperties.getSchedulerName());
|
|
||||||
for (Map.Entry entry : removeMap.entrySet()) {
|
|
||||||
Long l = (Long)entry.getKey();
|
|
||||||
lockValue = SnowFlake.nextId();
|
|
||||||
try {
|
|
||||||
if (this.validateJobGroupLock(l, lockValue)) {
|
|
||||||
String dataSet;
|
|
||||||
TriggerKey triggerKey = TriggerKey.triggerKey((String)l.toString(), (String)"QZ_PERSON_VALIDATE_JOB");
|
|
||||||
Trigger trigger = scheduler.getTrigger(triggerKey);
|
|
||||||
if (trigger == null || !StringUtils.isNotBlank((CharSequence)(dataSet = trigger.getJobDataMap().getString("VALIDATE_TRIGGER_KEY")))) continue;
|
|
||||||
List<SyncPersonLocal> syncPersonDTOS = JsonUtils.toObjList((String)dataSet, SyncPersonLocal.class);
|
|
||||||
syncPersonDTOS = CpImageStorePersonValidateManager.removeAll(syncPersonDTOS, (Set)entry.getValue());
|
|
||||||
if (addMap.containsKey(l)) {
|
|
||||||
Set keyAddSet = (Set)addMap.get(l);
|
|
||||||
syncPersonDTOS = CpImageStorePersonValidateManager.addAll(syncPersonDTOS, keyAddSet);
|
|
||||||
addMap.remove(l);
|
|
||||||
}
|
|
||||||
trigger.getJobDataMap().put("VALIDATE_TRIGGER_KEY", JsonUtils.toJson(syncPersonDTOS));
|
|
||||||
scheduler.rescheduleJob(triggerKey, trigger);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
log.error("CpImageStorePersonValidateManager addValidateData removeJob time out");
|
|
||||||
}
|
|
||||||
catch (SchedulerException e) {
|
|
||||||
log.error("\u83b7\u53d6trigger\u5f02\u5e38\uff1a{}", (Object)e.getLocalizedMessage());
|
|
||||||
}
|
|
||||||
catch (Exception e) {
|
|
||||||
log.error("\u79fb\u9664trigger\u672a\u77e5\u5f02\u5e38\uff1a{}", (Object)e.getMessage());
|
|
||||||
}
|
|
||||||
finally {
|
|
||||||
this.validateJobGroupUnLock(l, lockValue);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (Map.Entry entry : addMap.entrySet()) {
|
|
||||||
if (((Set)entry.getValue()).isEmpty()) continue;
|
|
||||||
Long l = (Long)entry.getKey();
|
|
||||||
lockValue = SnowFlake.nextId();
|
|
||||||
Long addValidateTime = currentTime + this.delayAddValidateHour * 60L * 60L * 1000L;
|
|
||||||
if (this.delayAddValidateData.booleanValue() && l > addValidateTime) continue;
|
|
||||||
try {
|
|
||||||
if (this.validateJobGroupLock(l, lockValue)) {
|
|
||||||
TriggerKey triggerKey = TriggerKey.triggerKey((String)l.toString(), (String)"QZ_PERSON_VALIDATE_JOB");
|
|
||||||
Trigger trigger = scheduler.getTrigger(triggerKey);
|
|
||||||
if (trigger == null) {
|
|
||||||
trigger = TriggerBuilder.newTrigger().withIdentity(l.toString(), "QZ_PERSON_VALIDATE_JOB").withDescription("trigger at:" + l).forJob("PERSON_VALIDATE_JOB_NAME", "QZ_PERSON_VALIDATE_JOB").startAt(new Date(l)).usingJobData("VALIDATE_TRIGGER_KEY", JsonUtils.toJson(entry.getValue())).build();
|
|
||||||
scheduler.scheduleJob(trigger);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
String dataSet = trigger.getJobDataMap().getString("VALIDATE_TRIGGER_KEY");
|
|
||||||
List<Object> syncPersonDtoList = StringUtils.isNotBlank((CharSequence)dataSet) ? JsonUtils.toObjList((String)dataSet, SyncPersonLocal.class) : Lists.newArrayList();
|
|
||||||
syncPersonDtoList = CpImageStorePersonValidateManager.addAll(syncPersonDtoList, (Set)entry.getValue());
|
|
||||||
trigger.getJobDataMap().put("VALIDATE_TRIGGER_KEY", JsonUtils.toJson((Object)syncPersonDtoList));
|
|
||||||
scheduler.rescheduleJob(triggerKey, trigger);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
log.error("CpImageStorePersonValidateManager addValidateData addOrModJob time out");
|
|
||||||
}
|
|
||||||
catch (SchedulerException e) {
|
|
||||||
log.error("\u6dfb\u52a0trigger\u5f02\u5e38\uff1a{}", (Object)e.getLocalizedMessage());
|
|
||||||
}
|
|
||||||
catch (Exception e) {
|
|
||||||
log.error("\u6dfb\u52a0trigger\u672a\u77e5\u5f02\u5e38\uff1a{}", (Object)e.getMessage());
|
|
||||||
}
|
|
||||||
finally {
|
|
||||||
this.validateJobGroupUnLock(l, lockValue);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.updateExpiryDateStatus(currentTime, syncPersonList);
|
|
||||||
Map<String, List<SyncPersonDTO>> deleteImageMap = deleteSet.parallelStream().collect(Collectors.groupingBy(SyncPersonDTO::getImageStoreId));
|
|
||||||
for (Map.Entry entry : deleteImageMap.entrySet()) {
|
|
||||||
Set<String> keySet = ((List)entry.getValue()).parallelStream().map(SyncPersonDTO::getImageId).collect(Collectors.toSet());
|
|
||||||
this.cpImageStorePersonTxHandler.handleImageStoreImageChange((String)entry.getKey(), keySet, false);
|
|
||||||
}
|
|
||||||
Map<String, List<SyncPersonDTO>> addImageMap = addSet.parallelStream().collect(Collectors.groupingBy(SyncPersonDTO::getImageStoreId));
|
|
||||||
for (Map.Entry<String, List<SyncPersonDTO>> entry : addImageMap.entrySet()) {
|
|
||||||
Set<String> keySet = entry.getValue().parallelStream().map(SyncPersonDTO::getImageId).collect(Collectors.toSet());
|
|
||||||
this.cpImageStorePersonTxHandler.handleImageStoreImageChange(entry.getKey(), keySet, true);
|
|
||||||
}
|
|
||||||
this.cpImageStoreSyncManager.sendChangeToDevice((Set)changeGroupIdSet, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateExpiryDateStatus(Long currentTime, List<SyncPersonDTO> syncPersonList) {
|
|
||||||
GroupPersonRef groupPersonRef = new GroupPersonRef();
|
|
||||||
syncPersonList.stream().forEach(syncPerson -> {
|
|
||||||
Long addValidateTime = currentTime + this.delayAddValidateHour * 60L * 60L * 1000L;
|
|
||||||
groupPersonRef.setId(syncPerson.getGroupPersonRefId());
|
|
||||||
groupPersonRef.setExpiryBeginDateStatus(Integer.valueOf(1));
|
|
||||||
if (this.delayAddValidateData.booleanValue() && null != syncPerson.getNewExpiryBeginDate() && syncPerson.getNewExpiryBeginDate() > addValidateTime) {
|
|
||||||
groupPersonRef.setExpiryBeginDateStatus(Integer.valueOf(0));
|
|
||||||
}
|
|
||||||
groupPersonRef.setExpiryEndDateStatus(Integer.valueOf(1));
|
|
||||||
if (this.delayAddValidateData.booleanValue() && null != syncPerson.getNewExpiryEndDate() && syncPerson.getNewExpiryEndDate() > addValidateTime) {
|
|
||||||
groupPersonRef.setExpiryEndDateStatus(Integer.valueOf(0));
|
|
||||||
}
|
|
||||||
HashSet<String> ids = new HashSet<String>();
|
|
||||||
ids.add(groupPersonRef.getId());
|
|
||||||
this.groupPersonRefMapper.updateStatusByIds(groupPersonRef, ids);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean validateJobGroupLock(Long key, Long lockValue) {
|
|
||||||
Long start = System.currentTimeMillis();
|
|
||||||
log.info("CpImageStorePersonValidateManager validateJobGroupLock\uff1a{},{},{}", new Object[]{key, lockValue, start});
|
|
||||||
String lockKey = "validate_job_group_lock:" + key;
|
|
||||||
while (true) {
|
|
||||||
Long lockResult;
|
|
||||||
if (0L == (lockResult = (Long)this.redisTemplate.execute(connection -> (Long)connection.eval(this.lockValidateJobRedisScript.getScriptAsString().getBytes(), ReturnType.INTEGER, 0, (byte[][])new byte[][]{lockKey.getBytes(), String.valueOf(lockValue).getBytes(), this.lockValidateJobGroupSecond.getBytes()})))) {
|
|
||||||
log.info("CpImageStorePersonValidateManager validateJobGroupLock success:{}", (Object)key);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
long waitTime = System.currentTimeMillis() - start;
|
|
||||||
log.info("CpImageStorePersonValidateManager validateJobGroupLock wait\uff1a{},{}", (Object)key, (Object)waitTime);
|
|
||||||
if (waitTime >= Long.valueOf(this.lockValidateJobGroupTimeOut)) {
|
|
||||||
log.info("CpImageStorePersonValidateManager validateJobGroupLock wait out:{}", (Object)key);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
Thread.sleep(100L);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
catch (InterruptedException e) {
|
|
||||||
log.error("CpImageStorePersonValidateManager validateJobGroupLock sleep error:", (Throwable)e);
|
|
||||||
Thread.currentThread().interrupt();
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean validateJobGroupUnLock(Long key, Long lockValue) {
|
|
||||||
log.info("CpImageStorePersonValidateManager validateJobGroupUnLock\uff1a{},{}", (Object)key, (Object)lockValue);
|
|
||||||
String lockKey = "validate_job_group_lock:" + key;
|
|
||||||
Long lockResult = (Long)this.redisTemplate.execute(connection -> (Long)connection.eval(this.unlockValidateJobRedisScript.getScriptAsString().getBytes(), ReturnType.INTEGER, 0, (byte[][])new byte[][]{lockKey.getBytes(), String.valueOf(lockValue).getBytes()}));
|
|
||||||
if (0L == lockResult) {
|
|
||||||
log.info("CpImageStorePersonValidateManager validateJobGroupUnLock success\uff1a{},{}", (Object)key, (Object)lockValue);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
log.error("CpImageStorePersonValidateManager validateJobGroupUnLock fail\uff1a{},{}", (Object)key, (Object)lockValue);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void delDataManager(long currentTime, SyncPersonDTO syncPersonDTO, Set<SyncPersonDTO> deleteSet, Map<Long, Set<SyncPersonLocal>> removeMap, Map<Long, Set<SyncPersonLocal>> addMap) {
|
|
||||||
Set timeSet;
|
|
||||||
Long oldExpiryBeginDate = syncPersonDTO.getOldExpiryBeginDate();
|
|
||||||
Long oldExpiryEndDate = syncPersonDTO.getOldExpiryEndDate();
|
|
||||||
Long newExpiryBeginDate = syncPersonDTO.getNewExpiryBeginDate();
|
|
||||||
Long newExpiryEndDate = syncPersonDTO.getNewExpiryEndDate();
|
|
||||||
deleteSet.add(syncPersonDTO);
|
|
||||||
if (oldExpiryBeginDate != null) {
|
|
||||||
Set removeAddSet = removeMap.computeIfAbsent(oldExpiryBeginDate, k -> new ConcurrentHashSet());
|
|
||||||
removeAddSet.add(new SyncPersonLocal(syncPersonDTO.getGroupPersonRefId(), syncPersonDTO.getImageStoreId(), syncPersonDTO.getImageId(), 0));
|
|
||||||
}
|
|
||||||
if (oldExpiryEndDate != null) {
|
|
||||||
Set removeEndSet = removeMap.computeIfAbsent(oldExpiryEndDate, k -> new ConcurrentHashSet());
|
|
||||||
removeEndSet.add(new SyncPersonLocal(syncPersonDTO.getGroupPersonRefId(), syncPersonDTO.getImageStoreId(), syncPersonDTO.getImageId(), -1));
|
|
||||||
}
|
|
||||||
if (newExpiryBeginDate != null && newExpiryBeginDate > currentTime) {
|
|
||||||
timeSet = addMap.computeIfAbsent(newExpiryBeginDate, k -> new ConcurrentHashSet());
|
|
||||||
timeSet.add(new SyncPersonLocal(syncPersonDTO.getGroupPersonRefId(), syncPersonDTO.getImageStoreId(), syncPersonDTO.getImageId(), 0));
|
|
||||||
}
|
|
||||||
if (newExpiryEndDate != null && newExpiryEndDate > currentTime) {
|
|
||||||
timeSet = addMap.computeIfAbsent(newExpiryEndDate, k -> new ConcurrentHashSet());
|
|
||||||
timeSet.add(new SyncPersonLocal(syncPersonDTO.getGroupPersonRefId(), syncPersonDTO.getImageStoreId(), syncPersonDTO.getImageId(), -1));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void addDataManager(long currentTime, SyncPersonDTO syncPersonDTO, Set<SyncPersonDTO> addSet, Map<Long, Set<SyncPersonLocal>> removeMap, Map<Long, Set<SyncPersonLocal>> addMap) {
|
|
||||||
Set timeSet;
|
|
||||||
Long oldExpiryBeginDate = syncPersonDTO.getOldExpiryBeginDate();
|
|
||||||
Long oldExpiryEndDate = syncPersonDTO.getOldExpiryEndDate();
|
|
||||||
Long newExpiryBeginDate = syncPersonDTO.getNewExpiryBeginDate();
|
|
||||||
Long newExpiryEndDate = syncPersonDTO.getNewExpiryEndDate();
|
|
||||||
if (newExpiryBeginDate == null || newExpiryBeginDate <= currentTime) {
|
|
||||||
addSet.add(syncPersonDTO);
|
|
||||||
} else {
|
|
||||||
timeSet = addMap.computeIfAbsent(newExpiryBeginDate, k -> new ConcurrentHashSet());
|
|
||||||
timeSet.add(new SyncPersonLocal(syncPersonDTO.getGroupPersonRefId(), syncPersonDTO.getImageStoreId(), syncPersonDTO.getImageId(), 0));
|
|
||||||
}
|
|
||||||
if (newExpiryEndDate != null && newExpiryEndDate <= currentTime) {
|
|
||||||
addSet.remove(syncPersonDTO);
|
|
||||||
} else if (newExpiryEndDate != null) {
|
|
||||||
timeSet = addMap.computeIfAbsent(newExpiryEndDate, k -> new ConcurrentHashSet());
|
|
||||||
timeSet.add(new SyncPersonLocal(syncPersonDTO.getGroupPersonRefId(), syncPersonDTO.getImageStoreId(), syncPersonDTO.getImageId(), -1));
|
|
||||||
}
|
|
||||||
if (oldExpiryBeginDate != null) {
|
|
||||||
Set removeAddSet = removeMap.computeIfAbsent(oldExpiryBeginDate, k -> new ConcurrentHashSet());
|
|
||||||
removeAddSet.add(new SyncPersonLocal(syncPersonDTO.getGroupPersonRefId(), syncPersonDTO.getImageStoreId(), syncPersonDTO.getImageId(), 0));
|
|
||||||
}
|
|
||||||
if (oldExpiryEndDate != null) {
|
|
||||||
Set removeEndSet = removeMap.computeIfAbsent(oldExpiryEndDate, k -> new ConcurrentHashSet());
|
|
||||||
removeEndSet.add(new SyncPersonLocal(syncPersonDTO.getGroupPersonRefId(), syncPersonDTO.getImageStoreId(), syncPersonDTO.getImageId(), -1));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateDataManage(long currentTime, SyncPersonDTO syncPersonDTO, Set<SyncPersonDTO> deleteSet, Set<SyncPersonDTO> addSet, Map<Long, Set<SyncPersonLocal>> removeMap, Map<Long, Set<SyncPersonLocal>> addMap) {
|
|
||||||
Set timeSet;
|
|
||||||
boolean addFlag;
|
|
||||||
String oldImageId = syncPersonDTO.getOldImageId();
|
|
||||||
Long oldExpiryBeginDate = syncPersonDTO.getOldExpiryBeginDate();
|
|
||||||
Long oldExpiryEndDate = syncPersonDTO.getOldExpiryEndDate();
|
|
||||||
Long newExpiryBeginDate = syncPersonDTO.getNewExpiryBeginDate();
|
|
||||||
Long newExpiryEndDate = syncPersonDTO.getNewExpiryEndDate();
|
|
||||||
boolean bl = addFlag = !(newExpiryBeginDate != null && newExpiryBeginDate > currentTime || newExpiryEndDate != null && newExpiryEndDate <= currentTime);
|
|
||||||
if (addFlag) {
|
|
||||||
addSet.add(syncPersonDTO);
|
|
||||||
}
|
|
||||||
if (StringUtils.isNotBlank((CharSequence)oldImageId)) {
|
|
||||||
SyncPersonDTO delDto = new SyncPersonDTO();
|
|
||||||
BeanCopyUtils.copyProperties((Object)syncPersonDTO, (Object)delDto);
|
|
||||||
delDto.setImageId(oldImageId);
|
|
||||||
deleteSet.add(delDto);
|
|
||||||
} else {
|
|
||||||
boolean delFlag;
|
|
||||||
boolean bl2 = delFlag = !(!StringUtils.isBlank((CharSequence)oldImageId) || oldExpiryBeginDate != null && oldExpiryBeginDate > currentTime || oldExpiryEndDate != null && oldExpiryEndDate <= currentTime);
|
|
||||||
if (delFlag) {
|
|
||||||
deleteSet.add(syncPersonDTO);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (oldExpiryBeginDate != null) {
|
|
||||||
Set removeAddSet = removeMap.computeIfAbsent(oldExpiryBeginDate, k -> new ConcurrentHashSet());
|
|
||||||
if (StringUtils.isNotBlank((CharSequence)oldImageId)) {
|
|
||||||
removeAddSet.add(new SyncPersonLocal(syncPersonDTO.getGroupPersonRefId(), syncPersonDTO.getImageStoreId(), oldImageId, 0));
|
|
||||||
} else {
|
|
||||||
removeAddSet.add(new SyncPersonLocal(syncPersonDTO.getGroupPersonRefId(), syncPersonDTO.getImageStoreId(), syncPersonDTO.getImageId(), 0));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (oldExpiryEndDate != null) {
|
|
||||||
Set removeEndSet = removeMap.computeIfAbsent(oldExpiryEndDate, k -> new ConcurrentHashSet());
|
|
||||||
if (StringUtils.isNotBlank((CharSequence)oldImageId)) {
|
|
||||||
removeEndSet.add(new SyncPersonLocal(syncPersonDTO.getGroupPersonRefId(), syncPersonDTO.getImageStoreId(), oldImageId, -1));
|
|
||||||
} else {
|
|
||||||
removeEndSet.add(new SyncPersonLocal(syncPersonDTO.getGroupPersonRefId(), syncPersonDTO.getImageStoreId(), syncPersonDTO.getImageId(), -1));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (newExpiryBeginDate != null && newExpiryBeginDate > currentTime) {
|
|
||||||
timeSet = addMap.computeIfAbsent(newExpiryBeginDate, k -> new ConcurrentHashSet());
|
|
||||||
timeSet.add(new SyncPersonLocal(syncPersonDTO.getGroupPersonRefId(), syncPersonDTO.getImageStoreId(), syncPersonDTO.getImageId(), 0));
|
|
||||||
}
|
|
||||||
if (newExpiryEndDate != null && newExpiryEndDate > currentTime) {
|
|
||||||
timeSet = addMap.computeIfAbsent(newExpiryEndDate, k -> new ConcurrentHashSet());
|
|
||||||
timeSet.add(new SyncPersonLocal(syncPersonDTO.getGroupPersonRefId(), syncPersonDTO.getImageStoreId(), syncPersonDTO.getImageId(), -1));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void syncDataToGroup(String dataJson) {
|
|
||||||
Set<String> keySet;
|
|
||||||
log.info("CpImageStorePersonValidateManager syncDataToGroup start dataJson\uff1a{}", (Object)dataJson);
|
|
||||||
List syncPersonDTOS = JsonUtils.toObjList((String)dataJson, SyncPersonLocal.class);
|
|
||||||
Map<Integer, List<SyncPersonLocal>> map = syncPersonDTOS.parallelStream().collect(Collectors.groupingBy(SyncPersonLocal::getAction));
|
|
||||||
List<SyncPersonLocal> addList = map.get(0);
|
|
||||||
List<SyncPersonLocal> deleteList = map.get(-1);
|
|
||||||
if (!CollectionUtils.isEmpty(deleteList)) {
|
|
||||||
Map<String, List<SyncPersonLocal>> deleteMap = deleteList.parallelStream().collect(Collectors.groupingBy(SyncPersonLocal::getImageStoreId));
|
|
||||||
for (Map.Entry<String, List<SyncPersonLocal>> entry : deleteMap.entrySet()) {
|
|
||||||
keySet = entry.getValue().parallelStream().map(SyncPersonLocal::getImageId).collect(Collectors.toSet());
|
|
||||||
this.cpImageStorePersonTxHandler.handleImageStoreImageChange(entry.getKey(), keySet, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!CollectionUtils.isEmpty(addList)) {
|
|
||||||
Map<String, List<SyncPersonLocal>> addMap = addList.parallelStream().collect(Collectors.groupingBy(SyncPersonLocal::getImageStoreId));
|
|
||||||
for (Map.Entry<String, List<SyncPersonLocal>> entry : addMap.entrySet()) {
|
|
||||||
keySet = entry.getValue().parallelStream().map(SyncPersonLocal::getImageId).collect(Collectors.toSet());
|
|
||||||
this.cpImageStorePersonTxHandler.handleImageStoreImageChange(entry.getKey(), keySet, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!CollectionUtils.isEmpty(addList)) {
|
|
||||||
Set<String> addRefIds = addList.parallelStream().map(SyncPersonLocal::getGroupPersonRefId).collect(Collectors.toSet());
|
|
||||||
this.cpImageStorePersonTxHandler.updateGroupPersonRefStatus((short)0, addRefIds);
|
|
||||||
}
|
|
||||||
if (!CollectionUtils.isEmpty(deleteList)) {
|
|
||||||
Set<String> deleteRefIds = deleteList.parallelStream().map(SyncPersonLocal::getGroupPersonRefId).collect(Collectors.toSet());
|
|
||||||
this.cpImageStorePersonTxHandler.updateGroupPersonRefStatus((short)1, deleteRefIds);
|
|
||||||
}
|
|
||||||
if (!CollectionUtils.isEmpty((Collection)syncPersonDTOS)) {
|
|
||||||
Set changeGroupIdSet = syncPersonDTOS.parallelStream().map(SyncPersonLocal::getImageStoreId).collect(Collectors.toSet());
|
|
||||||
this.cpImageStoreSyncManager.sendChangeToDevice(changeGroupIdSet, true);
|
|
||||||
}
|
|
||||||
log.info("CpImageStorePersonValidateManager syncDataToGroup end");
|
|
||||||
}
|
|
||||||
|
|
||||||
private static List<SyncPersonLocal> removeAll(List<SyncPersonLocal> list, Set<SyncPersonLocal> set) {
|
|
||||||
if (set != null && !set.isEmpty()) {
|
|
||||||
Iterator<SyncPersonLocal> it = set.iterator();
|
|
||||||
while (it.hasNext()) {
|
|
||||||
list.remove(it.next());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static List<SyncPersonLocal> addAll(List<SyncPersonLocal> list, Set<SyncPersonLocal> set) {
|
|
||||||
if (!CollectionUtils.isEmpty(set)) {
|
|
||||||
Iterator<SyncPersonLocal> it = set.iterator();
|
|
||||||
while (it.hasNext()) {
|
|
||||||
list.add(it.next());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* WARNING - Removed try catching itself - possible behaviour change.
|
|
||||||
*/
|
|
||||||
public void delayAddValidateTrigger() {
|
|
||||||
if (!this.delayAddValidateData.booleanValue()) {
|
|
||||||
log.debug("DelayPersonValidateTask \u672a\u5f00\u542f\u5ef6\u8fdf\u6dfb\u52a0\u5b9a\u65f6\u4efb\u52a1\u5f00\u5173");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Long currentTime = System.currentTimeMillis();
|
|
||||||
Long delayTime = currentTime + this.delayAddValidateHour * 60L * 60L * 1000L;
|
|
||||||
QueryGroupPersonDTO queryGroupPersonDTO = new QueryGroupPersonDTO();
|
|
||||||
queryGroupPersonDTO.setStartTime(currentTime);
|
|
||||||
queryGroupPersonDTO.setEndTime(delayTime);
|
|
||||||
queryGroupPersonDTO.setExpiryBeginDateStatus(Integer.valueOf(0));
|
|
||||||
queryGroupPersonDTO.setExpiryEndDateStatus(Integer.valueOf(0));
|
|
||||||
List waitAddValidateList = this.groupPersonRefMapper.queryByExpiryDateStatus(queryGroupPersonDTO);
|
|
||||||
if (CollectionUtils.isEmpty((Collection)waitAddValidateList)) {
|
|
||||||
log.debug("[{}-{}]\u65f6\u95f4\u8303\u56f4\u5185\u6ca1\u6709\u9700\u8981\u6dfb\u52a0\u7684trigger", (Object)queryGroupPersonDTO.getStartTime(), (Object)queryGroupPersonDTO.getEndTime());
|
|
||||||
}
|
|
||||||
ConcurrentHashMap addMap = new ConcurrentHashMap();
|
|
||||||
ConcurrentHashSet addSet = new ConcurrentHashSet();
|
|
||||||
ConcurrentHashSet deleteSet = new ConcurrentHashSet();
|
|
||||||
HashSet changeGroupIdSet = Sets.newHashSet();
|
|
||||||
ArrayList syncPersonList = Lists.newArrayListWithCapacity((int)waitAddValidateList.size());
|
|
||||||
waitAddValidateList = waitAddValidateList.stream().sorted(Comparator.comparing(GroupPersonRef::getExpiryBeginDate)).collect(Collectors.toList());
|
|
||||||
waitAddValidateList.stream().forEach(arg_0 -> this.lambda$delayAddValidateTrigger$24(changeGroupIdSet, syncPersonList, currentTime, (Set)addSet, delayTime, addMap, (Set)deleteSet, arg_0));
|
|
||||||
Iterator iterator = addSet.iterator();
|
|
||||||
while (iterator.hasNext()) {
|
|
||||||
SyncPersonDTO syncPersonDTO = (SyncPersonDTO)iterator.next();
|
|
||||||
if (deleteSet.contains(syncPersonDTO)) {
|
|
||||||
deleteSet.remove(syncPersonDTO);
|
|
||||||
iterator.remove();
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (!StringUtils.isBlank((CharSequence)syncPersonDTO.getImageId())) continue;
|
|
||||||
iterator.remove();
|
|
||||||
}
|
|
||||||
Scheduler scheduler = this.taskExecClient.getScheduler(this.quartzTaskProperties.getSchedulerName());
|
|
||||||
for (Map.Entry entry : addMap.entrySet()) {
|
|
||||||
if (((Set)entry.getValue()).isEmpty()) continue;
|
|
||||||
Long l = (Long)entry.getKey();
|
|
||||||
Long lockValue = SnowFlake.nextId();
|
|
||||||
try {
|
|
||||||
if (this.validateJobGroupLock(l, lockValue)) {
|
|
||||||
TriggerKey triggerKey = TriggerKey.triggerKey((String)l.toString(), (String)"QZ_PERSON_VALIDATE_JOB");
|
|
||||||
Trigger trigger = scheduler.getTrigger(triggerKey);
|
|
||||||
if (trigger == null) {
|
|
||||||
trigger = TriggerBuilder.newTrigger().withIdentity(l.toString(), "QZ_PERSON_VALIDATE_JOB").withDescription("trigger at:" + l).forJob("PERSON_VALIDATE_JOB_NAME", "QZ_PERSON_VALIDATE_JOB").startAt(new Date(l)).usingJobData("VALIDATE_TRIGGER_KEY", JsonUtils.toJson(entry.getValue())).build();
|
|
||||||
scheduler.scheduleJob(trigger);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
String dataSet = trigger.getJobDataMap().getString("VALIDATE_TRIGGER_KEY");
|
|
||||||
List<Object> syncPersonDtoList = StringUtils.isNotBlank((CharSequence)dataSet) ? JsonUtils.toObjList((String)dataSet, SyncPersonLocal.class) : Lists.newArrayList();
|
|
||||||
syncPersonDtoList = CpImageStorePersonValidateManager.addAll(syncPersonDtoList, (Set)entry.getValue());
|
|
||||||
trigger.getJobDataMap().put("VALIDATE_TRIGGER_KEY", JsonUtils.toJson((Object)syncPersonDtoList));
|
|
||||||
scheduler.rescheduleJob(triggerKey, trigger);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
log.error("CpImageStorePersonValidateManager addValidateData addOrModJob time out");
|
|
||||||
}
|
|
||||||
catch (SchedulerException e) {
|
|
||||||
log.error("\u6dfb\u52a0trigger\u5f02\u5e38\uff1a{}", (Object)e.getLocalizedMessage());
|
|
||||||
}
|
|
||||||
catch (Exception e) {
|
|
||||||
log.error("\u6dfb\u52a0trigger\u672a\u77e5\u5f02\u5e38\uff1a{}", (Object)e.getMessage());
|
|
||||||
}
|
|
||||||
finally {
|
|
||||||
this.validateJobGroupUnLock(l, lockValue);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.updateExpiryDateStatus(currentTime, syncPersonList);
|
|
||||||
Map<String, List<SyncPersonDTO>> deleteImageMap = deleteSet.parallelStream().collect(Collectors.groupingBy(SyncPersonDTO::getImageStoreId));
|
|
||||||
for (Map.Entry entry : deleteImageMap.entrySet()) {
|
|
||||||
Set<String> keySet = ((List)entry.getValue()).parallelStream().map(SyncPersonDTO::getImageId).collect(Collectors.toSet());
|
|
||||||
this.cpImageStorePersonTxHandler.handleImageStoreImageChange((String)entry.getKey(), keySet, false);
|
|
||||||
}
|
|
||||||
Map<String, List<SyncPersonDTO>> addImageMap = addSet.parallelStream().collect(Collectors.groupingBy(SyncPersonDTO::getImageStoreId));
|
|
||||||
for (Map.Entry<String, List<SyncPersonDTO>> entry : addImageMap.entrySet()) {
|
|
||||||
Set<String> keySet = entry.getValue().parallelStream().map(SyncPersonDTO::getImageId).collect(Collectors.toSet());
|
|
||||||
this.cpImageStorePersonTxHandler.handleImageStoreImageChange(entry.getKey(), keySet, true);
|
|
||||||
}
|
|
||||||
this.cpImageStoreSyncManager.sendChangeToDevice((Set)changeGroupIdSet, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
private /* synthetic */ void lambda$delayAddValidateTrigger$24(Set changeGroupIdSet, List syncPersonList, Long currentTime, Set addSet, Long delayTime, Map addMap, Set deleteSet, GroupPersonRef waitAddValidate) {
|
|
||||||
Set timeSet;
|
|
||||||
waitAddValidate.setExpiryBeginDate((Long)Optional.ofNullable(waitAddValidate.getExpiryBeginDate()).map(date -> date / 1000L * 1000L).orElse(null));
|
|
||||||
waitAddValidate.setExpiryEndDate((Long)Optional.ofNullable(waitAddValidate.getExpiryEndDate()).map(date -> date / 1000L * 1000L).orElse(null));
|
|
||||||
changeGroupIdSet.add(waitAddValidate.getImageStoreId());
|
|
||||||
if (waitAddValidate.getExpiryBeginDateStatus() == 0) {
|
|
||||||
SyncPersonDTO addSyncPersonDTO = this.cpImageStorePersonTxHandler.generateSyncPersonDTO(waitAddValidate, 0, null, null);
|
|
||||||
syncPersonList.add(addSyncPersonDTO);
|
|
||||||
if (waitAddValidate.getExpiryBeginDate() <= currentTime) {
|
|
||||||
addSet.add(addSyncPersonDTO);
|
|
||||||
} else if (waitAddValidate.getExpiryBeginDate() <= delayTime) {
|
|
||||||
timeSet = addMap.computeIfAbsent(waitAddValidate.getExpiryBeginDate(), k -> new ConcurrentHashSet());
|
|
||||||
timeSet.add(new SyncPersonLocal(addSyncPersonDTO.getGroupPersonRefId(), addSyncPersonDTO.getImageStoreId(), addSyncPersonDTO.getImageId(), 0));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (waitAddValidate.getExpiryEndDateStatus() == 0) {
|
|
||||||
SyncPersonDTO deleteSyncPersonDTO = this.cpImageStorePersonTxHandler.generateSyncPersonDTO(waitAddValidate, -1, null, null);
|
|
||||||
syncPersonList.add(deleteSyncPersonDTO);
|
|
||||||
if (waitAddValidate.getExpiryEndDate() <= currentTime) {
|
|
||||||
deleteSet.add(deleteSyncPersonDTO);
|
|
||||||
} else if (waitAddValidate.getExpiryEndDate() <= delayTime) {
|
|
||||||
timeSet = addMap.computeIfAbsent(waitAddValidate.getExpiryEndDate(), k -> new ConcurrentHashSet());
|
|
||||||
timeSet.add(new SyncPersonLocal(deleteSyncPersonDTO.getGroupPersonRefId(), deleteSyncPersonDTO.getImageStoreId(), deleteSyncPersonDTO.getImageId(), -1));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private /* synthetic */ void lambda$addValidateData$4(Set changeGroupIdSet, long currentTime, Set deleteSet, Map removeMap, Map addMap, Set addSet, SyncPersonDTO syncPersonDTO) {
|
|
||||||
syncPersonDTO.setOldExpiryBeginDate((Long)Optional.ofNullable(syncPersonDTO.getOldExpiryBeginDate()).map(date -> date / 1000L * 1000L).orElse(null));
|
|
||||||
syncPersonDTO.setOldExpiryEndDate((Long)Optional.ofNullable(syncPersonDTO.getOldExpiryEndDate()).map(date -> date / 1000L * 1000L).orElse(null));
|
|
||||||
syncPersonDTO.setNewExpiryBeginDate((Long)Optional.ofNullable(syncPersonDTO.getNewExpiryBeginDate()).map(date -> date / 1000L * 1000L).orElse(null));
|
|
||||||
syncPersonDTO.setNewExpiryEndDate((Long)Optional.ofNullable(syncPersonDTO.getNewExpiryEndDate()).map(date -> date / 1000L * 1000L).orElse(null));
|
|
||||||
changeGroupIdSet.add(syncPersonDTO.getImageStoreId());
|
|
||||||
int action = syncPersonDTO.getAction();
|
|
||||||
switch (action) {
|
|
||||||
case -1: {
|
|
||||||
this.delDataManager(currentTime, syncPersonDTO, deleteSet, removeMap, addMap);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 0: {
|
|
||||||
this.addDataManager(currentTime, syncPersonDTO, addSet, removeMap, addMap);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 1: {
|
|
||||||
this.updateDataManage(currentTime, syncPersonDTO, deleteSet, addSet, removeMap, addMap);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-1218
File diff suppressed because it is too large
Load Diff
BIN
Binary file not shown.
BIN
Binary file not shown.
+2
@@ -0,0 +1,2 @@
|
|||||||
|
cn/cloudwalk/service/organization/common/FlushList.class
|
||||||
|
cn/cloudwalk/service/organization/common/FlushHandler.class
|
||||||
|
|||||||
Reference in New Issue
Block a user