@@ -1,8 +1,7 @@ | |||||
package com.ningdatech.pmapi.gov.controller; | package com.ningdatech.pmapi.gov.controller; | ||||
import com.ningdatech.pmapi.gov.manage.BelongOrgManage; | |||||
import com.ningdatech.pmapi.gov.model.vo.GovBusinessStripVO; | |||||
import com.ningdatech.pmapi.gov.manage.GovProjectCollectionManage; | |||||
import com.ningdatech.pmapi.gov.model.vo.GovProjectDictionaryVO; | |||||
import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
import lombok.RequiredArgsConstructor; | import lombok.RequiredArgsConstructor; | ||||
@@ -12,7 +11,6 @@ import org.springframework.web.bind.annotation.GetMapping; | |||||
import org.springframework.web.bind.annotation.RequestMapping; | import org.springframework.web.bind.annotation.RequestMapping; | ||||
import org.springframework.web.bind.annotation.RequestParam; | import org.springframework.web.bind.annotation.RequestParam; | ||||
import org.springframework.web.bind.annotation.RestController; | import org.springframework.web.bind.annotation.RestController; | ||||
import java.util.List; | import java.util.List; | ||||
/** | /** | ||||
@@ -31,12 +29,12 @@ import java.util.List; | |||||
@RequestMapping("/api/v1/gov-project-collection") | @RequestMapping("/api/v1/gov-project-collection") | ||||
public class GovProjectCollectionController { | public class GovProjectCollectionController { | ||||
private final BelongOrgManage belongOrgManage; | |||||
private final GovProjectCollectionManage collectionManage; | |||||
@GetMapping("/dictionary") | @GetMapping("/dictionary") | ||||
@ApiOperation("获取条线列表") | |||||
public List<GovBusinessStripVO> getGovBusinessStripList(@RequestParam(value = "type", required = false) String type) { | |||||
return belongOrgManage.getGovBusinessStripList(type); | |||||
@ApiOperation("字典") | |||||
public List<GovProjectDictionaryVO> dictionary(@RequestParam(value = "type", required = false) String type) { | |||||
return collectionManage.dictionary(type); | |||||
} | } | ||||
@GetMapping("/business-strip/expert/analysis") | @GetMapping("/business-strip/expert/analysis") | ||||
@@ -1,8 +1,19 @@ | |||||
package com.ningdatech.pmapi.gov.manage; | package com.ningdatech.pmapi.gov.manage; | ||||
import cn.hutool.core.bean.BeanUtil; | |||||
import cn.hutool.core.collection.CollUtil; | |||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||||
import com.ningdatech.pmapi.gov.model.entity.GovProjectDictionary; | |||||
import com.ningdatech.pmapi.gov.model.vo.GovProjectDictionaryVO; | |||||
import com.ningdatech.pmapi.gov.service.IGovProjectDictionaryService; | |||||
import lombok.RequiredArgsConstructor; | import lombok.RequiredArgsConstructor; | ||||
import org.apache.commons.lang3.StringUtils; | |||||
import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
import java.util.Collections; | |||||
import java.util.List; | |||||
import java.util.stream.Collectors; | |||||
/** | /** | ||||
* @author zpf | * @author zpf | ||||
* @date 2023/8/21 下午2:27 | * @date 2023/8/21 下午2:27 | ||||
@@ -12,4 +23,18 @@ import org.springframework.stereotype.Component; | |||||
@RequiredArgsConstructor | @RequiredArgsConstructor | ||||
public class GovProjectCollectionManage { | public class GovProjectCollectionManage { | ||||
private final IGovProjectDictionaryService dictionaryService; | |||||
public List<GovProjectDictionaryVO> dictionary(String type) { | |||||
List<GovProjectDictionary> dictionaries = dictionaryService.list(Wrappers.lambdaQuery(GovProjectDictionary.class) | |||||
.eq(StringUtils.isNotBlank(type), GovProjectDictionary::getType, type)); | |||||
if(CollUtil.isEmpty(dictionaries)){ | |||||
return Collections.emptyList(); | |||||
} | |||||
return dictionaries.stream().map(d -> BeanUtil.copyProperties(d,GovProjectDictionaryVO.class)) | |||||
.collect(Collectors.toList()); | |||||
} | |||||
} | } |
@@ -0,0 +1,16 @@ | |||||
package com.ningdatech.pmapi.gov.mapper; | |||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||||
import com.ningdatech.pmapi.gov.model.entity.GovProjectDictionary; | |||||
/** | |||||
* <p> | |||||
* Mapper 接口 | |||||
* </p> | |||||
* | |||||
* @author zpf | |||||
* @since 2023-08-23 | |||||
*/ | |||||
public interface GovProjectDictionaryMapper extends BaseMapper<GovProjectDictionary> { | |||||
} |
@@ -0,0 +1,46 @@ | |||||
package com.ningdatech.pmapi.gov.model.entity; | |||||
import com.baomidou.mybatisplus.annotation.IdType; | |||||
import com.baomidou.mybatisplus.annotation.TableId; | |||||
import com.baomidou.mybatisplus.annotation.TableName; | |||||
import io.swagger.annotations.ApiModel; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import java.io.Serializable; | |||||
import java.time.LocalDateTime; | |||||
/** | |||||
* <p> | |||||
* 项目字典表 | |||||
* </p> | |||||
* | |||||
* @author ZPF | |||||
* @since 2023-08-02 | |||||
*/ | |||||
@Data | |||||
@TableName("gov_project_dictionary") | |||||
@ApiModel(value = "GovProjectDictionary对象", description = "项目字典表") | |||||
public class GovProjectDictionary implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
@ApiModelProperty("主键") | |||||
@TableId(type = IdType.AUTO) | |||||
private Long id; | |||||
private String createBy; | |||||
private LocalDateTime createOn; | |||||
@ApiModelProperty("类型") | |||||
private String type; | |||||
@ApiModelProperty("值") | |||||
private String value; | |||||
@ApiModelProperty("展示值") | |||||
private String label; | |||||
@ApiModelProperty("备注") | |||||
private String remark; | |||||
} |
@@ -0,0 +1,41 @@ | |||||
package com.ningdatech.pmapi.gov.model.vo; | |||||
import io.swagger.annotations.ApiModel; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.Data; | |||||
import java.io.Serializable; | |||||
import java.time.LocalDateTime; | |||||
/** | |||||
* <p> | |||||
* 项目字典表 | |||||
* </p> | |||||
* | |||||
* @author ZPF | |||||
* @since 2023-08-02 | |||||
*/ | |||||
@Data | |||||
@ApiModel(value = "GovProjectDictionaryVO", description = "项目字典表") | |||||
public class GovProjectDictionaryVO implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
@ApiModelProperty("主键") | |||||
private Long id; | |||||
private String createBy; | |||||
private LocalDateTime createOn; | |||||
@ApiModelProperty("类型") | |||||
private String type; | |||||
@ApiModelProperty("值") | |||||
private String value; | |||||
@ApiModelProperty("展示值") | |||||
private String label; | |||||
@ApiModelProperty("备注") | |||||
private String remark; | |||||
} |
@@ -0,0 +1,16 @@ | |||||
package com.ningdatech.pmapi.gov.service; | |||||
import com.baomidou.mybatisplus.extension.service.IService; | |||||
import com.ningdatech.pmapi.gov.model.entity.GovProjectDictionary; | |||||
/** | |||||
* <p> | |||||
* 服务类 | |||||
* </p> | |||||
* | |||||
* @author zpf | |||||
* @since 2023-08-23 | |||||
*/ | |||||
public interface IGovProjectDictionaryService extends IService<GovProjectDictionary> { | |||||
} |
@@ -0,0 +1,21 @@ | |||||
package com.ningdatech.pmapi.gov.service.impl; | |||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||||
import com.ningdatech.pmapi.gov.mapper.GovProjectDictionaryMapper; | |||||
import com.ningdatech.pmapi.gov.model.entity.GovProjectDictionary; | |||||
import com.ningdatech.pmapi.gov.service.IGovProjectDictionaryService; | |||||
import org.springframework.stereotype.Service; | |||||
/** | |||||
* <p> | |||||
* 服务实现类 | |||||
* </p> | |||||
* | |||||
* @author zpf | |||||
* @since 2023-08-23 | |||||
*/ | |||||
@Service | |||||
public class GovProjectDictionaryServiceImpl extends | |||||
ServiceImpl<GovProjectDictionaryMapper, GovProjectDictionary> implements IGovProjectDictionaryService { | |||||
} |