Commit 0820424b authored by diaoruifeng's avatar diaoruifeng

服务列表树功能优化

parent fb57cbe3
......@@ -19,6 +19,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.omg.PortableInterceptor.Interceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
......@@ -201,8 +202,8 @@ public class ApiBasicManagementController {
@ApiOperation("服务树层级")
@GetMapping("/apiBaseTreeOther")
public ResponseVO<List<OcpApiGroup>> apiBaseTreeOther(String apiGroupCompanyCode,String apiGroupPcode) {
List<OcpApiGroup> apiTreeGroupDtos = apiBasicManagementService.apiBaseTreeOther(apiGroupCompanyCode,apiGroupPcode);
public ResponseVO<List<OcpApiGroup>> apiBaseTreeOther(String apiGroupCompanyCode, String apiGroupPcode, Integer apiGroupPromotionType) {
List<OcpApiGroup> apiTreeGroupDtos = apiBasicManagementService.apiBaseTreeOther(apiGroupCompanyCode,apiGroupPcode,apiGroupPromotionType);
return ResponseVO.ok(apiTreeGroupDtos);
}
@ApiOperation("服务列表树最低级")
......
......@@ -12,7 +12,7 @@ public interface OcpApiGroupMapper extends BaseMapper<OcpApiGroup> {
List<OcpApiGroup> selectTreeList(String apiGroupCompanyCode);
List<OcpApiGroup> apiBaseTreeOther(String apiGroupCompanyCode, String apiGroupPcode);
List<OcpApiGroup> apiBaseTreeOther(String apiGroupCompanyCode, String apiGroupPcode,Integer apiGroupPromotionType);
List<OcpApiBase> selectByPcode(String code);
......
......@@ -27,7 +27,7 @@ public class ApiBaseDto implements Serializable {
private String apiGroupCompanyCode;
@ApiModelProperty("推广类型0:统建;1:自建")
private String apiPromotion;
private Integer apiPromotion;
@ApiModelProperty("注册时段-开始")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
......@@ -54,11 +54,11 @@ public class ApiBaseDto implements Serializable {
@ApiModelProperty("每页条数")
private Integer pageSize;
public String getApiPromotion() {
public Integer getApiPromotion() {
return apiPromotion;
}
public void setApiPromotion(String apiPromotion) {
public void setApiPromotion(Integer apiPromotion) {
this.apiPromotion = apiPromotion;
}
......
......@@ -71,7 +71,7 @@ public interface ApiBasicManagementService extends IService<OcpApiBase> {
* @param apiGroupPcode
* @return
*/
List<OcpApiGroup> apiBaseTreeOther(String apiGroupCompanyCode, String apiGroupPcode);
List<OcpApiGroup> apiBaseTreeOther(String apiGroupCompanyCode, String apiGroupPcode,Integer apiGroupPromotionType);
/**
* 根据分组code获取列表
......
......@@ -181,8 +181,8 @@ public class ApiBasicManagementServiceImpl extends ServiceImpl<ApiBasicManagemen
}
@Override
public List<OcpApiGroup> apiBaseTreeOther(String apiGroupCompanyCode, String apiGroupPcode) {
List<OcpApiGroup> ocpApiGroups = ocpApiGroupMapper.apiBaseTreeOther(apiGroupCompanyCode,apiGroupPcode);
public List<OcpApiGroup> apiBaseTreeOther(String apiGroupCompanyCode, String apiGroupPcode,Integer apiGroupPromotionType) {
List<OcpApiGroup> ocpApiGroups = ocpApiGroupMapper.apiBaseTreeOther(apiGroupCompanyCode,apiGroupPcode,apiGroupPromotionType);
return ocpApiGroups;
}
......@@ -194,7 +194,7 @@ public class ApiBasicManagementServiceImpl extends ServiceImpl<ApiBasicManagemen
return queryResponseResult;
}
apiGroupCode.add(apiBaseReq.getApiGroupCode());
setGroupIdValue(apiBaseReq.getApiGroupCompanyCode() ,apiBaseReq.getApiGroupCode());
setGroupIdValue(apiBaseReq.getApiGroupCompanyCode() ,apiBaseReq.getApiGroupCode(),apiBaseReq.getApiPromotion());
QueryWrapper qw = new QueryWrapper();
if (!StringUtils.isEmpty(apiBaseReq.getKeyword())) {
qw.like("api_name", apiBaseReq.getKeyword());
......@@ -244,11 +244,11 @@ public class ApiBasicManagementServiceImpl extends ServiceImpl<ApiBasicManagemen
* @param
* @param
*/
private void setGroupIdValue(String apiGroupCompanyCode ,String code) {
List<String> codes = getIdsByPIdPub(apiGroupCompanyCode,code);
private void setGroupIdValue(String apiGroupCompanyCode ,String code,Integer apiGroupPromotionType) {
List<String> codes = getIdsByPIdPub(apiGroupCompanyCode,code,apiGroupPromotionType);
if(codes.size()>0){
for (String cod : codes ){
setGroupIdValue(apiGroupCompanyCode,cod);
setGroupIdValue(apiGroupCompanyCode,cod,apiGroupPromotionType);
apiGroupCode.add(cod);
};
}
......@@ -260,8 +260,8 @@ public class ApiBasicManagementServiceImpl extends ServiceImpl<ApiBasicManagemen
* @param code
* @return
*/
public List<String> getIdsByPIdPub(String apiGroupCompanyCode,String code) {
List<OcpApiGroup> ocpApiGroups = ocpApiGroupMapper.apiBaseTreeOther(apiGroupCompanyCode, code);
public List<String> getIdsByPIdPub(String apiGroupCompanyCode,String code,Integer apiGroupPromotionType) {
List<OcpApiGroup> ocpApiGroups = ocpApiGroupMapper.apiBaseTreeOther(apiGroupCompanyCode, code,apiGroupPromotionType);
return ocpApiGroups.stream().map(OcpApiGroup::getApiGroupCode).collect(Collectors.toList());
}
......
......@@ -33,14 +33,20 @@
</select>
<select id="apiBaseTreeOther" resultType="com.pms.ocp.model.entity.OcpApiGroup">
select api_group_code,api_group_name,api_group_pcode,api_group_level from ocp_api_group where is_delete = 0
<if test="apiGroupCompanyCode!=null and apiGroupCompanyCode!=''">
and api_group_company_code = #{apiGroupCompanyCode}
select api_group_code,api_group_name,api_group_pcode,api_group_level from ocp_api_group where where is_delete = 0
<if test="apiGroupPcode == null">
and api_group_pcode is null
</if>
<if test="apiGroupPcode!=null and apiGroupPcode!=''">
and api_group_pcode = #{apiGroupPcode}
</if>
<if test="apiGroupCompanyCode!=null and apiGroupCompanyCode!=''">
and api_group_company_code =#{apiGroupCompanyCode}
</if>
<if test="apiGroupPromotionType!=null and apiGroupPromotionType!=''">
and api_group_promotion_type =#{apiGroupPromotionType}
</if>
</select>
<select id="selectByPcode" resultType="com.pms.ocp.model.entity.OcpApiGroup">
select api_group_code,api_group_name from ocp_api_group where 1 = 1
......
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