Commit c427a178 by zhiwj

好办关联

parent 7e00a9ec
...@@ -10,6 +10,8 @@ public enum LogAndUpdateTipsTypeEnum { ...@@ -10,6 +10,8 @@ public enum LogAndUpdateTipsTypeEnum {
INDEX(1), INDEX(1),
// 数据解读 // 数据解读
DATA_EXPLAIN(2), DATA_EXPLAIN(2),
// 好办
HAOBAN(3),
; ;
private Integer code; private Integer code;
......
...@@ -102,9 +102,9 @@ public interface IndexApiService { ...@@ -102,9 +102,9 @@ public interface IndexApiService {
* @Title: listByModule * @Title: listByModule
* @Description: * @Description:
* @author zhiwj * @author zhiwj
* @param moduleId * @param indexDescCode
* @return com.gic.api.base.commons.ServiceResponse<java.util.List<com.gic.cloud.dto.IndexDTO>> * @return com.gic.api.base.commons.ServiceResponse<java.util.List<com.gic.cloud.dto.IndexDTO>>
* @throws * @throws
*/ */
ServiceResponse<List<IndexDTO>> listByModule(String moduleId); ServiceResponse<IndexDTO> getByIndexDescCode(String indexDescCode);
} }
...@@ -6,6 +6,7 @@ import com.gic.cloud.constants.LogAndUpdateTipsTypeEnum; ...@@ -6,6 +6,7 @@ import com.gic.cloud.constants.LogAndUpdateTipsTypeEnum;
import com.gic.cloud.constants.UpdateTypeEnum; import com.gic.cloud.constants.UpdateTypeEnum;
import com.gic.cloud.dto.IndexDTO; import com.gic.cloud.dto.IndexDTO;
import com.gic.cloud.entity.TabIndex; import com.gic.cloud.entity.TabIndex;
import com.gic.cloud.entity.TabIndexDesc;
import com.gic.cloud.entity.TabIndexGroup; import com.gic.cloud.entity.TabIndexGroup;
import com.gic.cloud.qo.IndexQo; import com.gic.cloud.qo.IndexQo;
import com.gic.cloud.service.*; import com.gic.cloud.service.*;
...@@ -31,6 +32,8 @@ import java.util.stream.Stream; ...@@ -31,6 +32,8 @@ import java.util.stream.Stream;
@Service("indexApiService") @Service("indexApiService")
public class IndexApiServiceImpl implements IndexApiService { public class IndexApiServiceImpl implements IndexApiService {
private static final String HAOBAN_NAME = "haoban";
@Autowired @Autowired
private IndexService indexService; private IndexService indexService;
@Autowired @Autowired
...@@ -41,6 +44,8 @@ public class IndexApiServiceImpl implements IndexApiService { ...@@ -41,6 +44,8 @@ public class IndexApiServiceImpl implements IndexApiService {
private UpdateTipService updateTipService; private UpdateTipService updateTipService;
@Autowired @Autowired
private IndexGroupService indexGroupService; private IndexGroupService indexGroupService;
@Autowired
private IndexDescService indexDescService;
@Override @Override
public ServiceResponse<Void> saveIndex(IndexDTO indexDTO) { public ServiceResponse<Void> saveIndex(IndexDTO indexDTO) {
...@@ -182,10 +187,19 @@ public class IndexApiServiceImpl implements IndexApiService { ...@@ -182,10 +187,19 @@ public class IndexApiServiceImpl implements IndexApiService {
} }
@Override @Override
public ServiceResponse<List<IndexDTO>> listByModule(String moduleId) { public ServiceResponse<IndexDTO> getByIndexDescCode(String indexDescCode) {
IndexQo indexQo = new IndexQo(); TabIndexDesc indexDesc = indexDescService.getIndexDesc(HAOBAN_NAME, indexDescCode, null);
indexQo.setModuleId(moduleId); if (indexDesc == null) {
List<TabIndex> indexList = indexService.listAllIndex(indexQo); return EnterpriseServiceResponse.failure(ErrorCode.NOTEXISTS.getCode(), ErrorCode.NOTEXISTS.getMsg());
return EnterpriseServiceResponse.success(EntityUtil.changeEntityListByJSON(IndexDTO.class, indexList)); }
List<Integer> list = indexModuleRelService.listBusinessIdByModuleId(indexDesc.getIndexDescId().toString(), LogAndUpdateTipsTypeEnum.HAOBAN.getCode());
if (CollectionUtils.isEmpty(list)) {
return EnterpriseServiceResponse.failure(ErrorCode.NOTEXISTS.getCode(), ErrorCode.NOTEXISTS.getMsg());
}
TabIndex index = indexService.getByIndexId(list.get(0));
if (index == null) {
return EnterpriseServiceResponse.failure(ErrorCode.NOTEXISTS.getCode(), ErrorCode.NOTEXISTS.getMsg());
}
return EnterpriseServiceResponse.success(EntityUtil.changeEntityByJSON(IndexDTO.class, index));
} }
} }
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