diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/form/TDuckHeaderInfoFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/form/TDuckHeaderInfoFormDTO.java new file mode 100644 index 0000000000..2e0a1a953f --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/form/TDuckHeaderInfoFormDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dataaggre.dto.epmettduck.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/9/17 10:47 上午 + * @DESC + */ +@Data +public class TDuckHeaderInfoFormDTO implements Serializable { + + private static final long serialVersionUID = 3624352114576287768L; + + public interface TDuckHeaderInfoForm{} + + @NotBlank(message = "projectKey不能为空",groups = TDuckHeaderInfoForm.class) + private String projectKey; +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetTDuckController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetTDuckController.java index 6b0914cf52..169fd2eb04 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetTDuckController.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetTDuckController.java @@ -7,6 +7,7 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dataaggre.dto.epmettduck.form.TDuckDetailFormDTO; +import com.epmet.dataaggre.dto.epmettduck.form.TDuckHeaderInfoFormDTO; import com.epmet.dataaggre.dto.epmettduck.form.TDuckListFormDTO; import com.epmet.dataaggre.dto.epmettduck.result.TDuckListResultDTO; import com.epmet.dataaggre.entity.epmettduck.PrUserProjectEntity; @@ -92,4 +93,16 @@ public class EpmetTDuckController { return new Result>().ok(prUserProjectService.queryProjectList(formDTO)); } + /** + * @Description 查询问卷调查的头部信息 + * @Param formDTO + * @author zxc + * @date 2021/9/18 10:35 上午 + */ + @PostMapping("headerinfo") + public Result headerInfo(@RequestBody TDuckHeaderInfoFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, TDuckHeaderInfoFormDTO.TDuckHeaderInfoForm.class); + return new Result().ok(prUserProjectService.headerInfo(formDTO)); + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrUserProjectService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrUserProjectService.java index 554f1382ff..b581036ef0 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrUserProjectService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrUserProjectService.java @@ -20,6 +20,7 @@ package com.epmet.dataaggre.service.epmettduck; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dataaggre.dto.epmettduck.PrUserProjectDTO; +import com.epmet.dataaggre.dto.epmettduck.form.TDuckHeaderInfoFormDTO; import com.epmet.dataaggre.dto.epmettduck.form.TDuckListFormDTO; import com.epmet.dataaggre.dto.epmettduck.result.AnalysisReportResDTO; import com.epmet.dataaggre.dto.epmettduck.result.ProjectProfileResultDTO; @@ -124,4 +125,12 @@ public interface PrUserProjectService extends BaseService { * @date 2021/9/16 5:57 下午 */ List queryAnalysisReport(String projectKey); + + /** + * @Description 查询问卷调查的头部信息 + * @Param formDTO + * @author zxc + * @date 2021/9/18 10:35 上午 + */ + PrUserProjectEntity headerInfo(TDuckHeaderInfoFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectServiceImpl.java index 8702b43399..22b4795302 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectServiceImpl.java @@ -19,8 +19,11 @@ package com.epmet.dataaggre.service.epmettduck.impl; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; @@ -32,6 +35,7 @@ import com.epmet.dataaggre.dao.epmettduck.PrUserProjectDao; import com.epmet.dataaggre.dao.epmettduck.PrVistRecordDao; import com.epmet.dataaggre.dto.epmettduck.PrUserProjectDTO; import com.epmet.dataaggre.dto.epmettduck.ProjectItemTypeEnum; +import com.epmet.dataaggre.dto.epmettduck.form.TDuckHeaderInfoFormDTO; import com.epmet.dataaggre.dto.epmettduck.form.TDuckListFormDTO; import com.epmet.dataaggre.dto.epmettduck.result.AnalysisReportResDTO; import com.epmet.dataaggre.dto.epmettduck.result.OptionDTO; @@ -462,6 +466,19 @@ public class PrUserProjectServiceImpl extends BaseServiceImpl w = new LambdaQueryWrapper<>(); + LambdaQueryWrapper eq = w.eq(PrUserProjectEntity::getKey, formDTO.getProjectKey()); + return eq.getEntity(); + } + private List> sortMap(Map map, boolean asc) { Stream> stream = null;