Commit 18039b40 by zhiwj

Merge branch 'developer' into 'master'

Developer

See merge request !36
parents 1ef1f75e e8d0f8a6
...@@ -95,5 +95,5 @@ public interface DataExplainApiService { ...@@ -95,5 +95,5 @@ public interface DataExplainApiService {
* @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<DataExplainDTO>> listByModule(String moduleId); ServiceResponse<DataExplainDTO> listByModule(String moduleId);
} }
...@@ -15,6 +15,7 @@ import com.gic.commons.util.EntityUtil; ...@@ -15,6 +15,7 @@ import com.gic.commons.util.EntityUtil;
import com.gic.commons.util.PageHelperUtils; import com.gic.commons.util.PageHelperUtils;
import com.gic.enterprise.error.ErrorCode; import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.response.EnterpriseServiceResponse; import com.gic.enterprise.response.EnterpriseServiceResponse;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -119,10 +120,14 @@ public class DataExplainApiServiceImpl implements DataExplainApiService { ...@@ -119,10 +120,14 @@ public class DataExplainApiServiceImpl implements DataExplainApiService {
} }
@Override @Override
public ServiceResponse<List<DataExplainDTO>> listByModule(String moduleId) { public ServiceResponse<DataExplainDTO> listByModule(String moduleId) {
DataExplainQO dataExplainQO = new DataExplainQO(); DataExplainQO dataExplainQO = new DataExplainQO();
dataExplainQO.setModuleId(moduleId); dataExplainQO.setModuleId(moduleId);
List<TabDataExplain> dataExplainList = dataExplainService.listAllDataExplain(dataExplainQO); List<TabDataExplain> dataExplainList = dataExplainService.listAllDataExplain(dataExplainQO);
return EnterpriseServiceResponse.success(EntityUtil.changeEntityListByJSON(DataExplainDTO.class, dataExplainList)); if (CollectionUtils.isNotEmpty(dataExplainList)) {
return EnterpriseServiceResponse.success(EntityUtil.changeEntityByJSON(DataExplainDTO.class, dataExplainList.get(0)));
} else {
return EnterpriseServiceResponse.success();
}
} }
} }
...@@ -234,6 +234,10 @@ ...@@ -234,6 +234,10 @@
<select id="getIndexDescByIndexCode" resultMap="BaseResultMap"> <select id="getIndexDescByIndexCode" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from tab_index_desc where status = 1 and module_id = #{moduleId} and index_code = #{indexCode} and index_group_name = #{indexGroupName} limit 1 from tab_index_desc where status = 1 and module_id = #{moduleId} and index_code = #{indexCode}
<if test="indexGroupName != null and indexGroupName != '' ">
and index_group_name = #{indexGroupName}
</if>
limit 1
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -75,7 +75,7 @@ public class IndexDescController { ...@@ -75,7 +75,7 @@ public class IndexDescController {
@RequestMapping("/get-data-explain") @RequestMapping("/get-data-explain")
public RestResponse getDataExplain(String moduleId) { public RestResponse getDataExplain(String moduleId) {
ServiceResponse<List<DataExplainDTO>> serviceResponse = dataExplainApiService.listByModule(moduleId); ServiceResponse<DataExplainDTO> serviceResponse = dataExplainApiService.listByModule(moduleId);
return ResultControllerUtils.commonResult(serviceResponse); return ResultControllerUtils.commonResult(serviceResponse);
} }
} }
\ No newline at end of file
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