Browse Source

推送遂昌县项目 代码debug

tags/24080901
PoffyZhang 1 year ago
parent
commit
18e3100ad6
7 changed files with 171 additions and 8 deletions
  1. +6
    -8
      pmapi/src/main/java/com/ningdatech/pmapi/gov/controller/GovProjectCollectionController.java
  2. +25
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/gov/manage/GovProjectCollectionManage.java
  3. +16
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/gov/mapper/GovProjectDictionaryMapper.java
  4. +46
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/gov/model/entity/GovProjectDictionary.java
  5. +41
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/gov/model/vo/GovProjectDictionaryVO.java
  6. +16
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/gov/service/IGovProjectDictionaryService.java
  7. +21
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/gov/service/impl/GovProjectDictionaryServiceImpl.java

+ 6
- 8
pmapi/src/main/java/com/ningdatech/pmapi/gov/controller/GovProjectCollectionController.java View File

@@ -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")


+ 25
- 0
pmapi/src/main/java/com/ningdatech/pmapi/gov/manage/GovProjectCollectionManage.java View File

@@ -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());
}
} }

+ 16
- 0
pmapi/src/main/java/com/ningdatech/pmapi/gov/mapper/GovProjectDictionaryMapper.java View File

@@ -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> {

}

+ 46
- 0
pmapi/src/main/java/com/ningdatech/pmapi/gov/model/entity/GovProjectDictionary.java View File

@@ -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;
}

+ 41
- 0
pmapi/src/main/java/com/ningdatech/pmapi/gov/model/vo/GovProjectDictionaryVO.java View File

@@ -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;
}

+ 16
- 0
pmapi/src/main/java/com/ningdatech/pmapi/gov/service/IGovProjectDictionaryService.java View File

@@ -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> {

}

+ 21
- 0
pmapi/src/main/java/com/ningdatech/pmapi/gov/service/impl/GovProjectDictionaryServiceImpl.java View File

@@ -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 {

}

Loading…
Cancel
Save