mirror of
https://github.com/hpd840321/starRiverProperty.git
synced 2026-06-10 17:00:30 +08:00
Initial commit: reorganized source tree
- backend/: 13 Maven modules (cw-elevator-application, cloudwalk-cloud, intelligent-cwoscomponent, ninca-crk, etc.) - frontend/: 4 Vue projects (elevator-front, cwos-portal, alarm-front, front_acs) + decompiled + scripts - scripts/: build, test-env, tools (Docker Compose, service templates, API parity) - docs/: AGENTS.md, superpowers specs, architecture docs - .gitignore: standard Java/Maven exclusions Moved from legacy maven-*/ root layout to backend/ organized structure.
This commit is contained in:
+27
@@ -0,0 +1,27 @@
|
||||
package cn.cloudwalk.web.organization.controller;
|
||||
|
||||
// Web控制器
|
||||
import cn.cloudwalk.client.account.verify.result.AcCaptchaOutDTO;
|
||||
import cn.cloudwalk.client.account.verify.service.AcCaptchaService;
|
||||
import cn.cloudwalk.cloud.exception.ServiceException;
|
||||
import cn.cloudwalk.cloud.result.CloudwalkResult;
|
||||
import cn.cloudwalk.web.organization.controller.common.AbstractCloudwalkController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = {"/h5/captcha"})
|
||||
public class CaptchaH5Controller extends AbstractCloudwalkController {
|
||||
@Autowired private AcCaptchaService captchaService;
|
||||
|
||||
@GetMapping(value = {"/generate"})
|
||||
public CloudwalkResult<AcCaptchaOutDTO> generate() {
|
||||
try {
|
||||
return this.captchaService.generateCaptcha();
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
+95
@@ -0,0 +1,95 @@
|
||||
package cn.cloudwalk.web.organization.controller;
|
||||
|
||||
// Web控制器
|
||||
import cn.cloudwalk.client.organization.common.enums.CommonExportStateCodeEnum;
|
||||
import cn.cloudwalk.client.organization.param.ExportLabelTaskParam;
|
||||
import cn.cloudwalk.client.organization.param.ExportOrgTaskParam;
|
||||
import cn.cloudwalk.client.organization.param.ExportRecordTaskParam;
|
||||
import cn.cloudwalk.client.organization.param.PageLabelParam;
|
||||
import cn.cloudwalk.client.organization.param.organization.QueryOrganizationParam;
|
||||
import cn.cloudwalk.client.organization.personimg.param.QueryImgPersonParam;
|
||||
import cn.cloudwalk.client.organization.service.ICommonAppExportTaskService;
|
||||
import cn.cloudwalk.cloud.context.CloudwalkCallContext;
|
||||
import cn.cloudwalk.cloud.exception.ServiceException;
|
||||
import cn.cloudwalk.cloud.result.CloudwalkResult;
|
||||
import cn.cloudwalk.service.organization.common.CommonDownloadDataConfig;
|
||||
import cn.cloudwalk.web.organization.controller.common.AbstractCloudwalkController;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
public class CommonAppExportTaskController extends AbstractCloudwalkController {
|
||||
private static final Logger log = LoggerFactory.getLogger(CommonAppExportTaskController.class);
|
||||
@Autowired private ICommonAppExportTaskService commonAppExportTaskService;
|
||||
@Autowired private CommonDownloadDataConfig commonDownloadDataConfig;
|
||||
|
||||
@PostMapping(value = {"/component/export/record/add"})
|
||||
public CloudwalkResult<?> add(
|
||||
@RequestHeader(value = "businessId") String businessId, @RequestBody QueryImgPersonParam task)
|
||||
throws ServiceException {
|
||||
task.setBusinessId(businessId);
|
||||
CloudwalkCallContext cloudwalkCallContext = this.getCloudwalkContext();
|
||||
this.logger.info("添加人员检索记录导出任务... {}", (Object) task);
|
||||
ExportRecordTaskParam exportRecordTaskParam = new ExportRecordTaskParam();
|
||||
BeanUtils.copyProperties((Object) task, (Object) exportRecordTaskParam);
|
||||
String fileId =
|
||||
this.commonAppExportTaskService.add(cloudwalkCallContext, exportRecordTaskParam);
|
||||
if (fileId != null) {
|
||||
this.logger.info("添加人员检索记录导出任务成功 fileId = {}", (Object) fileId);
|
||||
return CloudwalkResult.success((Object) fileId);
|
||||
}
|
||||
this.logger.info("添加人员检索记录导出任务失败{}", (Object) task);
|
||||
return CloudwalkResult.fail(
|
||||
(String) CommonExportStateCodeEnum.EXPORT_TASK_FAILURE.getCode(),
|
||||
(String) CommonExportStateCodeEnum.EXPORT_TASK_FAILURE.getMessage());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/component/export/org/add"})
|
||||
public CloudwalkResult<?> addOrgExport(
|
||||
@RequestHeader(value = "businessId") String businessId,
|
||||
@RequestBody QueryOrganizationParam task)
|
||||
throws ServiceException {
|
||||
task.setBusinessId(businessId);
|
||||
CloudwalkCallContext cloudwalkCallContext = this.getCloudwalkContext();
|
||||
this.logger.info("添加机构检索记录导出任务... {}", (Object) task);
|
||||
ExportOrgTaskParam exportOrgTaskParam = new ExportOrgTaskParam();
|
||||
BeanUtils.copyProperties((Object) task, (Object) exportOrgTaskParam);
|
||||
String fileId =
|
||||
this.commonAppExportTaskService.addOrgExport(cloudwalkCallContext, exportOrgTaskParam);
|
||||
if (fileId != null) {
|
||||
this.logger.info("添加机构检索记录导出任务成功 fileId = {}", (Object) fileId);
|
||||
return CloudwalkResult.success((Object) fileId);
|
||||
}
|
||||
this.logger.info("添加机构检索记录导出任务失败{}", (Object) task);
|
||||
return CloudwalkResult.fail(
|
||||
(String) CommonExportStateCodeEnum.EXPORT_TASK_FAILURE.getCode(),
|
||||
(String) CommonExportStateCodeEnum.EXPORT_TASK_FAILURE.getMessage());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/component/export/label/add"})
|
||||
public CloudwalkResult<?> addLabelExport(
|
||||
@RequestHeader(value = "businessId") String businessId, @RequestBody PageLabelParam task)
|
||||
throws ServiceException {
|
||||
task.setBusinessId(businessId);
|
||||
CloudwalkCallContext cloudwalkCallContext = this.getCloudwalkContext();
|
||||
this.logger.info("添加标签检索记录导出任务... {}", (Object) task);
|
||||
ExportLabelTaskParam exportLabelTaskParam = new ExportLabelTaskParam();
|
||||
BeanUtils.copyProperties((Object) task, (Object) exportLabelTaskParam);
|
||||
String fileId =
|
||||
this.commonAppExportTaskService.addLabelExport(cloudwalkCallContext, exportLabelTaskParam);
|
||||
if (fileId != null) {
|
||||
this.logger.info("添加标签检索记录导出任务成功 fileId = {}", (Object) fileId);
|
||||
return CloudwalkResult.success((Object) fileId);
|
||||
}
|
||||
this.logger.info("添加标签检索记录导出任务失败{}", (Object) task);
|
||||
return CloudwalkResult.fail(
|
||||
(String) CommonExportStateCodeEnum.EXPORT_TASK_FAILURE.getCode(),
|
||||
(String) CommonExportStateCodeEnum.EXPORT_TASK_FAILURE.getMessage());
|
||||
}
|
||||
}
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
package cn.cloudwalk.web.organization.controller;
|
||||
|
||||
// Web控制器
|
||||
import cn.cloudwalk.client.aggregate.application.param.ApplicationImageStoreAddParam;
|
||||
import cn.cloudwalk.client.aggregate.application.param.ApplicationImageStoreDeleteParam;
|
||||
import cn.cloudwalk.client.aggregate.application.param.ApplicationImageStoreQueryParam;
|
||||
import cn.cloudwalk.client.aggregate.application.param.ApplicationImageStoreSaveParam;
|
||||
import cn.cloudwalk.client.aggregate.application.result.ApplicationImageStoreQueryResult;
|
||||
import cn.cloudwalk.client.aggregate.application.service.ApplicationImageStoreService;
|
||||
import cn.cloudwalk.cloud.page.CloudwalkPageAble;
|
||||
import cn.cloudwalk.cloud.result.CloudwalkResult;
|
||||
import cn.cloudwalk.web.organization.controller.common.AbstractCloudwalkController;
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = {"/component/application/imagestore"})
|
||||
public class CpAppImageStoreController extends AbstractCloudwalkController {
|
||||
@Autowired private ApplicationImageStoreService applicationImageStoreService;
|
||||
|
||||
@PostMapping(value = {"/add"})
|
||||
public CloudwalkResult<Boolean> add(@RequestBody ApplicationImageStoreAddParam addParam) {
|
||||
try {
|
||||
return this.applicationImageStoreService.add(addParam, this.getCloudwalkContext());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("应用图库关联新增异常,", e);
|
||||
return CloudwalkResult.fail((String) "53013525", (String) this.getMessage("53013525"));
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/delete"})
|
||||
public CloudwalkResult<Boolean> delete(
|
||||
@RequestBody ApplicationImageStoreDeleteParam deleteParam) {
|
||||
try {
|
||||
return this.applicationImageStoreService.delete(deleteParam, this.getCloudwalkContext());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("应用图库关联删除异常,", e);
|
||||
return CloudwalkResult.fail((String) "53013526", (String) this.getMessage("53013526"));
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/save"})
|
||||
public CloudwalkResult<Boolean> save(@RequestBody ApplicationImageStoreSaveParam saveParam) {
|
||||
try {
|
||||
return this.applicationImageStoreService.save(saveParam, this.getCloudwalkContext());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("应用图库关联保存异常,", e);
|
||||
return CloudwalkResult.fail((String) "53013528", (String) this.getMessage("53013528"));
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/list"})
|
||||
public CloudwalkResult<List<ApplicationImageStoreQueryResult>> list(
|
||||
@RequestBody ApplicationImageStoreQueryParam queryParam) {
|
||||
try {
|
||||
return this.applicationImageStoreService.query(queryParam, this.getCloudwalkContext());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("应用图库关联查询异常,", e);
|
||||
return CloudwalkResult.fail((String) "53013527", (String) this.getMessage("53013527"));
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/page"})
|
||||
public CloudwalkResult<CloudwalkPageAble<ApplicationImageStoreQueryResult>> page(
|
||||
@RequestBody ApplicationImageStoreQueryParam queryParam) {
|
||||
try {
|
||||
return this.applicationImageStoreService.page(queryParam, this.getCloudwalkContext());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("应用图库关联查询异常,", e);
|
||||
return CloudwalkResult.fail((String) "53013527", (String) this.getMessage("53013527"));
|
||||
}
|
||||
}
|
||||
}
|
||||
+112
@@ -0,0 +1,112 @@
|
||||
package cn.cloudwalk.web.organization.controller;
|
||||
|
||||
// Web控制器
|
||||
import cn.cloudwalk.client.organization.service.store.param.AddImageStoreParam;
|
||||
import cn.cloudwalk.client.organization.service.store.param.DelImageStoreParam;
|
||||
import cn.cloudwalk.client.organization.service.store.param.DetailImageStoreParam;
|
||||
import cn.cloudwalk.client.organization.service.store.param.EditImageStoreParam;
|
||||
import cn.cloudwalk.client.organization.service.store.param.QueryImageStoreParam;
|
||||
import cn.cloudwalk.client.organization.service.store.result.ImageStoreDetailResult;
|
||||
import cn.cloudwalk.client.organization.service.store.result.ImageStoreResult;
|
||||
import cn.cloudwalk.client.organization.service.store.result.PageImageStoreResult;
|
||||
import cn.cloudwalk.client.organization.service.store.service.CpImageStoreService;
|
||||
import cn.cloudwalk.cloud.exception.ServiceException;
|
||||
import cn.cloudwalk.cloud.page.CloudwalkPageAble;
|
||||
import cn.cloudwalk.cloud.result.CloudwalkResult;
|
||||
import cn.cloudwalk.web.organization.controller.common.AbstractCloudwalkController;
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = {"/component/imagestore"})
|
||||
public class CpImageStoreController extends AbstractCloudwalkController {
|
||||
@Autowired private CpImageStoreService cpImageStoreService;
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/add"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<String> add(@RequestBody AddImageStoreParam param) {
|
||||
try {
|
||||
return this.cpImageStoreService.add(param, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
this.logger.error("添加图库异常:{}", (Object) e.getMessage());
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("添加图库未知异常:{}", e);
|
||||
return CloudwalkResult.fail((String) "53013508", (String) this.getMessage("53013508"));
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/edit"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<Boolean> edit(@RequestBody EditImageStoreParam param) {
|
||||
try {
|
||||
return this.cpImageStoreService.edit(param, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
this.logger.error("图库编辑异常:{}", (Object) e.getMessage());
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("图库编辑未知异常:{}", e);
|
||||
return CloudwalkResult.fail((String) "53013509", (String) this.getMessage("53013509"));
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/delete"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<Boolean> delete(@RequestBody DelImageStoreParam param) {
|
||||
try {
|
||||
return this.cpImageStoreService.delete(param, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
this.logger.error("删除图库异常:{}", (Object) e.getMessage());
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("删除图库未知异常:{}", e);
|
||||
return CloudwalkResult.fail((String) "53013511", (String) this.getMessage("53013511"));
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/list"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<List<ImageStoreResult>> list(
|
||||
@RequestBody QueryImageStoreParam queryImageStoreParam) {
|
||||
try {
|
||||
return this.cpImageStoreService.list(queryImageStoreParam, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
this.logger.error("查询图库异常:{}", (Object) e.getMessage());
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("查询图库未知异常:{}", e);
|
||||
return CloudwalkResult.fail((String) "53013510", (String) this.getMessage("53013510"));
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/page"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<CloudwalkPageAble<PageImageStoreResult>> page(
|
||||
@RequestBody QueryImageStoreParam queryImageStoreParam) {
|
||||
try {
|
||||
return this.cpImageStoreService.page(queryImageStoreParam, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
this.logger.error("分页查询图库异常:{}", (Object) e.getMessage());
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("分页查询图库未知异常:{}", e);
|
||||
return CloudwalkResult.fail((String) "53013510", (String) this.getMessage("53013510"));
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/detail"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<ImageStoreDetailResult> detail(@RequestBody DetailImageStoreParam param) {
|
||||
return this.cpImageStoreService.detail(param, this.getCloudwalkContext());
|
||||
}
|
||||
}
|
||||
+164
@@ -0,0 +1,164 @@
|
||||
package cn.cloudwalk.web.organization.controller;
|
||||
|
||||
// Web控制器
|
||||
import cn.cloudwalk.client.organization.service.store.param.AddImageStorePersonParam;
|
||||
import cn.cloudwalk.client.organization.service.store.param.BatchBindImageStorePersonParam;
|
||||
import cn.cloudwalk.client.organization.service.store.param.BindImageStorePersonParam;
|
||||
import cn.cloudwalk.client.organization.service.store.param.DeleteImageStorePersonParam;
|
||||
import cn.cloudwalk.client.organization.service.store.param.QueryImageStorePersonParam;
|
||||
import cn.cloudwalk.client.organization.service.store.param.ResaveImageStorePersonParam;
|
||||
import cn.cloudwalk.client.organization.service.store.param.UpdateGroupPersonRefParam;
|
||||
import cn.cloudwalk.client.organization.service.store.result.BatchBindImageStorePersonResult;
|
||||
import cn.cloudwalk.client.organization.service.store.result.ImageStorePersonResult;
|
||||
import cn.cloudwalk.client.organization.service.store.service.CpImageStorePersonService;
|
||||
import cn.cloudwalk.cloud.exception.ServiceException;
|
||||
import cn.cloudwalk.cloud.page.CloudwalkPageAble;
|
||||
import cn.cloudwalk.cloud.result.CloudwalkResult;
|
||||
import cn.cloudwalk.web.organization.controller.common.AbstractCloudwalkController;
|
||||
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = {"/component/imagestore/person"})
|
||||
public class CpImageStorePersonController extends AbstractCloudwalkController {
|
||||
@Autowired private CpImageStorePersonService cpImageStorePersonService;
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/page"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<CloudwalkPageAble<ImageStorePersonResult>> page(
|
||||
@RequestBody QueryImageStorePersonParam queryParam) {
|
||||
try {
|
||||
return this.cpImageStorePersonService.page(queryParam, this.getCloudwalkContext());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("图库人员查询未知异常:{}", e);
|
||||
return CloudwalkResult.fail((String) "53013534", (String) this.getMessage("53013534"));
|
||||
}
|
||||
}
|
||||
|
||||
@HystrixCommand(fallbackMethod = "saveFallback")
|
||||
@RequestMapping(
|
||||
value = {"/save"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<ImageStorePersonResult> save(
|
||||
@RequestBody AddImageStorePersonParam addParam) {
|
||||
try {
|
||||
return this.cpImageStorePersonService.save(addParam, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
this.logger.error("图库人员保存异常:{}", (Object) e.getMessage());
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("图库人员保存未知异常:{}", e);
|
||||
return CloudwalkResult.fail((String) "53013532", (String) this.getMessage("53013532"));
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/delete"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<Boolean> delete(@RequestBody DeleteImageStorePersonParam deleteParam) {
|
||||
try {
|
||||
return this.cpImageStorePersonService.delete(deleteParam, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
this.logger.error("图库人员删除异常:{}", (Object) e.getMessage());
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("图库人员删除未知异常:{}", e);
|
||||
return CloudwalkResult.fail((String) "53013533", (String) this.getMessage("53013533"));
|
||||
}
|
||||
}
|
||||
|
||||
@HystrixCommand(fallbackMethod = "batchDeleteFallback")
|
||||
@RequestMapping(
|
||||
value = {"/batch/delete"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<Boolean> batchDelete(
|
||||
@RequestBody ResaveImageStorePersonParam deleteParam) {
|
||||
try {
|
||||
return this.cpImageStorePersonService.batchDelete(deleteParam, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
this.logger.error("imageStore person relation delete exception:{}", (Object) e.getMessage());
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("imageStore person relation delete unknown exception:{}", e);
|
||||
return CloudwalkResult.fail((String) "53013533", (String) this.getMessage("53013533"));
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/bind"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<Boolean> bind(@RequestBody BindImageStorePersonParam bindParam) {
|
||||
try {
|
||||
return this.cpImageStorePersonService.bind(bindParam, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
this.logger.error("图库人员绑定异常:{}", (Object) e.getMessage());
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("图库人员绑定未知异常:{}", e);
|
||||
return CloudwalkResult.fail((String) "53013541", (String) this.getMessage("53013541"));
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/batchBind"})
|
||||
public CloudwalkResult<BatchBindImageStorePersonResult> batchBind(
|
||||
@RequestBody BatchBindImageStorePersonParam batchBindParam) {
|
||||
try {
|
||||
return this.cpImageStorePersonService.batchBind(batchBindParam, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
this.logger.error("批量绑定图库人员异常:{}", (Object) e.getMessage());
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("批量绑定图库人员未知异常:{}", (Object) e.getMessage());
|
||||
return CloudwalkResult.fail((String) "53013541", (String) this.getMessage("53013541"));
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/reSaveToRepo"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<Boolean> reSaveToRepo(@RequestBody ResaveImageStorePersonParam addParam) {
|
||||
try {
|
||||
return this.cpImageStorePersonService.reSaveToRepo(addParam, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
this.logger.error("Image store person resave to repo exception:{}", (Object) e.getMessage());
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("Image store person resave to repo unknown exception:{}", e);
|
||||
return CloudwalkResult.fail((String) "53013544", (String) this.getMessage("53013544"));
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/updateGroupPersonRef"})
|
||||
public CloudwalkResult<Boolean> updateGroupPersonRef(
|
||||
@RequestBody UpdateGroupPersonRefParam param) {
|
||||
try {
|
||||
return this.cpImageStorePersonService.updateGroupPersonRef(param, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
this.logger.error(
|
||||
"CpImageStorePersonController updateGroupPersonRef ServiceException:{}",
|
||||
(Object) e.getMessage());
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
} catch (Exception e) {
|
||||
this.logger.error(
|
||||
"CpImageStorePersonController updateGroupPersonRef Exception:{}",
|
||||
(Object) e.getMessage());
|
||||
return CloudwalkResult.fail((String) "53013558", (String) this.getMessage("53013558"));
|
||||
}
|
||||
}
|
||||
|
||||
public CloudwalkResult<Boolean> batchDeleteFallback(ResaveImageStorePersonParam deleteParam) {
|
||||
this.logger.error("imageStore person relation delete exception....");
|
||||
return CloudwalkResult.fail((String) "53013533", (String) this.getMessage("53013533"));
|
||||
}
|
||||
|
||||
public CloudwalkResult<ImageStorePersonResult> saveFallback(AddImageStorePersonParam addParam) {
|
||||
this.logger.error("图库人员保存未知异常....");
|
||||
return CloudwalkResult.fail((String) "53013532", (String) this.getMessage("53013532"));
|
||||
}
|
||||
}
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
package cn.cloudwalk.web.organization.controller;
|
||||
|
||||
// Web控制器
|
||||
import cn.cloudwalk.client.aggregate.device.param.DeviceImageStoreSynLogQueryParam;
|
||||
import cn.cloudwalk.client.aggregate.device.param.DeviceImageStoreSyncParam;
|
||||
import cn.cloudwalk.client.aggregate.device.result.DeviceImageStoreSynLogQueryResult;
|
||||
import cn.cloudwalk.client.aggregate.device.service.AggDeviceImageStoreService;
|
||||
import cn.cloudwalk.client.organization.personimg.service.DevicePersonSyncService;
|
||||
import cn.cloudwalk.cloud.exception.ServiceException;
|
||||
import cn.cloudwalk.cloud.page.CloudwalkPageAble;
|
||||
import cn.cloudwalk.cloud.result.CloudwalkResult;
|
||||
import cn.cloudwalk.service.organization.service.CpImageStorePersonSynManager;
|
||||
import cn.cloudwalk.web.organization.controller.common.AbstractCloudwalkController;
|
||||
import com.google.common.collect.Lists;
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = {"/component/imagestore/sync"})
|
||||
public class CpImageStoreSyncController extends AbstractCloudwalkController {
|
||||
@Resource private AggDeviceImageStoreService aggDeviceImageStoreService;
|
||||
@Resource private DevicePersonSyncService imageStoreSyncService;
|
||||
@Autowired private CpImageStorePersonSynManager cpImageStorePersonSynManager;
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/add"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<String> add(@RequestBody DeviceImageStoreSyncParam addParam) {
|
||||
try {
|
||||
this.cpImageStorePersonSynManager.addGroupPersonSynTask(
|
||||
Lists.newArrayList(addParam.getImageStoreId()), "isAll");
|
||||
return CloudwalkResult.success(addParam.getImageStoreId());
|
||||
} catch (Exception e) {
|
||||
return CloudwalkResult.fail((String) "53013529", (String) this.getMessage("53013529"));
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/log/page"})
|
||||
public CloudwalkResult<CloudwalkPageAble<DeviceImageStoreSynLogQueryResult>> logPage(
|
||||
@RequestBody DeviceImageStoreSynLogQueryParam param) {
|
||||
try {
|
||||
return this.imageStoreSyncService.page(param, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
this.logger.error("查询图库同步记录详情异常:[{}]", e);
|
||||
return CloudwalkResult.fail((String) "53013549", (String) this.getMessage("53013549"));
|
||||
}
|
||||
}
|
||||
}
|
||||
+90
@@ -0,0 +1,90 @@
|
||||
package cn.cloudwalk.web.organization.controller;
|
||||
|
||||
// Web控制器
|
||||
import cn.cloudwalk.client.aggregate.group.param.AgFeatureExtractParam;
|
||||
import cn.cloudwalk.client.aggregate.group.param.AgFeatureQueryParam;
|
||||
import cn.cloudwalk.client.aggregate.group.result.AgFeatureExtractResult;
|
||||
import cn.cloudwalk.client.organization.service.store.param.CpFeatureQueryParam;
|
||||
import cn.cloudwalk.client.organization.service.store.result.CpFeatureQueryResult;
|
||||
import cn.cloudwalk.client.organization.service.store.service.CpImageStoreToolService;
|
||||
import cn.cloudwalk.cloud.exception.ServiceException;
|
||||
import cn.cloudwalk.cloud.result.CloudwalkResult;
|
||||
import cn.cloudwalk.cloud.utils.BeanCopyUtils;
|
||||
import cn.cloudwalk.web.organization.controller.common.AbstractCloudwalkController;
|
||||
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = {"/component/biology/tool/feature"})
|
||||
public class CpImageStoreToolController extends AbstractCloudwalkController {
|
||||
@Autowired private CpImageStoreToolService cpImageStoreToolService;
|
||||
|
||||
@HystrixCommand(fallbackMethod = "queryImageStoreFallback")
|
||||
@RequestMapping(
|
||||
value = {"/query"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<List<CpFeatureQueryResult>> query(
|
||||
@RequestBody AgFeatureQueryParam queryParam) {
|
||||
try {
|
||||
return this.cpImageStoreToolService.searchMultiple(
|
||||
(CpFeatureQueryParam)
|
||||
BeanCopyUtils.copyProperties((Object) queryParam, CpFeatureQueryParam.class));
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("查询所有图库topN异常:{}", (Object) e.getMessage());
|
||||
return CloudwalkResult.fail((String) "53060441", (String) this.getMessage("53060441"));
|
||||
}
|
||||
}
|
||||
|
||||
@HystrixCommand(fallbackMethod = "queryEveryGroupFallback")
|
||||
@RequestMapping(
|
||||
value = {"/querygroups"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<Map<String, List<CpFeatureQueryResult>>> queryEveryGroup(
|
||||
@RequestBody AgFeatureQueryParam queryParam) {
|
||||
try {
|
||||
return this.cpImageStoreToolService.searchMultipleEveryGroup(
|
||||
(CpFeatureQueryParam)
|
||||
BeanCopyUtils.copyProperties((Object) queryParam, CpFeatureQueryParam.class));
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("图库识别,返回每个图库topN,查询异常:{}", (Object) e.getMessage());
|
||||
return CloudwalkResult.fail((String) "53060442", (String) this.getMessage("53060442"));
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/extract"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<AgFeatureExtractResult> extract(
|
||||
@RequestBody AgFeatureExtractParam extractParam) {
|
||||
try {
|
||||
return this.cpImageStoreToolService.extractFeature(extractParam);
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("特征提取,异常:{}", (Object) e.getMessage());
|
||||
return CloudwalkResult.fail((String) "53060431", (String) this.getMessage("53060431"));
|
||||
}
|
||||
}
|
||||
|
||||
public CloudwalkResult<List<CpFeatureQueryResult>> queryImageStoreFallback(
|
||||
AgFeatureQueryParam queryParam) {
|
||||
this.logger.error("查询所有图库topN异常.....");
|
||||
return CloudwalkResult.fail((String) "53060441", (String) this.getMessage("53060441"));
|
||||
}
|
||||
|
||||
public CloudwalkResult<Map<String, List<CpFeatureQueryResult>>> queryEveryGroupFallback(
|
||||
AgFeatureQueryParam queryParam) {
|
||||
this.logger.error("图库识别,返回每个图库topN,查询异常.....");
|
||||
return CloudwalkResult.fail((String) "53060442", (String) this.getMessage("53060442"));
|
||||
}
|
||||
}
|
||||
+101
@@ -0,0 +1,101 @@
|
||||
package cn.cloudwalk.web.organization.controller;
|
||||
|
||||
// Web控制器
|
||||
import cn.cloudwalk.client.organization.service.CpOrgDevieKitService;
|
||||
import cn.cloudwalk.cloud.annotation.CloudwalkParamsValidate;
|
||||
import cn.cloudwalk.cloud.exception.ServiceException;
|
||||
import cn.cloudwalk.cloud.result.CloudwalkResult;
|
||||
import cn.cloudwalk.device.sdk.protocol.entity.v2proto.http.param.UpdateFeatureParam;
|
||||
import cn.cloudwalk.device.sdk.protocol.entity.v2proto.http.param.UpdateGroupParam;
|
||||
import cn.cloudwalk.device.sdk.protocol.entity.v2proto.http.param.UpdatePersonParam;
|
||||
import cn.cloudwalk.device.sdk.protocol.entity.v2proto.http.param.UpdatePictureParam;
|
||||
import cn.cloudwalk.device.sdk.protocol.entity.v2proto.http.result.UpdateFeatureResult;
|
||||
import cn.cloudwalk.device.sdk.protocol.entity.v2proto.http.result.UpdateGroupResult;
|
||||
import cn.cloudwalk.device.sdk.protocol.entity.v2proto.http.result.UpdatePersonResult;
|
||||
import cn.cloudwalk.device.sdk.protocol.entity.v2proto.http.result.UpdatePictureResult;
|
||||
import cn.cloudwalk.web.organization.controller.common.AbstractCloudwalkController;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = {"/device/V2"})
|
||||
public class CpOrgDeviceKitController extends AbstractCloudwalkController {
|
||||
@Resource private CpOrgDevieKitService linkKit;
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/20110"},
|
||||
method = {RequestMethod.POST})
|
||||
@CloudwalkParamsValidate
|
||||
public CloudwalkResult<UpdateGroupResult> updateGroup(@RequestBody UpdateGroupParam param) {
|
||||
try {
|
||||
return this.linkKit.onUpdateGroupRequest(param, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
this.logger.warn("device updateGroup error,cause:{}", (Object) e.getMessage());
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) this.getMessage(e.getCode()));
|
||||
} catch (Exception e) {
|
||||
this.logger.error("device updateGroup error,cause:", e);
|
||||
return CloudwalkResult.fail((String) "52003005", (String) this.getMessage("52003005"));
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/20111"},
|
||||
method = {RequestMethod.POST})
|
||||
@CloudwalkParamsValidate
|
||||
public CloudwalkResult<UpdateFeatureResult> updateFeature(@RequestBody UpdateFeatureParam param) {
|
||||
try {
|
||||
return this.linkKit.onUpdateFeatureRequest(param, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
this.logger.warn("device updateFeature error,cause:{}", (Object) e.getMessage());
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) this.getMessage(e.getCode()));
|
||||
} catch (Exception e) {
|
||||
this.logger.error("device updateFeature error,cause:", e);
|
||||
return CloudwalkResult.fail((String) "52003006", (String) this.getMessage("52003006"));
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/20112"},
|
||||
method = {RequestMethod.POST})
|
||||
@CloudwalkParamsValidate
|
||||
public CloudwalkResult<UpdatePictureResult> updatePicture(@RequestBody UpdatePictureParam param) {
|
||||
try {
|
||||
return this.linkKit.onUpdatePictureRequest(param, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
this.logger.warn("device updatePicture error,cause:", e);
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("device updatePicture error,cause:", e);
|
||||
return CloudwalkResult.fail((String) "52003007", (String) this.getMessage("52003007"));
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/20113"},
|
||||
method = {RequestMethod.POST})
|
||||
@CloudwalkParamsValidate
|
||||
public CloudwalkResult<UpdatePersonResult> updatePerson(@RequestBody UpdatePersonParam param) {
|
||||
try {
|
||||
this.logger.info("20113 device request param:{}", (Object) JSON.toJSONString((Object) param));
|
||||
long start = System.currentTimeMillis();
|
||||
this.logger.info(
|
||||
"CloudwalkContext param:{}",
|
||||
(Object) JSON.toJSONString((Object) this.getCloudwalkContext()));
|
||||
CloudwalkResult result =
|
||||
this.linkKit.onUpdatePersonRequest(param, this.getCloudwalkContext());
|
||||
long end = System.currentTimeMillis();
|
||||
this.logger.info("20113 device updatePerson,spend time {} millis", (Object) (end - start));
|
||||
return result;
|
||||
} catch (ServiceException e) {
|
||||
this.logger.warn("device updatePerson error,cause:{}", (Object) e.getMessage());
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) this.getMessage(e.getCode()));
|
||||
} catch (Exception e) {
|
||||
this.logger.error("device updatePerson error,cause:{}", (Object) e.getMessage());
|
||||
return CloudwalkResult.fail((String) "52003008", (String) this.getMessage("52003008"));
|
||||
}
|
||||
}
|
||||
}
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
package cn.cloudwalk.web.organization.controller;
|
||||
|
||||
// Web控制器
|
||||
import cn.cloudwalk.client.organization.service.store.param.BaseOrgImageStoreParam;
|
||||
import cn.cloudwalk.client.organization.service.store.param.QueryOrgImageStoreParam;
|
||||
import cn.cloudwalk.client.organization.service.store.result.OrgImageStoreResult;
|
||||
import cn.cloudwalk.client.organization.service.store.service.CpOrgImageStoreService;
|
||||
import cn.cloudwalk.cloud.page.CloudwalkPageAble;
|
||||
import cn.cloudwalk.cloud.result.CloudwalkResult;
|
||||
import cn.cloudwalk.web.organization.controller.common.AbstractCloudwalkController;
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = {"/component/org/imagestore"})
|
||||
public class CpOrgImageStoreController extends AbstractCloudwalkController {
|
||||
@Autowired private CpOrgImageStoreService cpOrgImageStoreService;
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/add"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<Boolean> add(@RequestBody BaseOrgImageStoreParam addParam) {
|
||||
try {
|
||||
return this.cpOrgImageStoreService.add(addParam, this.getCloudwalkContext());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("机构图库关联添加异常,", e);
|
||||
return CloudwalkResult.fail((String) "53013522", (String) this.getMessage("53013522"));
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/delete"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<Boolean> delete(@RequestBody BaseOrgImageStoreParam addParam) {
|
||||
try {
|
||||
return this.cpOrgImageStoreService.delete(addParam, this.getCloudwalkContext());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("机构图库关联删除异常,", e);
|
||||
return CloudwalkResult.fail((String) "53013523", (String) this.getMessage("53013523"));
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/list"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<List<OrgImageStoreResult>> list(
|
||||
@RequestBody QueryOrgImageStoreParam queryParam) {
|
||||
try {
|
||||
return this.cpOrgImageStoreService.query(queryParam, this.getCloudwalkContext());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("机构图库关联查询异常,", e);
|
||||
return CloudwalkResult.fail((String) "53013524", (String) this.getMessage("53013524"));
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/page"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<CloudwalkPageAble<OrgImageStoreResult>> page(
|
||||
@RequestBody QueryOrgImageStoreParam queryParam) {
|
||||
try {
|
||||
return this.cpOrgImageStoreService.page(queryParam, this.getCloudwalkContext());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("机构图库关联查询异常,", e);
|
||||
return CloudwalkResult.fail((String) "53013524", (String) this.getMessage("53013524"));
|
||||
}
|
||||
}
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
package cn.cloudwalk.web.organization.controller;
|
||||
|
||||
// Web控制器
|
||||
import cn.cloudwalk.client.device.mgn.atomic.param.CoreDeviceQueryParam;
|
||||
import cn.cloudwalk.client.device.mgn.atomic.result.AtomicDeviceGetResult;
|
||||
import cn.cloudwalk.client.device.mgn.atomic.service.AtomicDeviceService;
|
||||
import cn.cloudwalk.cloud.result.CloudwalkResult;
|
||||
import cn.cloudwalk.web.organization.controller.common.AbstractCloudwalkController;
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = {"/component/device"})
|
||||
public class DeviceController extends AbstractCloudwalkController {
|
||||
@Resource private AtomicDeviceService atomicDeviceService;
|
||||
|
||||
@PostMapping(value = {"/list"})
|
||||
public CloudwalkResult<List<AtomicDeviceGetResult>> list(
|
||||
@RequestBody CoreDeviceQueryParam param) {
|
||||
try {
|
||||
if (StringUtils.isBlank((CharSequence) param.getBusinessId())) {
|
||||
param.setBusinessId(this.getCloudwalkContext().getCompany().getCompanyId());
|
||||
}
|
||||
return this.atomicDeviceService.list(param, this.getCloudwalkContext());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("查询设备信息列表异常:[{}]", e);
|
||||
return CloudwalkResult.fail((String) "53014700", (String) this.getMessage("53014700"));
|
||||
}
|
||||
}
|
||||
}
|
||||
+205
@@ -0,0 +1,205 @@
|
||||
package cn.cloudwalk.web.organization.controller;
|
||||
|
||||
// Web控制器
|
||||
import cn.cloudwalk.client.aggregate.device.param.DeviceImageStoreReSyncParam;
|
||||
import cn.cloudwalk.client.aggregate.device.result.DeviceImageStoreQueryResult;
|
||||
import cn.cloudwalk.client.aggregate.device.result.DeviceImageStoreReSyncResult;
|
||||
import cn.cloudwalk.client.aggregate.device.service.AggDeviceImageStoreService;
|
||||
import cn.cloudwalk.client.device.mgn.atomic.result.AtomicDeviceGetResult;
|
||||
import cn.cloudwalk.client.organization.param.DevicePersonResyncParam;
|
||||
import cn.cloudwalk.client.organization.param.DevicePersonResyncRequestParam;
|
||||
import cn.cloudwalk.client.organization.param.PersonGroupRelationsRequestParam;
|
||||
import cn.cloudwalk.client.organization.param.QueryDevicePersonSyncLogParam;
|
||||
import cn.cloudwalk.client.organization.param.QueryDevicePersonSyncParam;
|
||||
import cn.cloudwalk.client.organization.personimg.service.DevicePersonSyncService;
|
||||
import cn.cloudwalk.client.organization.result.DeviceImageStoreRefResult;
|
||||
import cn.cloudwalk.client.organization.result.DevicePersonResyncResult;
|
||||
import cn.cloudwalk.client.organization.result.DevicePersonSyncDetailResult;
|
||||
import cn.cloudwalk.client.organization.result.DevicePersonSyncLogResult;
|
||||
import cn.cloudwalk.client.organization.result.DevicePersonSyncResult;
|
||||
import cn.cloudwalk.client.organization.result.PersonGroupRelationsResult;
|
||||
import cn.cloudwalk.cloud.annotation.CloudwalkParamsValidate;
|
||||
import cn.cloudwalk.cloud.exception.ServiceException;
|
||||
import cn.cloudwalk.cloud.page.CloudwalkPageAble;
|
||||
import cn.cloudwalk.cloud.page.CloudwalkPageInfo;
|
||||
import cn.cloudwalk.cloud.result.CloudwalkResult;
|
||||
import cn.cloudwalk.cloud.utils.BeanCopyUtils;
|
||||
import cn.cloudwalk.service.organization.service.CpImageStoreSyncManager;
|
||||
import cn.cloudwalk.web.organization.controller.common.AbstractCloudwalkController;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Sets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = {"/component/device"})
|
||||
public class DevicePersonSyncController extends AbstractCloudwalkController {
|
||||
@Resource private DevicePersonSyncService devicePersonSyncService;
|
||||
@Resource private AggDeviceImageStoreService aggDeviceImageStoreService;
|
||||
@Resource private CpImageStoreSyncManager cpImageStoreSyncManager;
|
||||
|
||||
@PostMapping(value = {"/imagestore/sync/page"})
|
||||
public CloudwalkResult<CloudwalkPageAble<DevicePersonSyncResult>> page(
|
||||
@RequestBody QueryDevicePersonSyncParam param) {
|
||||
try {
|
||||
CloudwalkResult<CloudwalkPageAble<AtomicDeviceGetResult>> devicePageResult =
|
||||
this.devicePersonSyncService.devicePage(param, this.getCloudwalkContext());
|
||||
if (devicePageResult.isSuccess()) {
|
||||
List<DevicePersonSyncResult> syncList = null;
|
||||
CloudwalkPageAble<AtomicDeviceGetResult> pageAble = devicePageResult.getData();
|
||||
if (null != pageAble && !CollectionUtils.isEmpty(pageAble.getDatas())) {
|
||||
List<String> deviceIds =
|
||||
pageAble.getDatas().stream()
|
||||
.map(AtomicDeviceGetResult::getId)
|
||||
.collect(Collectors.toList());
|
||||
Map<String, DeviceImageStoreRefResult> deviceStoreMap =
|
||||
this.devicePersonSyncService.deviceImageStoreMap(
|
||||
new ArrayList<>(pageAble.getDatas()));
|
||||
syncList = this.devicePersonSyncService.deviceSyncList(deviceIds, deviceStoreMap);
|
||||
return CloudwalkResult.success(
|
||||
new CloudwalkPageAble<>(
|
||||
syncList,
|
||||
new CloudwalkPageInfo(param.getCurrentPage(), param.getRowsOfPage()),
|
||||
pageAble.getTotalRows()));
|
||||
}
|
||||
}
|
||||
this.logger.warn(
|
||||
"获取租户[{}]设备分页查询失败", (Object) this.getCloudwalkContext().getCompany().getCompanyId());
|
||||
return CloudwalkResult.success(null);
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("设备-人员同步管理,同步列表分页查询异常:{}", e);
|
||||
return CloudwalkResult.fail((String) "53013550", (String) this.getMessage("53013550"));
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/imagestore/sync/detail"})
|
||||
public CloudwalkResult<List<DevicePersonSyncDetailResult>> detail(
|
||||
@RequestBody QueryDevicePersonSyncLogParam param) {
|
||||
List<DevicePersonSyncDetailResult> list = null;
|
||||
try {
|
||||
CloudwalkResult<List<DeviceImageStoreQueryResult>> imageStoreResult =
|
||||
this.devicePersonSyncService.deviceImageStoreList(
|
||||
param.getDeviceId(), this.getCloudwalkContext());
|
||||
if (null != imageStoreResult && !CollectionUtils.isEmpty(imageStoreResult.getData())) {
|
||||
List<String> imageStoreIds =
|
||||
imageStoreResult.getData().stream()
|
||||
.map(r -> r.getImageStoreId())
|
||||
.collect(Collectors.toList());
|
||||
Map<String, DeviceImageStoreQueryResult> imageStoreMap =
|
||||
imageStoreResult.getData().stream()
|
||||
.collect(
|
||||
Collectors.toMap(
|
||||
DeviceImageStoreQueryResult::getImageStoreId, r -> r));
|
||||
list =
|
||||
this.devicePersonSyncService.imageStoreSyncList(
|
||||
param.getDeviceId(), imageStoreIds, imageStoreMap);
|
||||
}
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("设备-人员同步管理,同步列表详情查询异常:{}", (Object) e.getMessage());
|
||||
}
|
||||
return CloudwalkResult.success(list);
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/imagestore/sync/log/page"})
|
||||
@CloudwalkParamsValidate
|
||||
public CloudwalkResult<CloudwalkPageAble<DevicePersonSyncLogResult>> logPage(
|
||||
@RequestBody QueryDevicePersonSyncLogParam param) {
|
||||
try {
|
||||
return this.devicePersonSyncService.logPage(param, this.getCloudwalkContext());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("设备-人员同步管理,分页查询同步记录异常:{}", (Object) e.getMessage());
|
||||
return CloudwalkResult.fail((String) "53013549", (String) this.getMessage("53013549"));
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/imagestore/resync"})
|
||||
@CloudwalkParamsValidate
|
||||
public CloudwalkResult<List<DeviceImageStoreReSyncResult>> deviceResync(
|
||||
@RequestBody DevicePersonResyncParam param) {
|
||||
try {
|
||||
DeviceImageStoreReSyncParam deviceImageStoreReSyncParam = new DeviceImageStoreReSyncParam();
|
||||
deviceImageStoreReSyncParam.setDeviceId(param.getDeviceId());
|
||||
CloudwalkResult result =
|
||||
this.aggDeviceImageStoreService.reSync(
|
||||
deviceImageStoreReSyncParam, this.getCloudwalkContext());
|
||||
this.logger.info("设备-人员同步管理,重置设备重新同步返回结果:{}", (Object) JSON.toJSONString((Object) result));
|
||||
if (!result.isSuccess()) {
|
||||
return CloudwalkResult.fail((String) result.getCode(), (String) result.getMessage());
|
||||
}
|
||||
this.devicePersonSyncService.deviceResync(param, this.getCloudwalkContext());
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
this.logger.error("设备-人员同步管理,重置设备重新同步异常:{}", (Object) e.getMessage());
|
||||
return CloudwalkResult.fail((String) "53013553", (String) this.getMessage("53013553"));
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/imagestore/person/resync"})
|
||||
public CloudwalkResult<List<DevicePersonResyncResult>> devicePersonResync(
|
||||
@RequestBody DevicePersonResyncRequestParam requestParam) {
|
||||
if (null == requestParam || CollectionUtils.isEmpty((Collection) requestParam.getData())) {
|
||||
return CloudwalkResult.fail((String) "53013552", (String) this.getMessage("53013552"));
|
||||
}
|
||||
List<DevicePersonResyncResult> resultList =
|
||||
Lists.newArrayListWithCapacity(requestParam.getData().size());
|
||||
Set<String> changeGroupIdSet = Sets.newHashSet();
|
||||
requestParam
|
||||
.getData()
|
||||
.forEach(
|
||||
param -> {
|
||||
boolean res = this.devicePersonSyncService.devicePersonResync(param);
|
||||
DevicePersonResyncResult result =
|
||||
(DevicePersonResyncResult)
|
||||
BeanCopyUtils.copyProperties((Object) param, DevicePersonResyncResult.class);
|
||||
result.setCode("00000000");
|
||||
if (!res) {
|
||||
result.setCode("99999999");
|
||||
}
|
||||
resultList.add(result);
|
||||
changeGroupIdSet.add(param.getImageStoreId());
|
||||
});
|
||||
this.cpImageStoreSyncManager.sendChangeToDevice(
|
||||
requestParam.getData().get(0).getDeviceId(), changeGroupIdSet, false);
|
||||
return CloudwalkResult.success(resultList);
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/imagestore/deviceImageStoreMap"})
|
||||
@CloudwalkParamsValidate
|
||||
public CloudwalkResult<Map<String, String>> getDeviceImageStore(
|
||||
@RequestBody QueryDevicePersonSyncLogParam param) {
|
||||
return CloudwalkResult.success(
|
||||
this.devicePersonSyncService.deviceImageStoreMap(param, this.getCloudwalkContext()));
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/person/groupRelations"})
|
||||
@CloudwalkParamsValidate
|
||||
public CloudwalkResult<List<PersonGroupRelationsResult>> personGroupRelations(
|
||||
@RequestBody PersonGroupRelationsRequestParam param) {
|
||||
try {
|
||||
if (CollectionUtils.isEmpty((Collection) param.getImageIds())) {
|
||||
return CloudwalkResult.fail((String) "53014025", (String) this.getMessage("53014025"));
|
||||
}
|
||||
List<PersonGroupRelationsResult> resultList =
|
||||
this.devicePersonSyncService.personGroupRelations(param);
|
||||
return CloudwalkResult.success(resultList);
|
||||
} catch (Exception e) {
|
||||
this.logger.error("获取人员图库关联关系异常:{}", (Object) e.getMessage());
|
||||
return CloudwalkResult.fail((String) "53013554", (String) this.getMessage("53013554"));
|
||||
}
|
||||
}
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package cn.cloudwalk.web.organization.controller;
|
||||
|
||||
// Web控制器
|
||||
import cn.cloudwalk.client.device.mgn.atomic.param.CoreDistrictQueryParam;
|
||||
import cn.cloudwalk.client.device.mgn.atomic.result.CoreDistrictTreeResult;
|
||||
import cn.cloudwalk.client.organization.personimg.service.DistrictService;
|
||||
import cn.cloudwalk.cloud.exception.ServiceException;
|
||||
import cn.cloudwalk.cloud.result.CloudwalkResult;
|
||||
import cn.cloudwalk.web.organization.controller.common.AbstractCloudwalkController;
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = {"/component/district"})
|
||||
public class DistrictController extends AbstractCloudwalkController {
|
||||
@Resource private DistrictService districtService;
|
||||
|
||||
@PostMapping(value = {"/getAllTree"})
|
||||
public CloudwalkResult<List<CoreDistrictTreeResult>> getAllTree(
|
||||
@RequestBody CoreDistrictQueryParam param) {
|
||||
try {
|
||||
return this.districtService.getAllTree(param);
|
||||
} catch (ServiceException e) {
|
||||
this.logger.error("查询区域信息异常:[{}]", e);
|
||||
return CloudwalkResult.fail((String) "53014600", (String) this.getMessage("53014600"));
|
||||
}
|
||||
}
|
||||
}
|
||||
+126
@@ -0,0 +1,126 @@
|
||||
package cn.cloudwalk.web.organization.controller;
|
||||
|
||||
// Web控制器
|
||||
import cn.cloudwalk.client.organization.common.constant.ImageStoreConstants;
|
||||
import cn.cloudwalk.client.organization.service.PersonFileService;
|
||||
import cn.cloudwalk.client.organization.service.store.service.CpImageStoreToolService;
|
||||
import cn.cloudwalk.cloud.exception.ServiceException;
|
||||
import cn.cloudwalk.cloud.result.CloudwalkResult;
|
||||
import cn.cloudwalk.service.organization.common.OpenCvUtils;
|
||||
import cn.cloudwalk.service.organization.common.ToolUtil;
|
||||
import cn.cloudwalk.web.organization.controller.common.AbstractCloudwalkController;
|
||||
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
|
||||
import java.io.OutputStream;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.xml.bind.DatatypeConverter;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = {"/file"})
|
||||
public class FileController extends AbstractCloudwalkController {
|
||||
@Autowired private PersonFileService personFileService;
|
||||
@Autowired private OpenCvUtils openCvUtils;
|
||||
@Resource private CpImageStoreToolService cpImageStoreToolService;
|
||||
public static final String LOG_FILE_MANAGER_FILE_IS_MISSING = "LOG_FILE_MANAGER_FILE_IS_MISSING";
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/imgupload"},
|
||||
method = {RequestMethod.POST},
|
||||
consumes = {"multipart/form-data"})
|
||||
public CloudwalkResult<String> fileUpload(@RequestParam(value = "img") String base64) {
|
||||
if (StringUtils.isEmpty((CharSequence) base64)) {
|
||||
return CloudwalkResult.fail((String) "53060544", (String) this.getMessage("53060544"));
|
||||
}
|
||||
try {
|
||||
byte[] bytes = DatatypeConverter.parseBase64Binary((String) base64);
|
||||
if (bytes.length > ImageStoreConstants.MAX_FILE) {
|
||||
return CloudwalkResult.fail((String) "53060428", (String) this.getMessage("53060428"));
|
||||
}
|
||||
String fileName = ToolUtil.generateUUID();
|
||||
this.logger.info("上传文件:{},size={}", (Object) fileName, (Object) bytes.length);
|
||||
CloudwalkResult<String> storeResult = this.personFileService.upload(fileName, bytes);
|
||||
if (storeResult != null && StringUtils.isNotBlank(storeResult.getData())) {
|
||||
return CloudwalkResult.success(storeResult.getData());
|
||||
}
|
||||
return storeResult;
|
||||
} catch (Exception e) {
|
||||
this.logger.error("", e);
|
||||
return CloudwalkResult.fail((String) "80014013", (String) this.getMessage("80014013"));
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/fileupload"},
|
||||
method = {RequestMethod.POST},
|
||||
consumes = {"multipart/form-data"})
|
||||
public CloudwalkResult<String> fileUpload(@RequestParam(value = "file") MultipartFile file) {
|
||||
try {
|
||||
return this.personFileService.uploadImage(file);
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("人员文件上传异常:{}", (Object) e.getMessage());
|
||||
return CloudwalkResult.fail((String) "80014013", (String) this.getMessage("80014013"));
|
||||
}
|
||||
}
|
||||
|
||||
@HystrixCommand(fallbackMethod = "fileUploadCompressFallback")
|
||||
@RequestMapping(
|
||||
value = {"/fileUploadCompress"},
|
||||
method = {RequestMethod.POST},
|
||||
consumes = {"multipart/form-data"})
|
||||
public CloudwalkResult<String> fileUploadCompress(
|
||||
@RequestParam(value = "file") MultipartFile file) {
|
||||
try {
|
||||
return this.personFileService.uploadCompressImage2(file);
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("模块文件上传异常:{}", (Object) e.getMessage());
|
||||
return CloudwalkResult.fail((String) "80014013", (String) this.getMessage("80014013"));
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* WARNING - Removed try catching itself - possible behaviour change.
|
||||
*/
|
||||
@RequestMapping(
|
||||
value = {"imgByPath"},
|
||||
method = {RequestMethod.GET})
|
||||
public void imgByPath(@RequestParam(value = "path") String path, HttpServletResponse response) {
|
||||
ServletOutputStream output = null;
|
||||
try {
|
||||
if (StringUtils.isNotBlank((CharSequence) path)) {
|
||||
CloudwalkResult storeResult = this.personFileService.get(path);
|
||||
output = response.getOutputStream();
|
||||
if (storeResult != null
|
||||
&& storeResult.getData() != null
|
||||
&& ((byte[]) storeResult.getData()).length > 0) {
|
||||
response.setContentLength(((byte[]) storeResult.getData()).length);
|
||||
response.setBufferSize(0x300000);
|
||||
IOUtils.write((byte[]) ((byte[]) storeResult.getData()), (OutputStream) output);
|
||||
} else {
|
||||
this.logger.warn(String.format(this.getMessage(LOG_FILE_MANAGER_FILE_IS_MISSING), path));
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
this.logger.error("", e);
|
||||
} finally {
|
||||
IOUtils.closeQuietly(output);
|
||||
}
|
||||
}
|
||||
|
||||
public CloudwalkResult<String> fileUploadCompressFallback(MultipartFile file) {
|
||||
this.logger.error("模块文件上传异常....");
|
||||
return CloudwalkResult.fail((String) "80014013", (String) this.getMessage("80014013"));
|
||||
}
|
||||
}
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
package cn.cloudwalk.web.organization.controller;
|
||||
|
||||
// Web控制器
|
||||
import cn.cloudwalk.client.organization.param.AddLabelParam;
|
||||
import cn.cloudwalk.client.organization.param.DelLabelParam;
|
||||
import cn.cloudwalk.client.organization.param.DelPersonLabelParam;
|
||||
import cn.cloudwalk.client.organization.param.EditLabelParam;
|
||||
import cn.cloudwalk.client.organization.param.LabelAddPersonParam;
|
||||
import cn.cloudwalk.client.organization.param.LabelResult;
|
||||
import cn.cloudwalk.client.organization.param.PageLabelParam;
|
||||
import cn.cloudwalk.client.organization.result.PageLabelResult;
|
||||
import cn.cloudwalk.client.organization.service.LabelService;
|
||||
import cn.cloudwalk.cloud.page.CloudwalkPageAble;
|
||||
import cn.cloudwalk.cloud.result.CloudwalkResult;
|
||||
import cn.cloudwalk.web.organization.controller.common.AbstractCloudwalkController;
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = {"/biology/label"})
|
||||
public class LabelController extends AbstractCloudwalkController {
|
||||
@Autowired private LabelService labelService;
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/add"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<String> add(@RequestBody AddLabelParam addLabelParam) {
|
||||
return this.labelService.add(addLabelParam, this.getCloudwalkContext());
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/edit"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<Boolean> edit(@RequestBody EditLabelParam param) {
|
||||
return this.labelService.edit(param, this.getCloudwalkContext());
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/delete"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<Boolean> delete(@RequestBody DelLabelParam delLabelParam) {
|
||||
return this.labelService.delete(delLabelParam, this.getCloudwalkContext());
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/page"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<CloudwalkPageAble<PageLabelResult>> page(
|
||||
@RequestBody PageLabelParam pageLabelParam) {
|
||||
return this.labelService.page(pageLabelParam, this.getCloudwalkContext());
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/getAllLabels"})
|
||||
public CloudwalkResult<List<LabelResult>> getAllLabels(@RequestBody PageLabelParam param) {
|
||||
return this.labelService.getAllLabels(param, this.getCloudwalkContext());
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/personsAdd"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<Boolean> addPerson(@RequestBody LabelAddPersonParam personParam) {
|
||||
return this.labelService.addPerson(personParam, this.getCloudwalkContext());
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/personsDel"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<Boolean> delPerson(@RequestBody DelPersonLabelParam param) {
|
||||
return this.labelService.delPerson(param, this.getCloudwalkContext());
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/detail"})
|
||||
public CloudwalkResult<LabelResult> detail(@RequestBody PageLabelParam param) {
|
||||
return this.labelService.detail(param, this.getCloudwalkContext());
|
||||
}
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package cn.cloudwalk.web.organization.controller;
|
||||
|
||||
// Web控制器
|
||||
import cn.cloudwalk.client.organization.param.LabelResult;
|
||||
import cn.cloudwalk.client.organization.param.PageLabelParam;
|
||||
import cn.cloudwalk.client.organization.service.LabelService;
|
||||
import cn.cloudwalk.cloud.result.CloudwalkResult;
|
||||
import cn.cloudwalk.web.organization.controller.common.AbstractCloudwalkController;
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = {"/h5/label"})
|
||||
public class LabelH5Controller extends AbstractCloudwalkController {
|
||||
@Resource private LabelService labelService;
|
||||
|
||||
@RequestMapping(value = {"/getAllLabels"})
|
||||
public CloudwalkResult<List<LabelResult>> getAllLabels(@RequestBody PageLabelParam param) {
|
||||
return this.labelService.getAllLabels(param, this.getCloudwalkContext());
|
||||
}
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package cn.cloudwalk.web.organization.controller;
|
||||
|
||||
// Web控制器
|
||||
import cn.cloudwalk.client.organization.param.OperationLogDelParam;
|
||||
import cn.cloudwalk.client.organization.service.IOperationLogService;
|
||||
import cn.cloudwalk.cloud.exception.ServiceException;
|
||||
import cn.cloudwalk.cloud.result.CloudwalkResult;
|
||||
import cn.cloudwalk.web.organization.controller.common.AbstractCloudwalkController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController(value = "operationLogController")
|
||||
@RequestMapping(value = {"/operation/log"})
|
||||
public class OperationLogController extends AbstractCloudwalkController {
|
||||
@Autowired private IOperationLogService operationLogService;
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/delete"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<Boolean> delete(@RequestBody OperationLogDelParam param) {
|
||||
try {
|
||||
return this.operationLogService.delete(param, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("操作日志删除失败,原因:", e);
|
||||
return CloudwalkResult.fail((String) "53015201", (String) this.getMessage("53015201"));
|
||||
}
|
||||
}
|
||||
}
|
||||
+134
@@ -0,0 +1,134 @@
|
||||
package cn.cloudwalk.web.organization.controller;
|
||||
|
||||
// Web控制器
|
||||
import cn.cloudwalk.client.organization.personaudit.param.AddPersonAuditBatchParam;
|
||||
import cn.cloudwalk.client.organization.personaudit.param.AddPersonAuditParam;
|
||||
import cn.cloudwalk.client.organization.personaudit.param.PersonAuditCheckParam;
|
||||
import cn.cloudwalk.client.organization.personaudit.param.PersonAuditParam;
|
||||
import cn.cloudwalk.client.organization.personaudit.param.PersonAuditQueryParam;
|
||||
import cn.cloudwalk.client.organization.personaudit.result.PersonAuditGetResult;
|
||||
import cn.cloudwalk.client.organization.personaudit.result.PersonAuditResult;
|
||||
import cn.cloudwalk.client.organization.personaudit.service.IPersonAuditServcie;
|
||||
import cn.cloudwalk.cloud.annotation.CloudwalkParamsValidate;
|
||||
import cn.cloudwalk.cloud.exception.ServiceException;
|
||||
import cn.cloudwalk.cloud.page.CloudwalkPageAble;
|
||||
import cn.cloudwalk.cloud.page.CloudwalkPageInfo;
|
||||
import cn.cloudwalk.cloud.result.CloudwalkResult;
|
||||
import cn.cloudwalk.web.organization.controller.common.AbstractCloudwalkController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = {"/component/person/register"})
|
||||
public class PersonAuditController extends AbstractCloudwalkController {
|
||||
@Autowired private IPersonAuditServcie personAuditServcie;
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/add"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<String> add(@RequestBody AddPersonAuditParam param) {
|
||||
try {
|
||||
return this.personAuditServcie.add(param, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/edit"},
|
||||
method = {RequestMethod.POST})
|
||||
@CloudwalkParamsValidate
|
||||
public CloudwalkResult<String> edit(@RequestBody AddPersonAuditParam param) {
|
||||
try {
|
||||
return this.personAuditServcie.edit(param, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/agree"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<String> auditAgree(@RequestBody AddPersonAuditParam param) {
|
||||
try {
|
||||
return this.personAuditServcie.auditAgree(param, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/refuse"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<Boolean> auditRefuse(@RequestParam(value = "id") String id) {
|
||||
try {
|
||||
return this.personAuditServcie.auditRefuse(id, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/batchAgree"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<Boolean> batchAgree(@RequestBody AddPersonAuditBatchParam param) {
|
||||
try {
|
||||
return this.personAuditServcie.batchAgree(param.getIds(), this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/batchRefuse"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<Boolean> batchRefuse(@RequestBody AddPersonAuditBatchParam param) {
|
||||
try {
|
||||
return this.personAuditServcie.batchRefuse(param.getIds(), this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/page"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<CloudwalkPageAble<PersonAuditGetResult>> page(
|
||||
@RequestBody PersonAuditQueryParam param) {
|
||||
CloudwalkPageInfo page = new CloudwalkPageInfo(param.getCurrentPage(), param.getRowsOfPage());
|
||||
try {
|
||||
return this.personAuditServcie.page(param, page, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/userCheck"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<PersonAuditResult> userCheck(@RequestBody PersonAuditCheckParam param) {
|
||||
try {
|
||||
return this.personAuditServcie.userCheck(param, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/checkById"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<PersonAuditGetResult> checkById(@RequestBody PersonAuditParam param) {
|
||||
try {
|
||||
return this.personAuditServcie.checkById(param, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("根据Id查询注册结果异常:{}", (Object) e.getMessage());
|
||||
return CloudwalkResult.fail((String) "53060548", (String) this.getMessage("53060548"));
|
||||
}
|
||||
}
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
package cn.cloudwalk.web.organization.controller;
|
||||
|
||||
// Web控制器
|
||||
import cn.cloudwalk.client.organization.personaudit.param.AddPersonAuditParam;
|
||||
import cn.cloudwalk.client.organization.personaudit.param.PersonAuditCheckParam;
|
||||
import cn.cloudwalk.client.organization.personaudit.result.PersonAuditResult;
|
||||
import cn.cloudwalk.client.organization.personaudit.service.IPersonAuditServcie;
|
||||
import cn.cloudwalk.cloud.exception.ServiceException;
|
||||
import cn.cloudwalk.cloud.result.CloudwalkResult;
|
||||
import cn.cloudwalk.web.organization.controller.common.AbstractCloudwalkController;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = {"/h5/person/register"})
|
||||
public class PersonAuditH5Controller extends AbstractCloudwalkController {
|
||||
@Resource private IPersonAuditServcie personAuditServcie;
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/add"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<String> add(@RequestBody AddPersonAuditParam param) {
|
||||
try {
|
||||
return this.personAuditServcie.add(param, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/userCheck"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<PersonAuditResult> userCheck(@RequestBody PersonAuditCheckParam param) {
|
||||
try {
|
||||
return this.personAuditServcie.userCheck(param, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
package cn.cloudwalk.web.organization.controller;
|
||||
|
||||
// Web控制器
|
||||
import cn.cloudwalk.client.organization.batch.param.BatchDetailQueryParam;
|
||||
import cn.cloudwalk.client.organization.batch.param.BatchImportQueryParam;
|
||||
import cn.cloudwalk.client.organization.batch.result.BatchDetailResult;
|
||||
import cn.cloudwalk.client.organization.batch.result.BatchImportQueryResult;
|
||||
import cn.cloudwalk.client.organization.batch.service.ImgPersonBatchDetailService;
|
||||
import cn.cloudwalk.client.organization.batch.service.ImgPersonBatchService;
|
||||
import cn.cloudwalk.client.organization.personimg.param.BatchImportParam;
|
||||
import cn.cloudwalk.cloud.page.CloudwalkPageAble;
|
||||
import cn.cloudwalk.cloud.page.CloudwalkPageInfo;
|
||||
import cn.cloudwalk.cloud.result.CloudwalkResult;
|
||||
import cn.cloudwalk.web.organization.controller.common.AbstractCloudwalkController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = {"/component/batch/person"})
|
||||
public class PersonBatchImportController extends AbstractCloudwalkController {
|
||||
@Autowired private ImgPersonBatchDetailService imgPersonBatchDetailService;
|
||||
@Autowired private ImgPersonBatchService imgPersonBatchService;
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/page"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<CloudwalkPageAble<BatchImportQueryResult>> page(
|
||||
@RequestBody BatchImportQueryParam param) {
|
||||
CloudwalkPageInfo page = new CloudwalkPageInfo(param.getCurrentPage(), param.getRowsOfPage());
|
||||
try {
|
||||
return this.imgPersonBatchService.page(param, page, this.getCloudwalkContext());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("导入记录查询失败:", e);
|
||||
return CloudwalkResult.fail((String) "53014033", (String) this.getMessage("53014032"));
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/add"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<Boolean> add(@RequestBody BatchImportParam param) {
|
||||
try {
|
||||
return this.imgPersonBatchService.insert(param, this.getCloudwalkContext());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("导入记录新增失败,原因:", e);
|
||||
return CloudwalkResult.fail((String) "53014032", (String) this.getMessage("53014032"));
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/detail"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<CloudwalkPageAble<BatchDetailResult>> detail(
|
||||
@RequestBody BatchDetailQueryParam param) {
|
||||
CloudwalkPageInfo page = new CloudwalkPageInfo(param.getCurrentPage(), param.getRowsOfPage());
|
||||
try {
|
||||
return this.imgPersonBatchDetailService.page(param, page, this.getCloudwalkContext());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("批量导入明细查询失败:", e);
|
||||
return CloudwalkResult.fail((String) "53014034", (String) this.getMessage("53014034"));
|
||||
}
|
||||
}
|
||||
}
|
||||
+225
@@ -0,0 +1,225 @@
|
||||
package cn.cloudwalk.web.organization.controller;
|
||||
|
||||
/**
|
||||
* 人员管理控制器(组织组件)
|
||||
*
|
||||
* <p>核心接口: - POST /component/person/detail — 人员详情查询,返回 floorList 授权楼层 - POST /component/person/page
|
||||
* — 人员分页查询 - POST /component/person/add/edit/delete — 人员增删改
|
||||
*
|
||||
* <p>floorList 数据来源:通过 ImgPersonServiceImpl 调用 elevatorFeignClient.listByImageId() 从电梯
|
||||
* image_rule_ref 表获取被访人已授权的区域 ID 列表。
|
||||
*
|
||||
* <p>来源:cwos-component-organization-web-v2.9.2_xinghewan(反编译整理)
|
||||
*/
|
||||
import cn.cloudwalk.client.organization.personimg.param.AddImgPersonParam;
|
||||
import cn.cloudwalk.client.organization.personimg.param.BatchImportParam;
|
||||
import cn.cloudwalk.client.organization.personimg.param.DetailImgPersonParam;
|
||||
import cn.cloudwalk.client.organization.personimg.param.EditImgPersonParam;
|
||||
import cn.cloudwalk.client.organization.personimg.param.QueryImgPersonParam;
|
||||
import cn.cloudwalk.client.organization.personimg.param.SyncAccountParam;
|
||||
import cn.cloudwalk.client.organization.personimg.result.ImgStorePersonGetResult;
|
||||
import cn.cloudwalk.client.organization.personimg.result.ImgStorePersonResult;
|
||||
import cn.cloudwalk.client.organization.personimg.result.UserAccountCheckResult;
|
||||
import cn.cloudwalk.client.organization.personimg.service.ImgStorePersonService;
|
||||
import cn.cloudwalk.cloud.exception.ServiceException;
|
||||
import cn.cloudwalk.cloud.page.CloudwalkPageAble;
|
||||
import cn.cloudwalk.cloud.page.CloudwalkPageInfo;
|
||||
import cn.cloudwalk.cloud.result.CloudwalkResult;
|
||||
import cn.cloudwalk.web.organization.controller.common.AbstractCloudwalkController;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.List;
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController(value = "imageStorePersonController")
|
||||
@RequestMapping(value = {"/component/person"})
|
||||
public class PersonController extends AbstractCloudwalkController {
|
||||
@Autowired private ImgStorePersonService imgStorePersonService;
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/add"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<String> add(@RequestBody AddImgPersonParam param) {
|
||||
try {
|
||||
return this.imgStorePersonService.add(param, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("人员信息新增失败,原因:{}", e);
|
||||
return CloudwalkResult.fail((String) "53014008", (String) this.getMessage("53014008"));
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/page"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<CloudwalkPageAble<ImgStorePersonGetResult>> page(
|
||||
@RequestBody QueryImgPersonParam param) {
|
||||
CloudwalkPageInfo page = new CloudwalkPageInfo(param.getCurrentPage(), param.getRowsOfPage());
|
||||
try {
|
||||
return this.imgStorePersonService.page(param, page, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("人员信息分页查询失败,原因:", e);
|
||||
return CloudwalkResult.fail((String) "53014011", (String) this.getMessage("53014011"));
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/edit"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<Boolean> edit(@RequestBody EditImgPersonParam param) {
|
||||
if (this.logger.isDebugEnabled()) {
|
||||
this.logger.debug("person-edit-param {}", (Object) JSONObject.toJSONString((Object) param));
|
||||
}
|
||||
try {
|
||||
return this.imgStorePersonService.edit(param, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("人员信息编辑失败,原因:", e);
|
||||
return CloudwalkResult.fail((String) "53014009", (String) this.getMessage("53014009"));
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/editsync"})
|
||||
public CloudwalkResult<Boolean> editSync(@RequestBody EditImgPersonParam param) {
|
||||
try {
|
||||
return this.imgStorePersonService.editSync(param, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("人员信息编辑失败,原因:", e);
|
||||
return CloudwalkResult.fail((String) "53014009", (String) this.getMessage("53014009"));
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/detail"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<ImgStorePersonGetResult> detail(@RequestBody DetailImgPersonParam param) {
|
||||
try {
|
||||
return this.imgStorePersonService.detail(param, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("人员信息详情查询失败,原因:{}", e);
|
||||
return CloudwalkResult.fail((String) "53014011", (String) this.getMessage("53014011"));
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/listPerson"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<List<ImgStorePersonGetResult>> listPerson(
|
||||
@RequestBody QueryImgPersonParam param) {
|
||||
try {
|
||||
return this.imgStorePersonService.listPerson(param, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("人员信息详情查询失败,原因:{}", e);
|
||||
return CloudwalkResult.fail((String) "53014011", (String) this.getMessage("53014011"));
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/list"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<List<ImgStorePersonGetResult>> gets(
|
||||
@RequestBody QueryImgPersonParam param) {
|
||||
try {
|
||||
return this.imgStorePersonService.gets(param, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("人员信息详情查询失败,原因:{}", e);
|
||||
return CloudwalkResult.fail((String) "53014011", (String) this.getMessage("53014011"));
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/delete"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<Boolean> delete(@RequestBody QueryImgPersonParam param) {
|
||||
try {
|
||||
return this.imgStorePersonService.delete(param, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("人员信息删除失败,原因:", e);
|
||||
return CloudwalkResult.fail((String) "53014010", (String) this.getMessage("53014010"));
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/upload/template"})
|
||||
public void downloadPersonTemplate(HttpServletRequest request, HttpServletResponse response) {
|
||||
try {
|
||||
ServletOutputStream outputStream = response.getOutputStream();
|
||||
String fileName =
|
||||
this.imgStorePersonService.downloadPersonTemplate(
|
||||
(OutputStream) outputStream, this.getCloudwalkContext());
|
||||
String userAgent = request.getHeader("user-agent").toLowerCase();
|
||||
fileName =
|
||||
userAgent.indexOf("msie") >= 0 || userAgent.indexOf("like gecko") >= 0
|
||||
? URLEncoder.encode(fileName, "UTF-8")
|
||||
: fileName;
|
||||
response.setContentType("application/octet-stream");
|
||||
response.setHeader("Content-disposition", "attachment; filename=" + fileName);
|
||||
outputStream.flush();
|
||||
outputStream.close();
|
||||
} catch (IOException e) {
|
||||
this.logger.warn(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/upload/batchImport"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<Boolean> batchImportPerson(@RequestBody BatchImportParam param) {
|
||||
return this.imgStorePersonService.batchPerson(param, this.getCloudwalkContext());
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/uniqueCheck"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<List<ImgStorePersonResult>> personUniqueCheck(
|
||||
@RequestBody QueryImgPersonParam param) {
|
||||
return this.imgStorePersonService.getByUniqueCondition(param, this.getCloudwalkContext());
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/personInfoBackFill"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<UserAccountCheckResult> personInfoBackFill(
|
||||
@RequestBody QueryImgPersonParam param) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/account/check"})
|
||||
public CloudwalkResult<List<UserAccountCheckResult>> syncAccountCheck(
|
||||
@RequestBody QueryImgPersonParam param) {
|
||||
return this.imgStorePersonService.syncAccountCheck(param, this.getCloudwalkContext());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/account/bind"})
|
||||
public CloudwalkResult<Boolean> syncAccountBind(@RequestBody SyncAccountParam param) {
|
||||
return this.imgStorePersonService.syncAccountBind(param, this.getCloudwalkContext());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/account/unbind"})
|
||||
public CloudwalkResult<Boolean> syncAccountUnbind(@RequestBody SyncAccountParam param) {
|
||||
return this.imgStorePersonService.syncAccountUnbind(param, this.getCloudwalkContext());
|
||||
}
|
||||
}
|
||||
+105
@@ -0,0 +1,105 @@
|
||||
package cn.cloudwalk.web.organization.controller;
|
||||
|
||||
// Web控制器
|
||||
import cn.cloudwalk.client.organization.param.CommonParam;
|
||||
import cn.cloudwalk.client.organization.personimg.param.AddImgPersonProParam;
|
||||
import cn.cloudwalk.client.organization.personimg.param.SwitchParam;
|
||||
import cn.cloudwalk.client.organization.personimg.service.ImgStorePersonPropertiesService;
|
||||
import cn.cloudwalk.client.organization.result.EngineResult;
|
||||
import cn.cloudwalk.client.organization.result.PersonProListResult;
|
||||
import cn.cloudwalk.client.organization.result.PersonPropertiesSwitchResult;
|
||||
import cn.cloudwalk.cloud.exception.ServiceException;
|
||||
import cn.cloudwalk.cloud.result.CloudwalkResult;
|
||||
import cn.cloudwalk.web.organization.controller.common.AbstractCloudwalkController;
|
||||
import javax.annotation.Resource;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = {"/component/person/properties"})
|
||||
public class PersonPropertiesController extends AbstractCloudwalkController {
|
||||
@Resource private ImgStorePersonPropertiesService imgStorePersonPropertiesService;
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/addorupdate"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<Boolean> add(@RequestBody AddImgPersonProParam param) {
|
||||
try {
|
||||
return this.imgStorePersonPropertiesService.addOrUpdate(param, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) this.getMessage(e.getCode()));
|
||||
} catch (Exception e) {
|
||||
this.logger.error("人员信息新增失败,原因:", e);
|
||||
return CloudwalkResult.fail((String) "53004113", (String) this.getMessage("53004113"));
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/list"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<PersonProListResult> getList(@RequestBody CommonParam commonParam) {
|
||||
try {
|
||||
String businessId =
|
||||
StringUtils.isNotBlank((CharSequence) commonParam.getBusinessId())
|
||||
? commonParam.getBusinessId()
|
||||
: this.getCloudwalkContext().getCompany().getCompanyId();
|
||||
return this.imgStorePersonPropertiesService.getList(businessId);
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("人员属性列表获取异常,原因:", e);
|
||||
return CloudwalkResult.fail((String) "53004112", (String) this.getMessage("53004112"));
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/init"})
|
||||
public CloudwalkResult<Boolean> init(@RequestBody AddImgPersonProParam param) {
|
||||
try {
|
||||
return this.imgStorePersonPropertiesService.init(param, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) this.getMessage(e.getCode()));
|
||||
} catch (Exception e) {
|
||||
this.logger.error("自动生成人员公共属性失败,原因:", e);
|
||||
return CloudwalkResult.fail((String) "53004113", (String) this.getMessage("53004113"));
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/switch/engineStatus"})
|
||||
public CloudwalkResult<EngineResult> engineStatus() {
|
||||
try {
|
||||
return this.imgStorePersonPropertiesService.engineStatus();
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) this.getMessage(e.getCode()));
|
||||
} catch (Exception e) {
|
||||
this.logger.error("查询引擎在线状态失败,原因:", e);
|
||||
return CloudwalkResult.fail((String) "53004123", (String) this.getMessage("53004123"));
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/switch/getParam"})
|
||||
public CloudwalkResult<PersonPropertiesSwitchResult> getParam() {
|
||||
try {
|
||||
return this.imgStorePersonPropertiesService.getParam(this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) this.getMessage(e.getCode()));
|
||||
} catch (Exception e) {
|
||||
this.logger.error("查询注册图优化参数失败,原因:", e);
|
||||
return CloudwalkResult.fail((String) "53004125", (String) this.getMessage("53004125"));
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/switch/saveParam"})
|
||||
public CloudwalkResult<Boolean> saveParam(@RequestBody SwitchParam param) {
|
||||
try {
|
||||
return this.imgStorePersonPropertiesService.saveParam(param, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) this.getMessage(e.getCode()));
|
||||
} catch (Exception e) {
|
||||
this.logger.error("保存注册图优化参数失败,原因:", e);
|
||||
return CloudwalkResult.fail((String) "53004126", (String) this.getMessage("53004126"));
|
||||
}
|
||||
}
|
||||
}
|
||||
+100
@@ -0,0 +1,100 @@
|
||||
package cn.cloudwalk.web.organization.controller;
|
||||
|
||||
// Web控制器
|
||||
import cn.cloudwalk.client.organization.service.store.param.AddPersonRegistryParam;
|
||||
import cn.cloudwalk.client.organization.service.store.param.QueryPersonRegistryParam;
|
||||
import cn.cloudwalk.client.organization.service.store.result.PersonPropertiesResult;
|
||||
import cn.cloudwalk.client.organization.service.store.result.PersonRegistryResult;
|
||||
import cn.cloudwalk.client.organization.service.store.service.PersonRegistryService;
|
||||
import cn.cloudwalk.cloud.exception.ServiceException;
|
||||
import cn.cloudwalk.cloud.result.CloudwalkResult;
|
||||
import cn.cloudwalk.web.organization.controller.common.AbstractCloudwalkController;
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = {"/component/person/registry"})
|
||||
public class PersonRegistryController extends AbstractCloudwalkController {
|
||||
@Resource private PersonRegistryService personRegistryService;
|
||||
|
||||
@PostMapping(value = {"/save"})
|
||||
public CloudwalkResult<Boolean> save(@RequestBody AddPersonRegistryParam addParam) {
|
||||
try {
|
||||
return this.personRegistryService.save(addParam, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("人员注册配置保存异常", e);
|
||||
return CloudwalkResult.fail((String) "53014515", (String) this.getMessage("53014515"));
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/detail"})
|
||||
public CloudwalkResult<PersonRegistryResult> detail(@RequestBody QueryPersonRegistryParam param) {
|
||||
try {
|
||||
return this.personRegistryService.detail(param, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("获取人员注册配置详情异常", e);
|
||||
return CloudwalkResult.fail((String) "53014520", (String) this.getMessage("53014520"));
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/properties/list"})
|
||||
public CloudwalkResult<List<PersonPropertiesResult>> getPropertyList(
|
||||
@RequestBody QueryPersonRegistryParam param) {
|
||||
try {
|
||||
return this.personRegistryService.getRegistryPropertyList(param, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("获取人员注册属性列表异常", e);
|
||||
return CloudwalkResult.fail((String) "53014521", (String) this.getMessage("53014521"));
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/audit/properties/list"})
|
||||
public CloudwalkResult<List<PersonPropertiesResult>> getAuditPropertyList(
|
||||
@RequestBody QueryPersonRegistryParam param) {
|
||||
try {
|
||||
return this.personRegistryService.getAuditPropertyList(param, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("获取人员审核属性列表异常", e);
|
||||
return CloudwalkResult.fail((String) "53014521", (String) this.getMessage("53014521"));
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/properties/getunique"})
|
||||
CloudwalkResult<PersonPropertiesResult> getUniqueRegistryProperty(
|
||||
@RequestBody QueryPersonRegistryParam param) throws ServiceException {
|
||||
try {
|
||||
return this.personRegistryService.getUniqueRegistryProperty(
|
||||
param, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("获取人员注册属性中唯一且必填的属性异常", e);
|
||||
return CloudwalkResult.fail((String) "53014523", (String) this.getMessage("53014523"));
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/properties/getbindproperty"})
|
||||
CloudwalkResult<PersonPropertiesResult> getBindProperty(
|
||||
@RequestBody QueryPersonRegistryParam param) throws ServiceException {
|
||||
try {
|
||||
return this.personRegistryService.getBindProperty(param, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("获取人员注册属性中唯一且必填的属性异常", e);
|
||||
return CloudwalkResult.fail((String) "53014523", (String) this.getMessage("53014523"));
|
||||
}
|
||||
}
|
||||
}
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
package cn.cloudwalk.web.organization.controller;
|
||||
|
||||
// Web控制器
|
||||
import cn.cloudwalk.client.organization.service.store.param.QueryPersonRegistryParam;
|
||||
import cn.cloudwalk.client.organization.service.store.result.PersonPropertiesResult;
|
||||
import cn.cloudwalk.client.organization.service.store.service.PersonRegistryService;
|
||||
import cn.cloudwalk.cloud.exception.ServiceException;
|
||||
import cn.cloudwalk.cloud.result.CloudwalkResult;
|
||||
import cn.cloudwalk.web.organization.controller.common.AbstractCloudwalkController;
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = {"/h5/person/registry"})
|
||||
public class PersonRegistryH5Controller extends AbstractCloudwalkController {
|
||||
@Resource private PersonRegistryService personRegistryService;
|
||||
|
||||
@PostMapping(value = {"/properties/list"})
|
||||
public CloudwalkResult<List<PersonPropertiesResult>> getPropertyList(
|
||||
@RequestBody QueryPersonRegistryParam param) {
|
||||
try {
|
||||
return this.personRegistryService.getRegistryPropertyList(param, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
this.logger.warn("H5获取人员注册属性列表异常:{}", (Object) e.getMessage());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("H5获取人员注册属性列表未知异常:{}", (Object) e.getMessage());
|
||||
}
|
||||
return CloudwalkResult.fail((String) "53014521", (String) this.getMessage("53014521"));
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/properties/getunique"})
|
||||
CloudwalkResult<PersonPropertiesResult> getUniqueRegistryProperty(
|
||||
@RequestBody QueryPersonRegistryParam param) throws ServiceException {
|
||||
try {
|
||||
return this.personRegistryService.getUniqueRegistryProperty(
|
||||
param, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
this.logger.warn("H5获取人员注册属性中唯一且必填的属性异常:{}", (Object) e.getMessage());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("H5获取人员注册属性中唯一且必填的属性未知异常:{}", (Object) e.getMessage());
|
||||
}
|
||||
return CloudwalkResult.fail((String) "53014523", (String) this.getMessage("53014523"));
|
||||
}
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package cn.cloudwalk.web.organization.controller;
|
||||
|
||||
// Web控制器
|
||||
import cn.cloudwalk.cloud.result.CloudwalkResult;
|
||||
import cn.cloudwalk.web.organization.controller.common.AbstractCloudwalkController;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = {"/component/qrcode"})
|
||||
public class QRCodeController extends AbstractCloudwalkController {
|
||||
@Value(value = "${qr.code.url}")
|
||||
private String codeUrl;
|
||||
|
||||
@GetMapping(value = {"/geturl"})
|
||||
public CloudwalkResult<String> getUrl() {
|
||||
try {
|
||||
String businessId = this.getCloudwalkContext().getCompany().getCompanyId();
|
||||
if (StringUtils.isNotBlank((CharSequence) businessId)) {
|
||||
return CloudwalkResult.success(this.codeUrl + businessId);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
this.logger.error("获取二维码地址异常", e);
|
||||
}
|
||||
return CloudwalkResult.fail((String) "53014900", (String) this.getMessage("53014900"));
|
||||
}
|
||||
}
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
package cn.cloudwalk.web.organization.controller.common;
|
||||
|
||||
// Web控制器
|
||||
import cn.cloudwalk.cloud.context.CloudwalkCallContext;
|
||||
import cn.cloudwalk.cloud.context.CloudwalkCallContextBuilder;
|
||||
import cn.cloudwalk.cloud.context.CloudwalkSessionContextHolder;
|
||||
import cn.cloudwalk.cloud.context.CloudwalkSessionObject;
|
||||
import cn.cloudwalk.web.organization.controller.common.ParamInjectionEnum;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.MessageSource;
|
||||
import org.springframework.context.i18n.LocaleContextHolder;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
public abstract class AbstractCloudwalkController {
|
||||
private static final String DEFAULT_USER_ID = "default";
|
||||
private static final String DEFAULT_USER_NAME = "系统调用";
|
||||
private static final String DEFAULT_SERVICE_CODE = "default";
|
||||
private static final String DEFAULT_BUSINESS_ID = "default";
|
||||
private static final String DEFAULT_APPLICATION_ID = "default";
|
||||
protected final Logger logger = LoggerFactory.getLogger(this.getClass());
|
||||
@Autowired private CloudwalkSessionContextHolder cloudwalkSessionContextHolder;
|
||||
@Autowired private MessageSource messageSource;
|
||||
|
||||
public CloudwalkCallContext getCloudwalkContext() {
|
||||
CloudwalkSessionObject sessionObject = this.getSessionObject(this.getHttpServletRequest());
|
||||
this.cloudwalkSessionContextHolder.putSession(sessionObject);
|
||||
return CloudwalkCallContextBuilder.buildContext(
|
||||
(CloudwalkSessionContextHolder) this.cloudwalkSessionContextHolder);
|
||||
}
|
||||
|
||||
protected HttpServletRequest getHttpServletRequest() {
|
||||
return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
||||
}
|
||||
|
||||
public String getMessage(String code, String defaultMsg) {
|
||||
return this.messageSource.getMessage(code, null, defaultMsg, LocaleContextHolder.getLocale());
|
||||
}
|
||||
|
||||
public String getMessage(String code) {
|
||||
return this.getMessage(code, "");
|
||||
}
|
||||
|
||||
private CloudwalkSessionObject getSessionObject(HttpServletRequest request) {
|
||||
String applicationId;
|
||||
String businessId;
|
||||
String serviceCode;
|
||||
String userName;
|
||||
String userId = request.getHeader(ParamInjectionEnum.USER_ID.getCode());
|
||||
if (StringUtils.isBlank((CharSequence) userId)) {
|
||||
userId = "default";
|
||||
}
|
||||
if (StringUtils.isBlank(
|
||||
(CharSequence) (userName = request.getHeader(ParamInjectionEnum.USER_NAME.getCode())))) {
|
||||
userName = DEFAULT_USER_NAME;
|
||||
}
|
||||
if (StringUtils.isBlank(
|
||||
(CharSequence)
|
||||
(serviceCode = request.getHeader(ParamInjectionEnum.SERVICE_CODE.getCode())))) {
|
||||
serviceCode = "default";
|
||||
}
|
||||
if (StringUtils.isBlank(
|
||||
(CharSequence)
|
||||
(businessId = request.getHeader(ParamInjectionEnum.BUSINESS_ID.getCode())))) {
|
||||
businessId = "default";
|
||||
}
|
||||
if (StringUtils.isBlank(
|
||||
(CharSequence)
|
||||
(applicationId = request.getHeader(ParamInjectionEnum.APPLICATION_ID.getCode())))) {
|
||||
applicationId = "default";
|
||||
}
|
||||
CloudwalkSessionObject sessionObject =
|
||||
new CloudwalkSessionObject(new String[] {userId, businessId, userName, applicationId});
|
||||
this.logger.debug(
|
||||
"获取用户信息{},{},{},{}", new Object[] {userId, userName, businessId, applicationId});
|
||||
sessionObject.getCompany().setCompanyName(serviceCode);
|
||||
return sessionObject;
|
||||
}
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
package cn.cloudwalk.web.organization.controller.common;
|
||||
|
||||
// Web控制器
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
public enum ParamInjectionEnum {
|
||||
USER_ID("platformUserId", "用户id"),
|
||||
USER_NAME("userName", "用户名称"),
|
||||
ORG_ID("orgId", "机构id"),
|
||||
ORG_NAME("orgName", "机构名称"),
|
||||
ORG_PATH("orgPath", "机构全路径"),
|
||||
CONTACT_PERSON("contactPerson", "联系人"),
|
||||
SERVICE_CODE("serviceCode", "服务编码"),
|
||||
BUSINESS_ID("businessId", "企业Id"),
|
||||
APPLICATION_ID("applicationId", "应用Id");
|
||||
|
||||
private String code;
|
||||
private String desc;
|
||||
|
||||
private ParamInjectionEnum(String code, String desc) {
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public static String getDesc(String code) {
|
||||
for (ParamInjectionEnum l : ParamInjectionEnum.values()) {
|
||||
if (!StringUtils.equals((CharSequence) l.getCode(), (CharSequence) code)) continue;
|
||||
return l.getDesc();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return this.code;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return this.desc;
|
||||
}
|
||||
}
|
||||
+100
@@ -0,0 +1,100 @@
|
||||
package cn.cloudwalk.web.organization.controller.org;
|
||||
|
||||
// Web控制器
|
||||
import cn.cloudwalk.client.organization.param.AddAreaTypeParam;
|
||||
import cn.cloudwalk.client.organization.param.DelAreaTypeParam;
|
||||
import cn.cloudwalk.client.organization.param.EditAreaTypeParam;
|
||||
import cn.cloudwalk.client.organization.param.QueryAreaTypeParam;
|
||||
import cn.cloudwalk.client.organization.result.AreaTypeListResult;
|
||||
import cn.cloudwalk.client.organization.result.AreaTypeResult;
|
||||
import cn.cloudwalk.client.organization.service.AreaTypeService;
|
||||
import cn.cloudwalk.cloud.exception.ServiceException;
|
||||
import cn.cloudwalk.cloud.page.CloudwalkPageAble;
|
||||
import cn.cloudwalk.cloud.page.CloudwalkPageInfo;
|
||||
import cn.cloudwalk.cloud.result.CloudwalkResult;
|
||||
import cn.cloudwalk.web.organization.controller.common.AbstractCloudwalkController;
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = {"/component/area/type"})
|
||||
public class AreaTypeController extends AbstractCloudwalkController {
|
||||
@Resource private AreaTypeService areaTypeService;
|
||||
|
||||
@RequestMapping(value = {"/add"})
|
||||
public CloudwalkResult<String> add(@RequestBody AddAreaTypeParam param) {
|
||||
try {
|
||||
return this.areaTypeService.add(param, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) this.getMessage(e.getCode()));
|
||||
} catch (Exception e) {
|
||||
this.logger.error("区域类型信息新增失败,原因:", e);
|
||||
return CloudwalkResult.fail((String) "53004800", (String) this.getMessage("53004800"));
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/edit"})
|
||||
public CloudwalkResult<Boolean> edit(@RequestBody EditAreaTypeParam param) {
|
||||
try {
|
||||
return this.areaTypeService.edit(param, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) this.getMessage(e.getCode()));
|
||||
} catch (Exception e) {
|
||||
this.logger.error("区域类型编辑失败,原因:", e);
|
||||
return CloudwalkResult.fail((String) "53004801", (String) this.getMessage("53004801"));
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/delete"})
|
||||
public CloudwalkResult<Boolean> delete(@RequestBody DelAreaTypeParam param) {
|
||||
try {
|
||||
return this.areaTypeService.delete(param, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) this.getMessage(e.getCode()));
|
||||
} catch (Exception e) {
|
||||
this.logger.error("区域类型删除失败,原因:", e);
|
||||
return CloudwalkResult.fail((String) "53004802", (String) this.getMessage("53004802"));
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/detail"})
|
||||
public CloudwalkResult<AreaTypeResult> detail(@RequestBody QueryAreaTypeParam param) {
|
||||
try {
|
||||
return this.areaTypeService.detail(param, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) this.getMessage(e.getCode()));
|
||||
} catch (Exception e) {
|
||||
this.logger.error("区域类型详情获取失败,原因:", e);
|
||||
return CloudwalkResult.fail((String) "53004804", (String) this.getMessage("53004804"));
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/page"})
|
||||
public CloudwalkResult<CloudwalkPageAble<AreaTypeListResult>> page(
|
||||
@RequestBody QueryAreaTypeParam param) {
|
||||
CloudwalkPageInfo page = new CloudwalkPageInfo(param.getCurrentPage(), param.getRowsOfPage());
|
||||
try {
|
||||
return this.areaTypeService.page(param, page, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) this.getMessage(e.getCode()));
|
||||
} catch (Exception e) {
|
||||
this.logger.error("区域类型分页查询失败,原因:", e);
|
||||
return CloudwalkResult.fail((String) "53004804", (String) this.getMessage("53004804"));
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/list"})
|
||||
public CloudwalkResult<List<AreaTypeListResult>> list(@RequestBody QueryAreaTypeParam param) {
|
||||
try {
|
||||
return this.areaTypeService.getList(param, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) this.getMessage(e.getCode()));
|
||||
} catch (Exception e) {
|
||||
this.logger.error("区域类型查询失败,原因:", e);
|
||||
return CloudwalkResult.fail((String) "53004804", (String) this.getMessage("53004804"));
|
||||
}
|
||||
}
|
||||
}
|
||||
+140
@@ -0,0 +1,140 @@
|
||||
package cn.cloudwalk.web.organization.controller.org;
|
||||
|
||||
// Web控制器
|
||||
import cn.cloudwalk.client.organization.param.AddPersonOrgParam;
|
||||
import cn.cloudwalk.client.organization.param.DelPersonOrgParam;
|
||||
import cn.cloudwalk.client.organization.param.organization.AddOrganizationParam;
|
||||
import cn.cloudwalk.client.organization.param.organization.DelOrganizationParam;
|
||||
import cn.cloudwalk.client.organization.param.organization.EditOrganizationParam;
|
||||
import cn.cloudwalk.client.organization.param.organization.NextTreeOrganizationParam;
|
||||
import cn.cloudwalk.client.organization.param.organization.QueryOrganizationParam;
|
||||
import cn.cloudwalk.client.organization.result.NextTreeOrganizationResult;
|
||||
import cn.cloudwalk.client.organization.result.TreeOrganizationResult;
|
||||
import cn.cloudwalk.client.organization.service.OrganizationService;
|
||||
import cn.cloudwalk.client.organization.service.store.result.OrganizationResult;
|
||||
import cn.cloudwalk.cloud.exception.ServiceException;
|
||||
import cn.cloudwalk.cloud.page.CloudwalkPageAble;
|
||||
import cn.cloudwalk.cloud.page.CloudwalkPageInfo;
|
||||
import cn.cloudwalk.cloud.result.CloudwalkResult;
|
||||
import cn.cloudwalk.web.organization.controller.common.AbstractCloudwalkController;
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController(value = "coreOrganizationController")
|
||||
@RequestMapping(value = {"/component/organization"})
|
||||
public class OrganizationController extends AbstractCloudwalkController {
|
||||
@Autowired
|
||||
@Qualifier(value = "coreOrganizationServiceImpl")
|
||||
private OrganizationService organizationService;
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/add"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<String> add(@RequestBody AddOrganizationParam param) {
|
||||
return this.organizationService.add(param, this.getCloudwalkContext());
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/edit"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<Boolean> edit(@RequestBody EditOrganizationParam param) {
|
||||
try {
|
||||
return this.organizationService.edit(param, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/batch/delete"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<Boolean> delete(@RequestBody DelOrganizationParam param) {
|
||||
return this.organizationService.delete(param, this.getCloudwalkContext());
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/enable"})
|
||||
public CloudwalkResult<Boolean> enable(@RequestBody QueryOrganizationParam param) {
|
||||
return this.organizationService.enable(param, this.getCloudwalkContext());
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/disable"})
|
||||
public CloudwalkResult<Boolean> disable(@RequestBody QueryOrganizationParam param) {
|
||||
return this.organizationService.disable(param, this.getCloudwalkContext());
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/tree"})
|
||||
public CloudwalkResult<List<TreeOrganizationResult>> tree(
|
||||
@RequestBody NextTreeOrganizationParam param) {
|
||||
try {
|
||||
return this.organizationService.tree(param, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
this.logger.error("机构树结构查询失败", e);
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) "服务异常,请稍后重试");
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/getNextTree"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<List<NextTreeOrganizationResult>> getNextTree(
|
||||
@RequestBody NextTreeOrganizationParam param) {
|
||||
return this.organizationService.getNextTree(param, this.getCloudwalkContext());
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/personsAdd"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<Boolean> addPerson(@RequestBody AddPersonOrgParam personOrgParam) {
|
||||
return this.organizationService.addPerson(personOrgParam, this.getCloudwalkContext());
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/personsDel"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<Boolean> delPerson(@RequestBody DelPersonOrgParam delPersonOrgParam) {
|
||||
return this.organizationService.delPerson(delPersonOrgParam, this.getCloudwalkContext());
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/page"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<CloudwalkPageAble<OrganizationResult>> page(
|
||||
@RequestBody QueryOrganizationParam param) {
|
||||
CloudwalkPageInfo page = new CloudwalkPageInfo(param.getCurrentPage(), param.getRowsOfPage());
|
||||
try {
|
||||
return this.organizationService.getPage(param, page, this.getCloudwalkContext());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("机构分页查询失败,原因:", e);
|
||||
return CloudwalkResult.fail((String) "53003300", (String) this.getMessage("53003300"));
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/list"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<List<OrganizationResult>> list(@RequestBody QueryOrganizationParam param) {
|
||||
try {
|
||||
return this.organizationService.getList(param, this.getCloudwalkContext());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("机构全量查询失败,原因:", e);
|
||||
return CloudwalkResult.fail((String) "53003300", (String) this.getMessage("53003300"));
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/detail"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<OrganizationResult> detail(@RequestBody QueryOrganizationParam param) {
|
||||
try {
|
||||
return this.organizationService.detail(param, this.getCloudwalkContext());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("机构详情查询失败,原因:", e);
|
||||
return CloudwalkResult.fail((String) "53003300", (String) this.getMessage("53003300"));
|
||||
}
|
||||
}
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package cn.cloudwalk.web.organization.controller.org;
|
||||
|
||||
// Web控制器
|
||||
import cn.cloudwalk.client.organization.param.organization.NextTreeOrganizationParam;
|
||||
import cn.cloudwalk.client.organization.result.TreeOrganizationResult;
|
||||
import cn.cloudwalk.client.organization.service.OrganizationService;
|
||||
import cn.cloudwalk.cloud.exception.ServiceException;
|
||||
import cn.cloudwalk.cloud.result.CloudwalkResult;
|
||||
import cn.cloudwalk.web.organization.controller.common.AbstractCloudwalkController;
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = {"/h5/organization"})
|
||||
public class OrganizationH5Controller extends AbstractCloudwalkController {
|
||||
@Resource private OrganizationService organizationService;
|
||||
|
||||
@RequestMapping(value = {"/tree"})
|
||||
public CloudwalkResult<List<TreeOrganizationResult>> tree(
|
||||
@RequestBody NextTreeOrganizationParam param) {
|
||||
try {
|
||||
return this.organizationService.tree(param, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
this.logger.error("机构树结构", e);
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
+126
@@ -0,0 +1,126 @@
|
||||
package cn.cloudwalk.web.organization.controller.org;
|
||||
|
||||
// Web控制器
|
||||
import cn.cloudwalk.client.organization.param.QueryOrgTypeParam;
|
||||
import cn.cloudwalk.client.organization.param.organization.AddOrganizationTypeParam;
|
||||
import cn.cloudwalk.client.organization.param.organization.DelOrganizationTypeParam;
|
||||
import cn.cloudwalk.client.organization.param.organization.EditOrganizationTypeParam;
|
||||
import cn.cloudwalk.client.organization.result.OrganizationTypeListResult;
|
||||
import cn.cloudwalk.client.organization.result.OrganizationTypePropertyCommonResult;
|
||||
import cn.cloudwalk.client.organization.result.OrganizationTypeResult;
|
||||
import cn.cloudwalk.client.organization.service.OrganizationTypeService;
|
||||
import cn.cloudwalk.cloud.exception.ServiceException;
|
||||
import cn.cloudwalk.cloud.page.CloudwalkPageAble;
|
||||
import cn.cloudwalk.cloud.page.CloudwalkPageInfo;
|
||||
import cn.cloudwalk.cloud.result.CloudwalkResult;
|
||||
import cn.cloudwalk.web.organization.controller.common.AbstractCloudwalkController;
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = {"/component/organization/type"})
|
||||
public class OrganizationTypeController extends AbstractCloudwalkController {
|
||||
@Resource private OrganizationTypeService organizationTypeService;
|
||||
|
||||
@RequestMapping(value = {"/add"})
|
||||
public CloudwalkResult<String> add(@RequestBody AddOrganizationTypeParam param) {
|
||||
try {
|
||||
return this.organizationTypeService.add(param, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) this.getMessage(e.getCode()));
|
||||
} catch (Exception e) {
|
||||
this.logger.error("机构类别信息新增失败,原因:", e);
|
||||
return CloudwalkResult.fail((String) "53003800", (String) this.getMessage("53003800"));
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/edit"})
|
||||
public CloudwalkResult<Boolean> edit(@RequestBody EditOrganizationTypeParam param) {
|
||||
try {
|
||||
return this.organizationTypeService.edit(param, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) this.getMessage(e.getCode()));
|
||||
} catch (Exception e) {
|
||||
this.logger.error("机构类别编辑失败,原因:", e);
|
||||
return CloudwalkResult.fail((String) "53003801", (String) this.getMessage("53003801"));
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/delete"})
|
||||
public CloudwalkResult<Boolean> delete(@RequestBody DelOrganizationTypeParam param) {
|
||||
try {
|
||||
return this.organizationTypeService.delete(param, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) this.getMessage(e.getCode()));
|
||||
} catch (Exception e) {
|
||||
this.logger.error("机构类别删除失败,原因:", e);
|
||||
return CloudwalkResult.fail((String) "53003802", (String) this.getMessage("53003802"));
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/detail"})
|
||||
public CloudwalkResult<OrganizationTypeResult> detail(@RequestBody QueryOrgTypeParam param) {
|
||||
try {
|
||||
return this.organizationTypeService.detail(param, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) this.getMessage(e.getCode()));
|
||||
} catch (Exception e) {
|
||||
this.logger.error("机构类别详情获取失败,原因:", e);
|
||||
return CloudwalkResult.fail((String) "53003804", (String) this.getMessage("53003804"));
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/page"})
|
||||
public CloudwalkResult<CloudwalkPageAble<OrganizationTypeListResult>> page(
|
||||
@RequestBody QueryOrgTypeParam param) {
|
||||
CloudwalkPageInfo page = new CloudwalkPageInfo(param.getCurrentPage(), param.getRowsOfPage());
|
||||
try {
|
||||
return this.organizationTypeService.page(param, page, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) this.getMessage(e.getCode()));
|
||||
} catch (Exception e) {
|
||||
this.logger.error("机构类别分页查询失败,原因:", e);
|
||||
return CloudwalkResult.fail((String) "53003804", (String) this.getMessage("53003804"));
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/list"})
|
||||
public CloudwalkResult<List<OrganizationTypeListResult>> list(
|
||||
@RequestBody QueryOrgTypeParam param) {
|
||||
try {
|
||||
return this.organizationTypeService.getList(param, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) this.getMessage(e.getCode()));
|
||||
} catch (Exception e) {
|
||||
this.logger.error("机构类别查询失败,原因:", e);
|
||||
return CloudwalkResult.fail((String) "53003804", (String) this.getMessage("53003804"));
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/init"})
|
||||
public CloudwalkResult<Boolean> init(@RequestBody EditOrganizationTypeParam param) {
|
||||
try {
|
||||
return this.organizationTypeService.init(param, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) this.getMessage(e.getCode()));
|
||||
} catch (Exception e) {
|
||||
this.logger.error("自动生成机构类别公共属性失败,原因:", e);
|
||||
return CloudwalkResult.fail((String) "53003801", (String) this.getMessage("53003801"));
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/commons"})
|
||||
public CloudwalkResult<List<OrganizationTypePropertyCommonResult>> commonList() {
|
||||
try {
|
||||
return this.organizationTypeService.commonList(this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) this.getMessage(e.getCode()));
|
||||
} catch (Exception e) {
|
||||
this.logger.error("获取机构类别公共属性,原因:", e);
|
||||
return CloudwalkResult.fail((String) "53003801", (String) this.getMessage("53003801"));
|
||||
}
|
||||
}
|
||||
}
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
package cn.cloudwalk.web.organization.controller.org;
|
||||
|
||||
// Web控制器
|
||||
import cn.cloudwalk.client.organization.param.organization.EditOrganizationParam;
|
||||
import cn.cloudwalk.client.organization.param.organization.EditUnitParam;
|
||||
import cn.cloudwalk.client.organization.param.organization.QueryOrganizationParam;
|
||||
import cn.cloudwalk.client.organization.result.TreeOrganizationResult;
|
||||
import cn.cloudwalk.client.organization.service.OrganizationService;
|
||||
import cn.cloudwalk.client.organization.service.store.result.OrganizationAreaResult;
|
||||
import cn.cloudwalk.client.organization.service.store.result.OrganizationResult;
|
||||
import cn.cloudwalk.cloud.result.CloudwalkResult;
|
||||
import cn.cloudwalk.service.organization.utils.BeanCopyUtils;
|
||||
import cn.cloudwalk.web.organization.controller.common.AbstractCloudwalkController;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = {"/component/organization-unit"})
|
||||
public class OrganizationUnitController extends AbstractCloudwalkController {
|
||||
@Autowired
|
||||
@Qualifier(value = "organizationUnitServiceImpl")
|
||||
private OrganizationService organizationService;
|
||||
|
||||
@PostMapping(value = {"/tree"})
|
||||
public CloudwalkResult<List<TreeOrganizationResult>> listUnitTree(
|
||||
@RequestBody QueryOrganizationParam param) {
|
||||
return CloudwalkResult.fail((String) "99999999", (String) "暂不支持");
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = {"/list"},
|
||||
method = {RequestMethod.POST})
|
||||
public CloudwalkResult<List<OrganizationResult>> listUnit(
|
||||
@RequestBody QueryOrganizationParam param) {
|
||||
try {
|
||||
return this.organizationService.getList(param, this.getCloudwalkContext());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("单位全量查询失败,原因:", e);
|
||||
return CloudwalkResult.fail((String) "53003300", (String) this.getMessage("53003300"));
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/edit"})
|
||||
public CloudwalkResult<Boolean> edit(@RequestBody EditUnitParam param) {
|
||||
EditOrganizationParam target = new EditOrganizationParam();
|
||||
BeanCopyUtils.copyPropertiesIgnoreNull((Object) param, (Object) target);
|
||||
try {
|
||||
return this.organizationService.edit(target, this.getCloudwalkContext());
|
||||
} catch (Exception e) {
|
||||
this.logger.error("unit edit error: ", e);
|
||||
return CloudwalkResult.fail((String) "1", (String) "1");
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/detail"})
|
||||
public CloudwalkResult<OrganizationResult> detail(@RequestBody QueryOrganizationParam param) {
|
||||
return this.organizationService.detail(param, this.getCloudwalkContext());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/list-names"})
|
||||
public CloudwalkResult<Map<String, String>> listNames(@RequestBody QueryOrganizationParam param) {
|
||||
return this.organizationService.listNames(param, this.getCloudwalkContext());
|
||||
}
|
||||
|
||||
@PostMapping(value = {"/list-area"})
|
||||
public CloudwalkResult<OrganizationAreaResult> listAreas(
|
||||
@RequestBody QueryOrganizationParam param) {
|
||||
return this.organizationService.listAreas(param, this.getCloudwalkContext());
|
||||
}
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package cn.cloudwalk.web.organization.controller.org;
|
||||
|
||||
// Web控制器
|
||||
import cn.cloudwalk.client.organization.param.QueryOrgTypeParam;
|
||||
import cn.cloudwalk.client.organization.result.OrganizationTypeListResult;
|
||||
import cn.cloudwalk.client.organization.service.OrganizationTypeService;
|
||||
import cn.cloudwalk.cloud.exception.ServiceException;
|
||||
import cn.cloudwalk.cloud.result.CloudwalkResult;
|
||||
import cn.cloudwalk.web.organization.controller.common.AbstractCloudwalkController;
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = {"/component/organization-unit/type"})
|
||||
public class OrganizationUnitTypeController extends AbstractCloudwalkController {
|
||||
@Resource private OrganizationTypeService organizationTypeService;
|
||||
|
||||
@RequestMapping(value = {"/list"})
|
||||
public CloudwalkResult<List<OrganizationTypeListResult>> list(
|
||||
@RequestBody QueryOrgTypeParam param) {
|
||||
try {
|
||||
return this.organizationTypeService.getList(param, this.getCloudwalkContext());
|
||||
} catch (ServiceException e) {
|
||||
return CloudwalkResult.fail((String) e.getCode(), (String) this.getMessage(e.getCode()));
|
||||
} catch (Exception e) {
|
||||
this.logger.error("机构类别查询失败,原因:", e);
|
||||
return CloudwalkResult.fail((String) "53003804", (String) this.getMessage("53003804"));
|
||||
}
|
||||
}
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package cn.cloudwalk.web.organization.controller.personfile;
|
||||
|
||||
// Web控制器
|
||||
import cn.cloudwalk.client.organization.service.store.param.BaseImageStoreParam;
|
||||
import cn.cloudwalk.cloud.result.CloudwalkResult;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = {"/person-store"})
|
||||
public class PersonFileController {
|
||||
@PostMapping(value = {"/all-person"})
|
||||
public CloudwalkResult<List<String>> getPersonGroup(@RequestBody BaseImageStoreParam param) {
|
||||
return CloudwalkResult.success(new ArrayList());
|
||||
}
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
Summary for /tmp/cwos-component-organization-web-v2.9.2_xinghewan.jar
|
||||
Decompiled with CFR 0.152
|
||||
Reference in New Issue
Block a user