Commit 0820424b authored by diaoruifeng's avatar diaoruifeng

服务列表树功能优化

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