Browse Source

headerinfo

master
zxc 4 years ago
parent
commit
556b52daef
  1. 23
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmettduck/form/TDuckHeaderInfoFormDTO.java
  2. 13
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetTDuckController.java
  3. 9
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/PrUserProjectService.java
  4. 17
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmettduck/impl/PrUserProjectServiceImpl.java

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

13
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<List<TDuckListResultDTO>>().ok(prUserProjectService.queryProjectList(formDTO));
}
/**
* @Description 查询问卷调查的头部信息
* @Param formDTO
* @author zxc
* @date 2021/9/18 10:35 上午
*/
@PostMapping("headerinfo")
public Result<PrUserProjectEntity> headerInfo(@RequestBody TDuckHeaderInfoFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, TDuckHeaderInfoFormDTO.TDuckHeaderInfoForm.class);
return new Result<PrUserProjectEntity>().ok(prUserProjectService.headerInfo(formDTO));
}
}

9
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<PrUserProjectEntity> {
* @date 2021/9/16 5:57 下午
*/
List<AnalysisReportResDTO> queryAnalysisReport(String projectKey);
/**
* @Description 查询问卷调查的头部信息
* @Param formDTO
* @author zxc
* @date 2021/9/18 10:35 上午
*/
PrUserProjectEntity headerInfo(TDuckHeaderInfoFormDTO formDTO);
}

17
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<PrUserProjectDao,
return itemList;
}
/**
* @Description 查询问卷调查的头部信息
* @Param formDTO
* @author zxc
* @date 2021/9/18 10:35 上午
*/
@Override
public PrUserProjectEntity headerInfo(TDuckHeaderInfoFormDTO formDTO) {
LambdaQueryWrapper<PrUserProjectEntity> w = new LambdaQueryWrapper<>();
LambdaQueryWrapper<PrUserProjectEntity> eq = w.eq(PrUserProjectEntity::getKey, formDTO.getProjectKey());
return eq.getEntity();
}
private List<Map.Entry<Integer, Integer>> sortMap(Map<Integer, Integer> map, boolean asc) {
Stream<Map.Entry<Integer, Integer>> stream = null;

Loading…
Cancel
Save