diff --git a/process-api/src/main/java/com/njcn/process/enums/ProcessResponseEnum.java b/process-api/src/main/java/com/njcn/process/enums/ProcessResponseEnum.java index bba21f7bc..c9c6d818f 100644 --- a/process-api/src/main/java/com/njcn/process/enums/ProcessResponseEnum.java +++ b/process-api/src/main/java/com/njcn/process/enums/ProcessResponseEnum.java @@ -19,6 +19,8 @@ public enum ProcessResponseEnum { UPLOAD_FILE_ERROR("A00551","上传文件服务器错误,请检查数据"), ARCHIVE_ERROR("A00552","不满足归档调节,操作失败!"), PROCESS_ERROR("A00553","当前流程未审核通过,操作失败!"), + DOWNLOAD_FILE_ERROR("A00554","下载文件URL不存在,请检查数据"), + ; private final String code; diff --git a/process-boot/pom.xml b/process-boot/pom.xml index 7d74908d6..8e86b5678 100644 --- a/process-boot/pom.xml +++ b/process-boot/pom.xml @@ -91,7 +91,12 @@ - + + com.github.jeffreyning + mybatisplus-plus + 1.5.1-RELEASE + compile + diff --git a/process-boot/src/main/java/com/njcn/process/ProcessApplication.java b/process-boot/src/main/java/com/njcn/process/ProcessApplication.java index 494de5864..77b88204b 100644 --- a/process-boot/src/main/java/com/njcn/process/ProcessApplication.java +++ b/process-boot/src/main/java/com/njcn/process/ProcessApplication.java @@ -1,5 +1,6 @@ package com.njcn.process; +import com.github.jeffreyning.mybatisplus.conf.EnableMPP; import lombok.extern.slf4j.Slf4j; import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; @@ -16,6 +17,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients; @MapperScan("com.njcn.**.mapper") @EnableFeignClients(basePackages = "com.njcn") @SpringBootApplication(scanBasePackages = "com.njcn") +@EnableMPP public class ProcessApplication { public static void main(String[] args) { diff --git a/process-boot/src/main/java/com/njcn/process/controller/RGeneralSurveyPlanController.java b/process-boot/src/main/java/com/njcn/process/controller/RGeneralSurveyPlanController.java new file mode 100644 index 000000000..59b3ef577 --- /dev/null +++ b/process-boot/src/main/java/com/njcn/process/controller/RGeneralSurveyPlanController.java @@ -0,0 +1,124 @@ +package com.njcn.process.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.njcn.common.pojo.annotation.OperateInfo; +import com.njcn.common.pojo.constant.OperateType; +import com.njcn.common.pojo.enums.common.LogEnum; +import com.njcn.common.pojo.enums.response.CommonResponseEnum; +import com.njcn.common.pojo.response.HttpResult; +import com.njcn.common.utils.HttpResultUtil; +import com.njcn.process.pojo.param.RGeneralSurveyPlanAddParm; +import com.njcn.process.pojo.param.RGeneralSurveyPlanQueryParm; +import com.njcn.process.pojo.param.RGeneralSurveyPlandetailQueryParm; +import com.njcn.process.pojo.param.SurveyResultUploadParam; +import com.njcn.process.pojo.vo.RGeneralSurveyPlanVO; +import com.njcn.process.service.RGeneralSurveyPlanDetailService; +import com.njcn.process.service.RGeneralSurveyPlanPOService; +import com.njcn.web.controller.BaseController; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * Description: + * 接口文档访问地址:http://serverIP:port/swagger-ui.html + * Date: 2022/11/11 14:50【需求编号】 + * + * @author clam + * @version V1.0.0 + */ + +@Slf4j +@RestController +@RequestMapping("/rGeneralSurveyPlan") +@Api(tags = "普测计划管理") +@AllArgsConstructor +public class RGeneralSurveyPlanController extends BaseController { + + private final RGeneralSurveyPlanPOService rGeneralSurveyPlanPOService; + + private @Autowired + RGeneralSurveyPlanDetailService rGeneralSurveyPlanDetailService; + /** + * 查询所有数据 + * @author qijian + * @date 2022/11/11 + */ + @OperateInfo(info = LogEnum.BUSINESS_COMMON) + @PostMapping("/addPlan") + @ApiOperation("新增普测计划") + @ApiImplicitParam(name = "rGeneralSurveyPlanAddParm", value = "新增普测计划参数", required = true) + public HttpResult addPlan(@RequestBody RGeneralSurveyPlanAddParm rGeneralSurveyPlanAddParm){ + String methodDescribe = getMethodDescribe("addPlan"); + + Boolean addFlag = rGeneralSurveyPlanPOService.addPlan(rGeneralSurveyPlanAddParm); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, addFlag, methodDescribe); + } + +// @OperateInfo(info = LogEnum.BUSINESS_COMMON) +// @PostMapping("/updatePlan") +// @ApiOperation("新增普测计划") +// @ApiImplicitParam(name = "rGeneralSurveyPlanAddParm", value = "新增普测计划参数", required = true) +// public HttpResult updatePlan(@RequestBody RGeneralSurveyPlanAddParm rGeneralSurveyPlanAddParm){ +// String methodDescribe = getMethodDescribe("addPlan"); +// +//// Boolean addFlag = rGeneralSurveyPlanPOService.updatePlan(rGeneralSurveyPlanAddParm); +// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, addFlag, methodDescribe); +// } + + @OperateInfo(info = LogEnum.BUSINESS_COMMON) + @PostMapping("/queryPlan") + @ApiOperation("查询普测计划") + @ApiImplicitParam(name = "rGeneralSurveyPlanQueryParm", value = "普测计划查询参数", required = true) + public HttpResult> queryPlan(@Validated @RequestBody RGeneralSurveyPlanQueryParm rGeneralSurveyPlanQueryParm){ + String methodDescribe = getMethodDescribe("queryPlan"); + + IPage rGeneralSurveyPlanVOS = rGeneralSurveyPlanPOService.query (rGeneralSurveyPlanQueryParm); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rGeneralSurveyPlanVOS, methodDescribe); + } + + @OperateInfo(info = LogEnum.BUSINESS_COMMON) + @PostMapping("/queryPlandetail") + @ApiOperation("根据planNO查询普测计划详情") + @ApiImplicitParam(name = "rGeneralSurveyPlandetailQueryParm", value = "普测计划详情查询参数", required = true) + public HttpResult> queryPlandetail(@Validated @RequestBody RGeneralSurveyPlandetailQueryParm rGeneralSurveyPlandetailQueryParm){ + String methodDescribe = getMethodDescribe("queryPlandetail"); + + IPage rGeneralSurveyPlanDetailVOIPage = rGeneralSurveyPlanDetailService.queryPlandetail (rGeneralSurveyPlandetailQueryParm); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rGeneralSurveyPlanDetailVOIPage, methodDescribe); + } + + @OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType= OperateType.UPLOAD) + @PostMapping("/surveyResultUpload") + @ApiOperation("上传普测结果报告") +// @ApiImplicitParam(name = "surveyResultUploadParam", value = "实体参数", required = true) + public HttpResult surveyResultUpload( @Validated SurveyResultUploadParam surveyResultUploadParam){ + String methodDescribe = getMethodDescribe("surveyResultUpload"); + boolean res = rGeneralSurveyPlanPOService.surveyResultUpload(surveyResultUploadParam); + if(res){ + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); + }else { + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe); + } + } + + @OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType= OperateType.DOWNLOAD) + @PostMapping("/surveyResultDownload") + @ApiOperation("下载普测结果报告") + @ApiImplicitParam(name = "planNo", value = "计划号", required = true) + public HttpResult> surveyResultDownload(@RequestParam("planNo") String planNo ){ + String methodDescribe = getMethodDescribe("surveyResultDownload"); + List downloadUrls = rGeneralSurveyPlanPOService.surveyResultDownload(planNo); + + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, downloadUrls, methodDescribe); + + } + +} diff --git a/process-boot/src/main/java/com/njcn/process/mapper/RGeneralSurveyPlanDetailMapper.java b/process-boot/src/main/java/com/njcn/process/mapper/RGeneralSurveyPlanDetailMapper.java new file mode 100644 index 000000000..2e8137184 --- /dev/null +++ b/process-boot/src/main/java/com/njcn/process/mapper/RGeneralSurveyPlanDetailMapper.java @@ -0,0 +1,16 @@ +package com.njcn.process.mapper; + +import com.github.jeffreyning.mybatisplus.base.MppBaseMapper; +import com.njcn.process.pojo.po.RGeneralSurveyPlanDetail; + +/** + * + * Description: + * 接口文档访问地址:http://serverIP:port/swagger-ui.html + * Date: 2022/11/11 11:28【需求编号】 + * + * @author clam + * @version V1.0.0 + */ +public interface RGeneralSurveyPlanDetailMapper extends MppBaseMapper { +} \ No newline at end of file diff --git a/process-boot/src/main/java/com/njcn/process/mapper/RGeneralSurveyPlanPOMapper.java b/process-boot/src/main/java/com/njcn/process/mapper/RGeneralSurveyPlanPOMapper.java new file mode 100644 index 000000000..d893f9a4f --- /dev/null +++ b/process-boot/src/main/java/com/njcn/process/mapper/RGeneralSurveyPlanPOMapper.java @@ -0,0 +1,16 @@ +package com.njcn.process.mapper; + +import com.github.jeffreyning.mybatisplus.base.MppBaseMapper; +import com.njcn.process.pojo.po.RGeneralSurveyPlanPO; + +/** + * + * Description: + * 接口文档访问地址:http://serverIP:port/swagger-ui.html + * Date: 2022/11/11 11:24【需求编号】 + * + * @author clam + * @version V1.0.0 + */ +public interface RGeneralSurveyPlanPOMapper extends MppBaseMapper { +} \ No newline at end of file diff --git a/process-boot/src/main/java/com/njcn/process/mapper/mapping/RGeneralSurveyPlanDetailMapper.xml b/process-boot/src/main/java/com/njcn/process/mapper/mapping/RGeneralSurveyPlanDetailMapper.xml new file mode 100644 index 000000000..ed402a7ab --- /dev/null +++ b/process-boot/src/main/java/com/njcn/process/mapper/mapping/RGeneralSurveyPlanDetailMapper.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + plan_no, general_survey_start_time, general_survey_end_time, general_survey_time, + general_survey_leader, sub_id, sub_name, voltage_level, busbar_id, busbar_name, measurement_point_id, + is_problem + + \ No newline at end of file diff --git a/process-boot/src/main/java/com/njcn/process/mapper/mapping/RGeneralSurveyPlanPOMapper.xml b/process-boot/src/main/java/com/njcn/process/mapper/mapping/RGeneralSurveyPlanPOMapper.xml new file mode 100644 index 000000000..9b366b75f --- /dev/null +++ b/process-boot/src/main/java/com/njcn/process/mapper/mapping/RGeneralSurveyPlanPOMapper.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + org_no, plan_no, plan_name, plan_create_time, plan_start_time, plan_end_time, plan_complate_time, + leader, `status`, description, is_file_upload, file_count, file_path, upload_time + + \ No newline at end of file diff --git a/process-boot/src/main/java/com/njcn/process/pojo/param/RGeneralSurveyPlanAddParm.java b/process-boot/src/main/java/com/njcn/process/pojo/param/RGeneralSurveyPlanAddParm.java new file mode 100644 index 000000000..96bba923c --- /dev/null +++ b/process-boot/src/main/java/com/njcn/process/pojo/param/RGeneralSurveyPlanAddParm.java @@ -0,0 +1,97 @@ +package com.njcn.process.pojo.param; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +/** + * Description: + * 接口文档访问地址:http://serverIP:port/swagger-ui.html + * Date: 2022/11/11 15:20【需求编号】 + * + * @author clam + * @version V1.0.0 + */ +@ApiModel(value="com-njcn-process-pojo-param-RGeneralSurveyPlanAddParm") +@Data +public class RGeneralSurveyPlanAddParm { + + @ApiModelProperty(value="单位ID") + private String orgNo; + + @ApiModelProperty(value="普测计划编号") + private String planNo; + + @ApiModelProperty(value="普测计划名称") + private String planName; + + @ApiModelProperty(value="计划开始时间") + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") + private Date planStartTime; + + @ApiModelProperty(value="计划结束时间") + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") + private Date planEndTime; + + @ApiModelProperty(value="计划负责人") + private String leader; + @ApiModelProperty(value="详细情况") + private String description; + + @ApiModelProperty(value="计划详细情况母线相关") + private List rGeneralSurveyPlanDetailAddParm; + @Data + @ApiModel(value="计划详细情况母线相关") + public static class RGeneralSurveyPlanDetailAddParm{ + + @ApiModelProperty(value="变电站ID") + private String subId; + + @ApiModelProperty(value="变电站名称") + private String subName; + + @ApiModelProperty(value="变电站电压等级") + private String voltageLevel; + + @ApiModelProperty(value="母线ID") + private String busbarId; + + @ApiModelProperty(value="母线名称") + private String busbarName; + + @ApiModelProperty(value="离线监测点id") + private String measurementPointId; + /** + * 测试开始时间 + */ + @ApiModelProperty(value="测试开始时间") + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") + private Date generalSurveyStartTime; + + /** + * 测试结束时间 + */ + @ApiModelProperty(value="测试结束时间") + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") + private Date generalSurveyEndTime; + + /** + * 测试日期 + */ + @ApiModelProperty(value="测试日期") + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") + private Date generalSurveyTime; + + /** + * 测试负责人 + */ + @ApiModelProperty(value="测试负责人") + private String generalSurveyLeader; + + } + +} diff --git a/process-boot/src/main/java/com/njcn/process/pojo/param/RGeneralSurveyPlanQueryParm.java b/process-boot/src/main/java/com/njcn/process/pojo/param/RGeneralSurveyPlanQueryParm.java new file mode 100644 index 000000000..629fe10bc --- /dev/null +++ b/process-boot/src/main/java/com/njcn/process/pojo/param/RGeneralSurveyPlanQueryParm.java @@ -0,0 +1,47 @@ +package com.njcn.process.pojo.param; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotNull; +import java.util.Date; + +/** + * Description: + * 接口文档访问地址:http://serverIP:port/swagger-ui.html + * Date: 2022/11/11 15:20【需求编号】 + * + * @author clam + * @version V1.0.0 + */ +@ApiModel(value="com-njcn-process-pojo-param-RGeneralSurveyPlanAddParm") +@Data +public class RGeneralSurveyPlanQueryParm { + + @NotNull(message="当前页不能为空!") + @Min(value = 1, message = "当前页不能为0") + @ApiModelProperty(value = "当前页",name = "currentPage",dataType ="Integer",required = true) + private Integer currentPage; + /**显示条数*/ + @NotNull(message="显示条数不能为空!") + @ApiModelProperty(value = "显示条数",name = "pageSize",dataType ="Integer",required = true) + private Integer pageSize; + + @ApiModelProperty(value="单位ID") + private String orgNo; + + @ApiModelProperty(value="计划开始时间") + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") + private Date planStartTime; + + @ApiModelProperty(value="计划状态(0:新建 1:待审核 2:审核未通过 3:已发布 4:已完成)") + private String status; + + @ApiModelProperty(value="文件是否上传(0:否 1:是)") + private String isFileUpload; + + +} diff --git a/process-boot/src/main/java/com/njcn/process/pojo/param/RGeneralSurveyPlandetailQueryParm.java b/process-boot/src/main/java/com/njcn/process/pojo/param/RGeneralSurveyPlandetailQueryParm.java new file mode 100644 index 000000000..ab1a29506 --- /dev/null +++ b/process-boot/src/main/java/com/njcn/process/pojo/param/RGeneralSurveyPlandetailQueryParm.java @@ -0,0 +1,36 @@ +package com.njcn.process.pojo.param; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotNull; + +/** + * Description: + * 接口文档访问地址:http://serverIP:port/swagger-ui.html + * Date: 2022/11/11 15:20【需求编号】 + * + * @author clam + * @version V1.0.0 + */ +@ApiModel(value="com-njcn-process-pojo-param-RGeneralSurveyPlanAddParm") +@Data +public class RGeneralSurveyPlandetailQueryParm { + + @NotNull(message="当前页不能为空!") + @Min(value = 1, message = "当前页不能为0") + @ApiModelProperty(value = "当前页",name = "currentPage",dataType ="Integer",required = true) + private Integer currentPage; + /**显示条数*/ + @NotNull(message="显示条数不能为空!") + @ApiModelProperty(value = "显示条数",name = "pageSize",dataType ="Integer",required = true) + private Integer pageSize; + + @ApiModelProperty(value="普测计划编号") + private String planNo; + + + +} diff --git a/process-boot/src/main/java/com/njcn/process/pojo/param/SurveyResultUploadParam.java b/process-boot/src/main/java/com/njcn/process/pojo/param/SurveyResultUploadParam.java new file mode 100644 index 000000000..9c2c545fb --- /dev/null +++ b/process-boot/src/main/java/com/njcn/process/pojo/param/SurveyResultUploadParam.java @@ -0,0 +1,31 @@ +package com.njcn.process.pojo.param; + +import com.njcn.web.constant.ValidMessage; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + +/** + * 未建档干扰源用户入网上传Param + * + * @author qijian + * @version 1.0.0 + * @createTime 2022/11/11 10:34 + */ +@Data +public class SurveyResultUploadParam { + + @ApiModelProperty(name = "planId",required = true) + @NotBlank(message = ValidMessage.ID_NOT_BLANK) + private String planId; + + @ApiModelProperty(name = "files",value = "普测结果报告",required = true) + @NotNull(message = "普测结果报告") + private MultipartFile[] files; + + + +} diff --git a/process-boot/src/main/java/com/njcn/process/pojo/po/RGeneralSurveyPlanDetail.java b/process-boot/src/main/java/com/njcn/process/pojo/po/RGeneralSurveyPlanDetail.java new file mode 100644 index 000000000..4f1004fb9 --- /dev/null +++ b/process-boot/src/main/java/com/njcn/process/pojo/po/RGeneralSurveyPlanDetail.java @@ -0,0 +1,113 @@ +package com.njcn.process.pojo.po; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.github.jeffreyning.mybatisplus.anno.MppMultiId; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +/** + * + * Description: + * 接口文档访问地址:http://serverIP:port/swagger-ui.html + * Date: 2022/11/11 11:28【需求编号】 + * + * @author clam + * @version V1.0.0 + */ +/** + * 普测计划详情表 + */ +@ApiModel(value="com-njcn-process-pojo-po-RGeneralSurveyPlanDetail") +@Data +@TableName(value = "r_general_survey_plan_detail") +public class RGeneralSurveyPlanDetail { + /** + * 普测计划编号 + */ + @MppMultiId(value = "plan_no") + @ApiModelProperty(value="普测计划编号") + private String planNo; + /** + * 母线ID + */ + + @MppMultiId(value = "busbar_id") + @ApiModelProperty(value="母线ID") + private String busbarId; + + /** + * 测试开始时间 + */ + @TableField(value = "general_survey_start_time") + @ApiModelProperty(value="测试开始时间") + private Date generalSurveyStartTime; + + /** + * 测试结束时间 + */ + @TableField(value = "general_survey_end_time") + @ApiModelProperty(value="测试结束时间") + private Date generalSurveyEndTime; + + /** + * 测试日期 + */ + @TableField(value = "general_survey_time") + @ApiModelProperty(value="测试日期") + private Date generalSurveyTime; + + /** + * 测试负责人 + */ + @TableField(value = "general_survey_leader") + @ApiModelProperty(value="测试负责人") + private String generalSurveyLeader; + + /** + * 变电站ID + */ + @TableField(value = "sub_id") + @ApiModelProperty(value="变电站ID") + private String subId; + + /** + * 变电站名称 + */ + @TableField(value = "sub_name") + @ApiModelProperty(value="变电站名称") + private String subName; + + /** + * 变电站电压等级 + */ + @TableField(value = "voltage_level") + @ApiModelProperty(value="变电站电压等级") + private String voltageLevel; + + + + /** + * 母线名称 + */ + @TableField(value = "busbar_name") + @ApiModelProperty(value="母线名称") + private String busbarName; + + /** + * 离线监测点id + */ + @TableField(value = "measurement_point_id") + @ApiModelProperty(value="离线监测点id") + private String measurementPointId; + + /** + * 是否生成问题(0:否 1:是) + */ + @TableField(value = "is_problem") + @ApiModelProperty(value="是否生成问题(0:否 1:是)") + private Byte isProblem; +} \ No newline at end of file diff --git a/process-boot/src/main/java/com/njcn/process/pojo/po/RGeneralSurveyPlanPO.java b/process-boot/src/main/java/com/njcn/process/pojo/po/RGeneralSurveyPlanPO.java new file mode 100644 index 000000000..5f0da1f1c --- /dev/null +++ b/process-boot/src/main/java/com/njcn/process/pojo/po/RGeneralSurveyPlanPO.java @@ -0,0 +1,126 @@ +package com.njcn.process.pojo.po; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.github.jeffreyning.mybatisplus.anno.MppMultiId; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +/** + * + * Description: + * 接口文档访问地址:http://serverIP:port/swagger-ui.html + * Date: 2022/11/11 11:24【需求编号】 + * + * @author clam + * @version V1.0.0 + */ +/** + * 普测计划表 + */ +@ApiModel(value="com-njcn-process-pojo-po-RGeneralSurveyPlanPO") +@Data +@TableName(value = "r_general_survey_plan") +public class RGeneralSurveyPlanPO { + /** + * 单位ID + */ + @TableField(value = "org_no") + @ApiModelProperty(value="单位ID") + private String orgNo; + + /** + * 普测计划编号 + */ + @MppMultiId(value = "plan_no") + @ApiModelProperty(value="普测计划编号") + private String planNo; + + /** + * 普测计划名称 + */ + @TableId(value = "plan_name") + @ApiModelProperty(value="普测计划名称") + private String planName; + + /** + * 计划生成时间 + */ + @TableField(value = "plan_create_time") + @ApiModelProperty(value="计划生成时间") + private Date planCreateTime = new Date(); + + /** + * 计划开始时间 + */ + @TableField(value = "plan_start_time") + @ApiModelProperty(value="计划开始时间") + private Date planStartTime; + + /** + * 计划结束时间 + */ + @TableField(value = "plan_end_time") + @ApiModelProperty(value="计划结束时间") + private Date planEndTime; + + /** + * 实际完成时间 + */ + @TableField(value = "plan_complate_time") + @ApiModelProperty(value="实际完成时间") + private Date planComplateTime; + + /** + * 计划负责人 + */ + @TableField(value = "leader") + @ApiModelProperty(value="计划负责人") + private String leader; + + /** + * 计划状态(0:新建 1:待审核 2:审核未通过 3:已发布 4:已完成) + */ + @TableField(value = "status") + @ApiModelProperty(value="计划状态(0:新建 1:待审核 2:审核未通过 3:已发布 4:已完成)") + private int status; + + /** + * 详情 + */ + @TableField(value = "description") + @ApiModelProperty(value="详情") + private String description; + + /** + * 文件是否上传(0:否 1:是) + */ + @TableField(value = "is_file_upload") + @ApiModelProperty(value="文件是否上传(0:否 1:是)") + private Integer isFileUpload; + + /** + * 上传文件数量 + */ + @TableField(value = "file_count") + @ApiModelProperty(value="上传文件数量") + private Integer fileCount ; + + /** + * 文件路径 + */ + @TableField(value = "file_path") + @ApiModelProperty(value="文件路径") + private String filePath; + + /** + * 上传时间 + */ + @TableField(value = "upload_time") + @ApiModelProperty(value="上传时间") + private Date uploadTime; +} \ No newline at end of file diff --git a/process-boot/src/main/java/com/njcn/process/pojo/vo/RGeneralSurveyPlanVO.java b/process-boot/src/main/java/com/njcn/process/pojo/vo/RGeneralSurveyPlanVO.java new file mode 100644 index 000000000..9378ee1f1 --- /dev/null +++ b/process-boot/src/main/java/com/njcn/process/pojo/vo/RGeneralSurveyPlanVO.java @@ -0,0 +1,127 @@ +package com.njcn.process.pojo.vo; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +/** + * Description: + * 接口文档访问地址:http://serverIP:port/swagger-ui.html + * Date: 2022/11/11 15:20【需求编号】 + * + * @author clam + * @version V1.0.0 + */ +@ApiModel(value="com-njcn-process-pojo-param-RGeneralSurveyPlanAddParm") +@Data +public class RGeneralSurveyPlanVO { + + @ApiModelProperty(value="单位ID") + private String orgNo; + + @ApiModelProperty(value="普测计划编号") + private String planNo; + + @ApiModelProperty(value="普测计划名称") + private String planName; + + @ApiModelProperty(value="计划开始时间") + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") + private Date planStartTime; + + @ApiModelProperty(value="计划结束时间") + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") + private Date planEndTime; + + @ApiModelProperty(value="变电站数量") + private Long subCount; + + @ApiModelProperty(value="母线数量") + private Long busCount; + + @ApiModelProperty(value="计划状态(0:新建 1:待审核 2:审核未通过 3:已发布 4:已完成)") + private int status; + + @TableField(value = "is_file_upload") + @ApiModelProperty(value="文件是否上传(0:否 1:是)") + private Byte isFileUpload; + + /** + * 上传文件数量 + */ + @TableField(value = "file_count") + @ApiModelProperty(value="上传文件数量") + private Integer fileCount; + + /** + * 文件路径 + */ + @TableField(value = "file_path") + @ApiModelProperty(value="文件路径") + private String filePath; + + /** + * 上传时间 + */ + @TableField(value = "upload_time") + @ApiModelProperty(value="上传时间") + private Date uploadTime; + + @ApiModelProperty(value="计划详细情况母线相关") + private List rGeneralSurveyPlanDetailVOList; + @Data + @ApiModel(value="计划详细情况母线相关") + public static class RGeneralSurveyPlanDetailVO{ + + @ApiModelProperty(value="变电站ID") + private String subId; + + @ApiModelProperty(value="变电站名称") + private String subName; + + @ApiModelProperty(value="变电站电压等级") + private String voltageLevel; + + @ApiModelProperty(value="母线ID") + private String busbarId; + + @ApiModelProperty(value="母线名称") + private String busbarName; + + @ApiModelProperty(value="离线监测点id") + private String measurementPointId; + /** + * 测试开始时间 + */ + @ApiModelProperty(value="测试开始时间") + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") + private Date generalSurveyStartTime; + + /** + * 测试结束时间 + */ + @ApiModelProperty(value="测试结束时间") + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") + private Date generalSurveyEndTime; + + /** + * 测试日期 + */ + @ApiModelProperty(value="测试日期") + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") + private Date generalSurveyTime; + + /** + * 测试负责人 + */ + @ApiModelProperty(value="测试负责人") + private String generalSurveyLeader; + + } + +} diff --git a/process-boot/src/main/java/com/njcn/process/service/RGeneralSurveyPlanDetailService.java b/process-boot/src/main/java/com/njcn/process/service/RGeneralSurveyPlanDetailService.java new file mode 100644 index 000000000..aa8ee0018 --- /dev/null +++ b/process-boot/src/main/java/com/njcn/process/service/RGeneralSurveyPlanDetailService.java @@ -0,0 +1,29 @@ +package com.njcn.process.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.jeffreyning.mybatisplus.service.IMppService; +import com.njcn.process.pojo.param.RGeneralSurveyPlandetailQueryParm; +import com.njcn.process.pojo.po.RGeneralSurveyPlanDetail; +import com.njcn.process.pojo.vo.RGeneralSurveyPlanVO; + +/** + * + * Description: + * 接口文档访问地址:http://serverIP:port/swagger-ui.html + * Date: 2022/11/11 11:28【需求编号】 + * + * @author clam + * @version V1.0.0 + */ + +public interface RGeneralSurveyPlanDetailService extends IMppService { + + /** + * @Description: 根据planNO查询普测计划详情 + * @Param: [rGeneralSurveyPlandetailQueryParm] + * @return: com.baomidou.mybatisplus.core.metadata.IPage + * @Author: clam + * @Date: 2022/11/15 + */ + IPage queryPlandetail(RGeneralSurveyPlandetailQueryParm rGeneralSurveyPlandetailQueryParm); +} diff --git a/process-boot/src/main/java/com/njcn/process/service/RGeneralSurveyPlanPOService.java b/process-boot/src/main/java/com/njcn/process/service/RGeneralSurveyPlanPOService.java new file mode 100644 index 000000000..c3fedd05f --- /dev/null +++ b/process-boot/src/main/java/com/njcn/process/service/RGeneralSurveyPlanPOService.java @@ -0,0 +1,56 @@ +package com.njcn.process.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.jeffreyning.mybatisplus.service.IMppService; +import com.njcn.process.pojo.param.RGeneralSurveyPlanAddParm; +import com.njcn.process.pojo.param.RGeneralSurveyPlanQueryParm; +import com.njcn.process.pojo.param.SurveyResultUploadParam; +import com.njcn.process.pojo.po.RGeneralSurveyPlanPO; +import com.njcn.process.pojo.vo.RGeneralSurveyPlanVO; + +import java.util.List; + +/** + * + * Description: + * 接口文档访问地址:http://serverIP:port/swagger-ui.html + * Date: 2022/11/11 11:24【需求编号】 + * + * @author clam + * @version V1.0.0 + */ +public interface RGeneralSurveyPlanPOService extends IMppService{ + + /** + * @Description: addPlan + * @Param: [rGeneralSurveyPlanAddParm] + * @return: java.lang.Boolean + * @Author: clam + * @Date: 2022/11/14 + */ + Boolean addPlan(RGeneralSurveyPlanAddParm rGeneralSurveyPlanAddParm); + /** + * @Description: query + * @Param: [rGeneralSurveyPlanQueryParm] + * @return: java.util.List + * @Author: clam + * @Date: 2022/11/15 + */ + IPage query(RGeneralSurveyPlanQueryParm rGeneralSurveyPlanQueryParm); + /** + * @Description: surveyResultUpload + * @Param: [surveyResultUploadParam] + * @return: boolean + * @Author: clam + * @Date: 2022/11/18 + */ + boolean surveyResultUpload(SurveyResultUploadParam surveyResultUploadParam); + /** + * @Description: surveyResultDownload + * @Param: [planNo] + * @return: java.util.List + * @Author: clam + * @Date: 2022/11/18 + */ + List surveyResultDownload(String planNo); +} diff --git a/process-boot/src/main/java/com/njcn/process/service/impl/RGeneralSurveyPlanDetailServiceImpl.java b/process-boot/src/main/java/com/njcn/process/service/impl/RGeneralSurveyPlanDetailServiceImpl.java new file mode 100644 index 000000000..2a5bee0c3 --- /dev/null +++ b/process-boot/src/main/java/com/njcn/process/service/impl/RGeneralSurveyPlanDetailServiceImpl.java @@ -0,0 +1,51 @@ +package com.njcn.process.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.github.jeffreyning.mybatisplus.service.MppServiceImpl; +import com.njcn.process.mapper.RGeneralSurveyPlanDetailMapper; +import com.njcn.process.pojo.param.RGeneralSurveyPlandetailQueryParm; +import com.njcn.process.pojo.po.RGeneralSurveyPlanDetail; +import com.njcn.process.pojo.vo.RGeneralSurveyPlanVO; +import com.njcn.process.service.RGeneralSurveyPlanDetailService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * + * Description: + * 接口文档访问地址:http://serverIP:port/swagger-ui.html + * Date: 2022/11/11 11:28【需求编号】 + * + * @author clam + * @version V1.0.0 + */ +@Service +public class RGeneralSurveyPlanDetailServiceImpl extends MppServiceImpl implements RGeneralSurveyPlanDetailService{ + + + private @Autowired + RGeneralSurveyPlanDetailMapper rGeneralSurveyPlanDetailMapper; + /** + * @param rGeneralSurveyPlandetailQueryParm + * @Description: 根据planNO查询普测计划详情 + * @Param: [rGeneralSurveyPlandetailQueryParm] + * @return: com.baomidou.mybatisplus.core.metadata.IPage + * @Author: clam + * @Date: 2022/11/15 + */ + @Override + public IPage queryPlandetail(RGeneralSurveyPlandetailQueryParm rGeneralSurveyPlandetailQueryParm) { + + IPage page = new Page<> (rGeneralSurveyPlandetailQueryParm.getCurrentPage(), rGeneralSurveyPlandetailQueryParm.getPageSize()); + + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<> (); + lambdaQueryWrapper.eq (RGeneralSurveyPlanDetail::getPlanNo, rGeneralSurveyPlandetailQueryParm.getPlanNo ()); + IPage rGeneralSurveyPlanDetailIPage = rGeneralSurveyPlanDetailMapper.selectPage (page, lambdaQueryWrapper); + + return rGeneralSurveyPlanDetailIPage.convert (temp-> BeanUtil.copyProperties (temp, RGeneralSurveyPlanVO.RGeneralSurveyPlanDetailVO.class)); + + } +} diff --git a/process-boot/src/main/java/com/njcn/process/service/impl/RGeneralSurveyPlanPOServiceImpl.java b/process-boot/src/main/java/com/njcn/process/service/impl/RGeneralSurveyPlanPOServiceImpl.java new file mode 100644 index 000000000..99b8e7cf5 --- /dev/null +++ b/process-boot/src/main/java/com/njcn/process/service/impl/RGeneralSurveyPlanPOServiceImpl.java @@ -0,0 +1,232 @@ +package com.njcn.process.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.github.jeffreyning.mybatisplus.service.MppServiceImpl; +import com.njcn.common.pojo.exception.BusinessException; +import com.njcn.minio.bo.MinIoUploadResDTO; +import com.njcn.minio.config.MinIoProperties; +import com.njcn.minio.utils.MinIoUtils; +import com.njcn.process.enums.ProcessResponseEnum; +import com.njcn.process.mapper.RGeneralSurveyPlanDetailMapper; +import com.njcn.process.mapper.RGeneralSurveyPlanPOMapper; +import com.njcn.process.pojo.param.RGeneralSurveyPlanAddParm; +import com.njcn.process.pojo.param.RGeneralSurveyPlanQueryParm; +import com.njcn.process.pojo.param.SurveyResultUploadParam; +import com.njcn.process.pojo.po.RGeneralSurveyPlanDetail; +import com.njcn.process.pojo.po.RGeneralSurveyPlanPO; +import com.njcn.process.pojo.vo.RGeneralSurveyPlanVO; +import com.njcn.process.service.RGeneralSurveyPlanDetailService; +import com.njcn.process.service.RGeneralSurveyPlanPOService; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import java.util.*; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +/** + * + * Description: + * 接口文档访问地址:http://serverIP:port/swagger-ui.html + * Date: 2022/11/11 11:24【需求编号】 + * + * @author clam + * @version V1.0.0 + */ +@Service +public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl implements RGeneralSurveyPlanPOService{ + + + private @Autowired + RGeneralSurveyPlanDetailService rGeneralSurveyPlanDetailService; + + private @Autowired + RGeneralSurveyPlanPOMapper rGeneralSurveyPlanPOMapper; + + private @Autowired + RGeneralSurveyPlanDetailMapper rGeneralSurveyPlanDetailMapper; + + @Resource + private MinIoUtils minIoUtils; + + @Resource + private MinIoProperties minIoProperties; + /** + * @param rGeneralSurveyPlanAddParm + * @Description: addPlan + * @Param: [rGeneralSurveyPlanAddParm] + * @return: java.lang.Boolean + * @Author: clam + * @Date: 2022/11/14 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean addPlan(RGeneralSurveyPlanAddParm rGeneralSurveyPlanAddParm) { + + Boolean flag =true; + RGeneralSurveyPlanPO rGeneralSurveyPlanPO = new RGeneralSurveyPlanPO (); + BeanUtils.copyProperties (rGeneralSurveyPlanAddParm,rGeneralSurveyPlanPO); + /*todo 后期与工作流绑定*/ + rGeneralSurveyPlanPO.setStatus (0); + flag = this.saveOrUpdate (rGeneralSurveyPlanPO); + + List rGeneralSurveyPlanDetailAddParm = rGeneralSurveyPlanAddParm.getRGeneralSurveyPlanDetailAddParm ( ); + + List rGeneralSurveyPlanDetailList = new ArrayList<> (); + rGeneralSurveyPlanDetailAddParm.forEach (temp->{ + RGeneralSurveyPlanDetail rGeneralSurveyPlanDetail = new RGeneralSurveyPlanDetail(); + BeanUtils.copyProperties (temp, rGeneralSurveyPlanDetail); + rGeneralSurveyPlanDetail.setPlanNo (rGeneralSurveyPlanAddParm.getPlanNo ()); + rGeneralSurveyPlanDetail.setGeneralSurveyLeader(rGeneralSurveyPlanAddParm.getLeader ()); + rGeneralSurveyPlanDetailList.add (rGeneralSurveyPlanDetail); + }); + flag = rGeneralSurveyPlanDetailService.saveOrUpdateBatchByMultiId (rGeneralSurveyPlanDetailList,5); + + return flag; + } + + /** + * @param rGeneralSurveyPlanQueryParm + * @Description: query + * @Param: [rGeneralSurveyPlanQueryParm] + * @return: java.util.List + * @Author: clam + * @Date: 2022/11/15 + */ + @Override + public IPage query(RGeneralSurveyPlanQueryParm rGeneralSurveyPlanQueryParm) { + IPage page = new Page<> (rGeneralSurveyPlanQueryParm.getCurrentPage(), rGeneralSurveyPlanQueryParm.getPageSize()); + IPage returnpage = new Page<> (rGeneralSurveyPlanQueryParm.getCurrentPage(), rGeneralSurveyPlanQueryParm.getPageSize()); + + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<> (); + if (!StringUtils.isEmpty (rGeneralSurveyPlanQueryParm.getOrgNo ())) { + queryWrapper.eq (RGeneralSurveyPlanPO::getOrgNo, rGeneralSurveyPlanQueryParm.getOrgNo ()); + } + if (!StringUtils.isEmpty (rGeneralSurveyPlanQueryParm. getStatus ())) { + queryWrapper.eq (RGeneralSurveyPlanPO::getStatus, rGeneralSurveyPlanQueryParm.getStatus ()); + } + if (!StringUtils.isEmpty (rGeneralSurveyPlanQueryParm.getIsFileUpload ())) { + queryWrapper.eq (RGeneralSurveyPlanPO::getIsFileUpload, rGeneralSurveyPlanQueryParm.getIsFileUpload ()); + } + if (!Objects.isNull (rGeneralSurveyPlanQueryParm.getPlanStartTime ())) { + queryWrapper.eq (RGeneralSurveyPlanPO::getPlanStartTime, rGeneralSurveyPlanQueryParm.getPlanStartTime ()); + } + queryWrapper.orderByAsc (RGeneralSurveyPlanPO::getStatus).orderByDesc (RGeneralSurveyPlanPO::getPlanCreateTime); + + List rGeneralSurveyPlanPOS = rGeneralSurveyPlanPOMapper.selectPage (page,queryWrapper).getRecords (); + if(CollectionUtils.isEmpty (rGeneralSurveyPlanPOS)){ + return returnpage; + } + List collect = rGeneralSurveyPlanPOS.stream ( ).map (RGeneralSurveyPlanPO::getPlanNo).collect (Collectors.toList ( )); + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<> (); + lambdaQueryWrapper.in (RGeneralSurveyPlanDetail::getPlanNo, collect); + List rGeneralSurveyPlanDetails = rGeneralSurveyPlanDetailMapper.selectList (lambdaQueryWrapper); + List rGeneralSurveyPlanVOList = new ArrayList<> (); + rGeneralSurveyPlanPOS.forEach (temp ->{ + RGeneralSurveyPlanVO rGeneralSurveyPlanVO = new RGeneralSurveyPlanVO(); + BeanUtils.copyProperties (temp, rGeneralSurveyPlanVO); + Stream rGeneralSurveyPlanDetailStream = rGeneralSurveyPlanDetails.stream ( ). + filter (surveyPlanDetail -> Objects.equals (surveyPlanDetail.getPlanNo ( ), temp.getPlanNo ( ))); + long Busbarcount = rGeneralSurveyPlanDetails.stream ( ). + filter (surveyPlanDetail -> Objects.equals (surveyPlanDetail.getPlanNo ( ), temp.getPlanNo ( ))). + map (RGeneralSurveyPlanDetail::getBusbarId).distinct ( ).count ( ); + + long Subcount = rGeneralSurveyPlanDetails.stream ( ). + filter (surveyPlanDetail -> Objects.equals (surveyPlanDetail.getPlanNo ( ), temp.getPlanNo ( ))). + map (RGeneralSurveyPlanDetail::getSubId).distinct ( ).count ( ); + rGeneralSurveyPlanVO.setBusCount (Busbarcount); + rGeneralSurveyPlanVO.setSubCount (Subcount); + List collect1 = rGeneralSurveyPlanDetails.stream ( ). + filter (surveyPlanDetail -> Objects.equals (surveyPlanDetail.getPlanNo ( ), temp.getPlanNo ( ))). + map (surveyPlanDetail -> { + RGeneralSurveyPlanVO.RGeneralSurveyPlanDetailVO rGeneralSurveyPlanDetailVO = new RGeneralSurveyPlanVO.RGeneralSurveyPlanDetailVO ( ); + BeanUtils.copyProperties (surveyPlanDetail, rGeneralSurveyPlanDetailVO); + return rGeneralSurveyPlanDetailVO; + }).collect (Collectors.toList ( )); + + rGeneralSurveyPlanVO.setRGeneralSurveyPlanDetailVOList (collect1); + rGeneralSurveyPlanVOList.add (rGeneralSurveyPlanVO); + }); + returnpage.setRecords (rGeneralSurveyPlanVOList); + return returnpage; + } + + /** + * @param surveyResultUploadParam + * @Description: surveyResultUpload + * @Param: [surveyResultUploadParam] + * @return: boolean + * @Author: clam + * @Date: 2022/11/18 + */ + @Override + public boolean surveyResultUpload(SurveyResultUploadParam surveyResultUploadParam) { + boolean result = true; + RGeneralSurveyPlanPO rGeneralSurveyPlanPO = new RGeneralSurveyPlanPO(); + rGeneralSurveyPlanPO.setPlanNo (surveyResultUploadParam.getPlanId ()); + rGeneralSurveyPlanPO = this.selectByMultiId (rGeneralSurveyPlanPO); + String filePath =rGeneralSurveyPlanPO.getFilePath (); + Integer fileCount = rGeneralSurveyPlanPO.getFileCount ( ); + Optional.ofNullable (fileCount).orElse (0); + for (int i = 0; i < surveyResultUploadParam.getFiles ( ).length; i++) { + MinIoUploadResDTO minIoUploadResDTO = fileToMinio(surveyResultUploadParam.getFiles ( )[i]); + filePath=filePath+minIoUploadResDTO.getMinFileName ()+";"; + fileCount++; + } + rGeneralSurveyPlanPO.setStatus (4); + rGeneralSurveyPlanPO.setFileCount (fileCount); + rGeneralSurveyPlanPO.setFilePath (filePath); + rGeneralSurveyPlanPO.setIsFileUpload (1); + rGeneralSurveyPlanPO.setUploadTime (new Date ()); + this.saveOrUpdateByMultiId (rGeneralSurveyPlanPO); + return result; + } + + /** + * @param planNo + * @Description: surveyResultDownload + * @Param: [surveyResultUploadParam] + * @return: java.util.List + * @Author: clam + * @Date: 2022/11/18 + */ + @Override + public List surveyResultDownload(String planNo) { + RGeneralSurveyPlanPO rGeneralSurveyPlanPO = new RGeneralSurveyPlanPO(); + rGeneralSurveyPlanPO.setPlanNo (planNo); + rGeneralSurveyPlanPO = this.selectByMultiId (rGeneralSurveyPlanPO); + String filePath = rGeneralSurveyPlanPO.getFilePath ( ); + if(StringUtils.isEmpty (filePath)){ + throw new BusinessException(ProcessResponseEnum.DOWNLOAD_FILE_ERROR); + } + String[] split = filePath.substring (0, filePath.length ( ) - 1).split (";"); + List collect = Stream.of (split).map (temp -> { + return minIoUtils.getObjectUrl (minIoProperties.getBucket ( ), temp, 7 * 24 * 60 * 60); + }).collect (Collectors.toList ( )); + return collect; + } + + /** + * 上传文件到Minio + * + * @param file 文件 + * @return 成功标记 + */ + private MinIoUploadResDTO fileToMinio(MultipartFile file) { + try { + //把名称存入数据 + MinIoUploadResDTO upload = minIoUtils.upload(file, minIoProperties.getBucket(), "surveyresult/"); + return upload; + } catch (Exception e) { + throw new BusinessException (ProcessResponseEnum.UPLOAD_FILE_ERROR); + } + } +}