From 5daa9ebc4f689714502005143b3bd86deb3e60fb Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Thu, 23 Mar 2023 11:55:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=94=E7=94=A8=E5=92=8C=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../projectdeclared/controller/IrsController.java | 41 ++++++++++++++++ .../pmapi/projectdeclared/manage/IrsManage.java | 51 ++++++++++++++++++++ .../mapper/IrsApplicationMapper.java | 16 +++++++ .../mapper/IrsApplicationMapper.xml | 5 ++ .../projectdeclared/mapper/NdPiotTasksMapper.java | 17 +++++++ .../projectdeclared/mapper/NdPiotTasksMapper.xml | 5 ++ .../model/entity/IrsApplication.java | 45 ++++++++++++++++++ .../projectdeclared/model/entity/NdPiotTasks.java | 55 ++++++++++++++++++++++ .../projectdeclared/model/vo/IrsApplicationVO.java | 41 ++++++++++++++++ .../projectdeclared/model/vo/PiotTasksVO.java | 50 ++++++++++++++++++++ .../service/INdPiotTasksService.java | 16 +++++++ .../service/IrsApplicationService.java | 16 +++++++ .../service/impl/IrsApplicationServiceImpl.java | 21 +++++++++ .../service/impl/NdPiotTasksServiceImpl.java | 21 +++++++++ 14 files changed, 400 insertions(+) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/IrsController.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/IrsManage.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/IrsApplicationMapper.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/IrsApplicationMapper.xml create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/NdPiotTasksMapper.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/NdPiotTasksMapper.xml create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/entity/IrsApplication.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/entity/NdPiotTasks.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/vo/IrsApplicationVO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/vo/PiotTasksVO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/INdPiotTasksService.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/IrsApplicationService.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/impl/IrsApplicationServiceImpl.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/impl/NdPiotTasksServiceImpl.java diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/IrsController.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/IrsController.java new file mode 100644 index 0000000..b29ccc7 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/controller/IrsController.java @@ -0,0 +1,41 @@ +package com.ningdatech.pmapi.projectdeclared.controller; + +import com.ningdatech.pmapi.projectdeclared.manage.IrsManage; +import com.ningdatech.pmapi.projectdeclared.model.vo.IrsApplicationVO; +import com.ningdatech.pmapi.projectdeclared.model.vo.PiotTasksVO; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import java.util.List; + +/** + * @Classname IrsController + * @Description irs 一些下拉框信息 + * @Date 2023/3/13 9:53 + * @Author PoffyZhang + */ +@Slf4j +@Validated +@RestController +@RequestMapping("/api/v1/irs") +@Api(value = "irs", tags = "irs-信息查询") +@RequiredArgsConstructor +public class IrsController { + + private final IrsManage irsManage; + + @ApiOperation(value = "irs应用列表", notes = "irs应用列表") + @GetMapping("/application-list") + public List applicationList() { + return irsManage.applicationList(); + } + + @ApiOperation(value = "试点任务列表", notes = "试点任务列表") + @GetMapping("/piot-tasks") + public List piotTasks() { + return irsManage.listPiotTasks(); + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/IrsManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/IrsManage.java new file mode 100644 index 0000000..181647f --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/IrsManage.java @@ -0,0 +1,51 @@ +package com.ningdatech.pmapi.projectdeclared.manage; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollUtil; +import com.ningdatech.basic.util.CollUtils; +import com.ningdatech.pmapi.projectdeclared.model.entity.IrsApplication; +import com.ningdatech.pmapi.projectdeclared.model.entity.NdPiotTasks; +import com.ningdatech.pmapi.projectdeclared.model.vo.IrsApplicationVO; +import com.ningdatech.pmapi.projectdeclared.model.vo.PiotTasksVO; +import com.ningdatech.pmapi.projectdeclared.service.INdPiotTasksService; +import com.ningdatech.pmapi.projectdeclared.service.IrsApplicationService; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +/** + * @Classname IrsManage + * @Description + * @Date 2023/3/1 14:48 + * @Author PoffyZhang + */ +@Component +@Slf4j +@RequiredArgsConstructor +public class IrsManage { + + private final IrsApplicationService irsApplicationService; + + private final INdPiotTasksService piotTasksService; + + + public List applicationList() { + List list = irsApplicationService.list(); + if(CollUtil.isEmpty(list)){ + return Collections.emptyList(); + } + return CollUtils.convert(list,app -> BeanUtil.copyProperties(app,IrsApplicationVO.class)); + } + + public List listPiotTasks() { + List list = piotTasksService.list(); + if(CollUtil.isEmpty(list)){ + return Collections.emptyList(); + } + return CollUtils.convert(list,task -> BeanUtil.copyProperties(task,PiotTasksVO.class)); + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/IrsApplicationMapper.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/IrsApplicationMapper.java new file mode 100644 index 0000000..84203d2 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/IrsApplicationMapper.java @@ -0,0 +1,16 @@ +package com.ningdatech.pmapi.projectdeclared.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ningdatech.pmapi.projectdeclared.model.entity.IrsApplication; + +/** + *

+ * Mapper 接口 + *

+ * + * @author zpf + * @since 2023-02-05 + */ +public interface IrsApplicationMapper extends BaseMapper { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/IrsApplicationMapper.xml b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/IrsApplicationMapper.xml new file mode 100644 index 0000000..c68d8be --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/IrsApplicationMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/NdPiotTasksMapper.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/NdPiotTasksMapper.java new file mode 100644 index 0000000..7a1e2a0 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/NdPiotTasksMapper.java @@ -0,0 +1,17 @@ +package com.ningdatech.pmapi.projectdeclared.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ningdatech.pmapi.projectdeclared.model.entity.IrsApplication; +import com.ningdatech.pmapi.projectdeclared.model.entity.NdPiotTasks; + +/** + *

+ * Mapper 接口 + *

+ * + * @author zpf + * @since 2023-02-05 + */ +public interface NdPiotTasksMapper extends BaseMapper { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/NdPiotTasksMapper.xml b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/NdPiotTasksMapper.xml new file mode 100644 index 0000000..7740164 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/mapper/NdPiotTasksMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/entity/IrsApplication.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/entity/IrsApplication.java new file mode 100644 index 0000000..c939b2f --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/entity/IrsApplication.java @@ -0,0 +1,45 @@ +package com.ningdatech.pmapi.projectdeclared.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.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + *

+ * irs项目 + *

+ * + * @author zpf + * @since 2023-03-06 + */ +@TableName("irs_application") +@ApiModel(value = "irs_application对象", description = "irs项目对象") +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class IrsApplication implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("id") + @TableId(type = IdType.AUTO) + private Long id; + + @ApiModelProperty("应用名称") + private String applicationName; + + @ApiModelProperty("应用编码") + private String applicationCode; + + private LocalDateTime createOn; + private LocalDateTime updateOn; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/entity/NdPiotTasks.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/entity/NdPiotTasks.java new file mode 100644 index 0000000..bea2cad --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/entity/NdPiotTasks.java @@ -0,0 +1,55 @@ +package com.ningdatech.pmapi.projectdeclared.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.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + *

+ * irs任务对象 + *

+ * + * @author zpf + * @since 2023-03-06 + */ +@TableName("nd_piot_tasks") +@ApiModel(value = "irs_piot_tasks对象", description = "irs任务对象") +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class NdPiotTasks implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("id") + @TableId(type = IdType.AUTO) + private Long id; + + @ApiModelProperty("试点任务名称") + private String taskName; + + @ApiModelProperty("试点任务编号") + private String taskCode; + + @ApiModelProperty("所属重大应用名称") + private String importantTaskName; + + @ApiModelProperty("所属重大应用编号") + private String importantTaskCode; + + @ApiModelProperty("所属子场景应用名称") + private String subSceneApplicationName; + + private LocalDateTime createOn; + private LocalDateTime updateOn; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/vo/IrsApplicationVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/vo/IrsApplicationVO.java new file mode 100644 index 0000000..6561bba --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/vo/IrsApplicationVO.java @@ -0,0 +1,41 @@ +package com.ningdatech.pmapi.projectdeclared.model.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + *

+ * irs项目 + *

+ * + * @author zpf + * @since 2023-03-06 + */ +@ApiModel(value = "irs_application对象", description = "irs项目对象") +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class IrsApplicationVO implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("id") + private Long id; + + @ApiModelProperty("应用名称") + private String applicationName; + + @ApiModelProperty("应用编码") + private String applicationCode; + + private LocalDateTime createOn; + private LocalDateTime updateOn; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/vo/PiotTasksVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/vo/PiotTasksVO.java new file mode 100644 index 0000000..e002f79 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/vo/PiotTasksVO.java @@ -0,0 +1,50 @@ +package com.ningdatech.pmapi.projectdeclared.model.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + *

+ * irs任务对象 + *

+ * + * @author zpf + * @since 2023-03-06 + */ +@ApiModel(value = "irs_piot_tasks对象", description = "irs任务对象") +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class PiotTasksVO implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("id") + private Long id; + + @ApiModelProperty("试点任务名称") + private String taskName; + + @ApiModelProperty("试点任务编号") + private String taskCode; + + @ApiModelProperty("所属重大应用名称") + private String importantTaskName; + + @ApiModelProperty("所属重大应用编号") + private String importantTaskCode; + + @ApiModelProperty("所属子场景应用名称") + private String subSceneApplicationName; + + private LocalDateTime createOn; + private LocalDateTime updateOn; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/INdPiotTasksService.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/INdPiotTasksService.java new file mode 100644 index 0000000..7aa6776 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/INdPiotTasksService.java @@ -0,0 +1,16 @@ +package com.ningdatech.pmapi.projectdeclared.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ningdatech.pmapi.projectdeclared.model.entity.NdPiotTasks; + +/** + *

+ * 服务类 + *

+ * + * @author zpf + * @since 2023-02-05 + */ +public interface INdPiotTasksService extends IService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/IrsApplicationService.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/IrsApplicationService.java new file mode 100644 index 0000000..0b64011 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/IrsApplicationService.java @@ -0,0 +1,16 @@ +package com.ningdatech.pmapi.projectdeclared.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ningdatech.pmapi.projectdeclared.model.entity.IrsApplication; + +/** + *

+ * 服务类 + *

+ * + * @author zpf + * @since 2023-02-05 + */ +public interface IrsApplicationService extends IService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/impl/IrsApplicationServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/impl/IrsApplicationServiceImpl.java new file mode 100644 index 0000000..01f5517 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/impl/IrsApplicationServiceImpl.java @@ -0,0 +1,21 @@ +package com.ningdatech.pmapi.projectdeclared.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ningdatech.pmapi.projectdeclared.mapper.IrsApplicationMapper; +import com.ningdatech.pmapi.projectdeclared.model.entity.IrsApplication; +import com.ningdatech.pmapi.projectdeclared.service.IrsApplicationService; +import org.springframework.stereotype.Service; + +/** + *

+ * 服务实现类 + *

+ * + * @author zpf + * @since 2023-02-05 + */ +@Service +public class IrsApplicationServiceImpl extends ServiceImpl + implements IrsApplicationService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/impl/NdPiotTasksServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/impl/NdPiotTasksServiceImpl.java new file mode 100644 index 0000000..30cdedb --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/service/impl/NdPiotTasksServiceImpl.java @@ -0,0 +1,21 @@ +package com.ningdatech.pmapi.projectdeclared.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ningdatech.pmapi.projectdeclared.mapper.NdPiotTasksMapper; +import com.ningdatech.pmapi.projectdeclared.model.entity.NdPiotTasks; +import com.ningdatech.pmapi.projectdeclared.service.INdPiotTasksService; +import org.springframework.stereotype.Service; + +/** + *

+ * 服务实现类 + *

+ * + * @author zpf + * @since 2023-02-05 + */ +@Service +public class NdPiotTasksServiceImpl extends ServiceImpl + implements INdPiotTasksService { + +}