Commit dc1e548e by 陶光胜

Merge branch 'developer' of…

Merge branch 'developer' of http://115.159.76.241/base_platform_enterprise/gic-data-cloud into developer
parents 208e11b5 f0edbc0a
...@@ -68,10 +68,14 @@ public interface DataExplainApiService { ...@@ -68,10 +68,14 @@ public interface DataExplainApiService {
* @Description: * @Description:
* @author zhiwj * @author zhiwj
* @param dataExplainIdList * @param dataExplainIdList
* @param updateType
* @param reason
* @param optUserId
* @param optUserName
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void> * @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
* @throws * @throws
*/ */
ServiceResponse<Void> publish(List<Integer> dataExplainIdList); ServiceResponse<Void> publish(List<Integer> dataExplainIdList, Integer updateType, String reason, Integer optUserId, String optUserName);
/** /**
* @Title: listByModule * @Title: listByModule
......
...@@ -69,10 +69,14 @@ public interface IndexApiService { ...@@ -69,10 +69,14 @@ public interface IndexApiService {
* @Description: * @Description:
* @author zhiwj * @author zhiwj
* @param indexIdList * @param indexIdList
* @param updateType
* @param reason
* @param optUserId
* @param optUserName
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void> * @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
* @throws * @throws
*/ */
ServiceResponse<Void> publish(List<Integer> indexIdList); ServiceResponse<Void> publish(List<Integer> indexIdList, Integer updateType, String reason, Integer optUserId, String optUserName);
/** /**
* @Title: listByModule * @Title: listByModule
......
...@@ -2,6 +2,7 @@ package com.gic.cloud.operation.web.controller; ...@@ -2,6 +2,7 @@ package com.gic.cloud.operation.web.controller;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse; import com.gic.api.base.commons.ServiceResponse;
import com.gic.authcenter.security.core.util.UserUtils;
import com.gic.cloud.dto.DataExplainDTO; import com.gic.cloud.dto.DataExplainDTO;
import com.gic.cloud.dto.IndexLogDTO; import com.gic.cloud.dto.IndexLogDTO;
import com.gic.cloud.qo.DataExplainQO; import com.gic.cloud.qo.DataExplainQO;
...@@ -37,12 +38,20 @@ public class DataExplainController { ...@@ -37,12 +38,20 @@ public class DataExplainController {
if (StringUtils.isBlank(dataExplainDTO.getDataName()) || StringUtils.isBlank(dataExplainDTO.getIndexRemark())) { if (StringUtils.isBlank(dataExplainDTO.getDataName()) || StringUtils.isBlank(dataExplainDTO.getIndexRemark())) {
return RestResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), ErrorCode.PARAMETER_ERROR.getMsg()); return RestResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), ErrorCode.PARAMETER_ERROR.getMsg());
} }
Integer id = UserUtils.getUser().getId();
String realName = UserUtils.getUser().getRealName();
dataExplainDTO.setOptUserId(id);
dataExplainDTO.setOptUserName(realName);
ServiceResponse<Void> serviceResponse = dataExplainApiService.saveDataExplain(dataExplainDTO); ServiceResponse<Void> serviceResponse = dataExplainApiService.saveDataExplain(dataExplainDTO);
return ResultControllerUtils.commonResult(serviceResponse); return ResultControllerUtils.commonResult(serviceResponse);
} }
@RequestMapping("/update-data-explain") @RequestMapping("/update-data-explain")
public RestResponse updateDataExplain(DataExplainDTO dataExplainDTO, Integer updateType, String reason) { public RestResponse updateDataExplain(DataExplainDTO dataExplainDTO, Integer updateType, String reason) {
Integer id = UserUtils.getUser().getId();
String realName = UserUtils.getUser().getRealName();
dataExplainDTO.setOptUserId(id);
dataExplainDTO.setOptUserName(realName);
ServiceResponse<Void> serviceResponse = dataExplainApiService.updateDataExplain(dataExplainDTO, updateType, reason); ServiceResponse<Void> serviceResponse = dataExplainApiService.updateDataExplain(dataExplainDTO, updateType, reason);
return ResultControllerUtils.commonResult(serviceResponse); return ResultControllerUtils.commonResult(serviceResponse);
} }
...@@ -72,11 +81,12 @@ public class DataExplainController { ...@@ -72,11 +81,12 @@ public class DataExplainController {
} }
@RequestMapping("/publish-data-explain") @RequestMapping("/publish-data-explain")
public RestResponse publishIndex(String dataExplainIds) { public RestResponse publishIndex(String dataExplainIds, Integer updateType, String reason) {
if (StringUtils.isBlank(dataExplainIds)) { if (StringUtils.isBlank(dataExplainIds)) {
return RestResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), ErrorCode.PARAMETER_ERROR.getMsg()); return RestResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), ErrorCode.PARAMETER_ERROR.getMsg());
} }
ServiceResponse<Void> serviceResponse = dataExplainApiService.publish(Stream.of(dataExplainIds.split(",")).map(Integer::valueOf).collect(Collectors.toList())); List<Integer> dataExplainIdList = Stream.of(dataExplainIds.split(",")).map(Integer::valueOf).collect(Collectors.toList());
ServiceResponse<Void> serviceResponse = dataExplainApiService.publish(dataExplainIdList, updateType, reason, UserUtils.getUser().getId(), UserUtils.getUser().getRealName());
return ResultControllerUtils.commonResult(serviceResponse); return ResultControllerUtils.commonResult(serviceResponse);
} }
......
...@@ -63,6 +63,10 @@ public class IndexController { ...@@ -63,6 +63,10 @@ public class IndexController {
if (indexDTO.getIndexId() == null || updateType == null) { if (indexDTO.getIndexId() == null || updateType == null) {
return RestResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), ErrorCode.PARAMETER_ERROR.getMsg()); return RestResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), ErrorCode.PARAMETER_ERROR.getMsg());
} }
Integer id = UserUtils.getUser().getId();
String realName = UserUtils.getUser().getRealName();
indexDTO.setOptUserId(id);
indexDTO.setOptUserName(realName);
ServiceResponse<Void> serviceResponse = indexApiService.updateIndex(indexDTO, updateType, reason); ServiceResponse<Void> serviceResponse = indexApiService.updateIndex(indexDTO, updateType, reason);
return ResultControllerUtils.commonResult(serviceResponse); return ResultControllerUtils.commonResult(serviceResponse);
} }
...@@ -92,11 +96,14 @@ public class IndexController { ...@@ -92,11 +96,14 @@ public class IndexController {
} }
@RequestMapping("/publish-index") @RequestMapping("/publish-index")
public RestResponse publishIndex(String indexIds) { public RestResponse publishIndex(String indexIds, Integer updateType, String reason) {
if (StringUtils.isBlank(indexIds)) { if (StringUtils.isBlank(indexIds)) {
return RestResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), ErrorCode.PARAMETER_ERROR.getMsg()); return RestResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), ErrorCode.PARAMETER_ERROR.getMsg());
} }
ServiceResponse<Void> serviceResponse = indexApiService.publish(Stream.of(indexIds.split(",")).map(Integer::valueOf).collect(Collectors.toList())); Integer id = UserUtils.getUser().getId();
String realName = UserUtils.getUser().getRealName();
List<Integer> indexIdList = Stream.of(indexIds.split(",")).map(Integer::valueOf).collect(Collectors.toList());
ServiceResponse<Void> serviceResponse = indexApiService.publish(indexIdList, updateType, reason, id, realName);
return ResultControllerUtils.commonResult(serviceResponse); return ResultControllerUtils.commonResult(serviceResponse);
} }
......
...@@ -98,10 +98,16 @@ public class DataExplainApiServiceImpl implements DataExplainApiService { ...@@ -98,10 +98,16 @@ public class DataExplainApiServiceImpl implements DataExplainApiService {
} }
@Override @Override
public ServiceResponse<Void> publish(List<Integer> dataExplainIdList) { public ServiceResponse<Void> publish(List<Integer> dataExplainIdList, Integer updateType, String reason, Integer optUserId, String optUserName) {
for (Integer dataExplainId : dataExplainIdList) { for (Integer dataExplainId : dataExplainIdList) {
this.updateTipService.publish(dataExplainId, LogAndUpdateTipsTypeEnum.DATA_EXPLAIN.getCode()); this.updateTipService.publish(dataExplainId, LogAndUpdateTipsTypeEnum.DATA_EXPLAIN.getCode());
DataExplainDTO dataExplainDTO = new DataExplainDTO();
dataExplainDTO.setDataExplainId(dataExplainId);
dataExplainDTO.setOptUserId(optUserId);
dataExplainDTO.setOptUserName(optUserName);
indexLogService.saveDataExplainUpdateLog(dataExplainDTO, reason);
} }
return EnterpriseServiceResponse.success(); return EnterpriseServiceResponse.success();
} }
......
...@@ -125,9 +125,14 @@ public class IndexApiServiceImpl implements IndexApiService { ...@@ -125,9 +125,14 @@ public class IndexApiServiceImpl implements IndexApiService {
} }
@Override @Override
public ServiceResponse<Void> publish(List<Integer> indexIdList) { public ServiceResponse<Void> publish(List<Integer> indexIdList, Integer updateType, String reason, Integer optUserId, String optUserName) {
for (Integer indexId : indexIdList) { for (Integer indexId : indexIdList) {
this.updateTipService.publish(indexId, LogAndUpdateTipsTypeEnum.INDEX.getCode()); this.updateTipService.publish(indexId, LogAndUpdateTipsTypeEnum.INDEX.getCode());
IndexDTO indexDTO = new IndexDTO();
indexDTO.setIndexId(indexId);
indexDTO.setOptUserId(optUserId);
indexDTO.setOptUserName(optUserName);
indexLogService.saveIndexUpdateLog(indexDTO, reason);
} }
return EnterpriseServiceResponse.success(); return EnterpriseServiceResponse.success();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment