Browse Source

Merge remote-tracking branch 'origin/develop' into release_temp

dev_shibei_match
yinzuomei 4 years ago
parent
commit
bb1a4038bc
  1. 2
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/PageListAnalysisFormDTO.java
  2. 52
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecExcelResultDTO.java
  3. 28
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java
  4. 16
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
  5. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml

2
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/PageListAnalysisFormDTO.java

@ -47,4 +47,6 @@ public class PageListAnalysisFormDTO implements Serializable {
* orgType=agency时pid拼接上orgId
*/
private String gridPids;
private Boolean pageFlag;
}

52
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecExcelResultDTO.java

@ -0,0 +1,52 @@
package com.epmet.dto.result.demand;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class DemandRecExcelResultDTO implements Serializable {
private static final long serialVersionUID = -1110606022410166621L;
@Excel(name = "状态", width = 15)
private String statusName;
@Excel(name = "所属网格", width = 40)
private String gridName;
@Excel(name = "需求类型", width = 40)
private String categoryName;
@Excel(name = "需求内容", width = 40)
private String content;
@Excel(name = "上报类型", width = 40)
private String reportTypeName;
@Excel(name = "上报人", width = 20)
private String reportUserName;
@Excel(name = "上报时间", width = 25)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date reportTime;
@Excel(name = "需求人", width = 20)
private String demandUserName;
/**
* 尹作梅(志愿者)
* XXX(社会组织)
* XXX(社区自组织)
* XXX(区域化党建单位)
*/
@Excel(name = "服务方", width = 15)
private String serviceShowName;
@Excel(name = "服务时间", width = 25)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date wantServiceTime;
}

28
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java

@ -20,22 +20,22 @@ package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.constant.UserDemandConstant;
import com.epmet.dto.form.demand.*;
import com.epmet.dto.result.demand.DemandRecResultDTO;
import com.epmet.dto.result.demand.DemandResearchAnalysisResultDTO;
import com.epmet.dto.result.demand.IcResiUserReportDemandRes;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.dto.result.demand.*;
import com.epmet.service.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
@ -233,8 +233,28 @@ public class IcUserDemandRecController {
*/
@PostMapping("pagelist-analysis")
public Result<PageData<DemandRecResultDTO>> pageListAnalysis(@LoginUser TokenDto tokenDto,@RequestBody PageListAnalysisFormDTO formDTO){
formDTO.setPageFlag(true);
formDTO.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(formDTO,PageListAnalysisFormDTO.AddUserShowGroup.class,PageListAnalysisFormDTO.AddUserInternalGroup.class);
return new Result<PageData<DemandRecResultDTO>>().ok(icUserDemandRecService.pageListAnalysis(formDTO));
}
/**
* 数据分析-服务措施分析-导出
* @param response
* @param tokenDto
* @param formDTO
* @throws Exception
*/
@PostMapping("analysis-export")
public Result analysisExport(HttpServletResponse response,@LoginUser TokenDto tokenDto, @RequestBody PageListAnalysisFormDTO formDTO)throws Exception {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setPageFlag(false);
PageData<DemandRecResultDTO> res=icUserDemandRecService.pageListAnalysis(formDTO);
if (!CollectionUtils.isEmpty(res.getList())) {
ExcelUtils.exportExcelToTarget(response, null, res.getList(), DemandRecExcelResultDTO.class);
return new Result();
}
return new Result();
}
}

16
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java

@ -629,9 +629,16 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
formDTO.setGridPids(customerAgencyDTOResult.getData().getPids().concat(StrConstant.COLON).concat(formDTO.getOrgId()));
}
}
PageInfo<DemandRecResultDTO> pageInfo= PageHelper.startPage(formDTO.getPageNo(),
formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.pageListAnalysis(formDTO));
List<DemandRecResultDTO> list=pageInfo.getList();
long total=NumConstant.ZERO;
List<DemandRecResultDTO> list=new ArrayList<>();
if(formDTO.getPageFlag()){
PageInfo<DemandRecResultDTO> pageInfo= PageHelper.startPage(formDTO.getPageNo(),
formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.pageListAnalysis(formDTO));
list=pageInfo.getList();
total=pageInfo.getTotal();
}else{
list=baseDao.pageListAnalysis(formDTO);
}
if(CollectionUtils.isNotEmpty(list)){
//1、查询网格信息
List<String> gridIds=list.stream().map(DemandRecResultDTO::getGridId).collect(Collectors.toList());
@ -686,8 +693,9 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
res.setServiceShowName(serviceTypeMap.containsKey(res.getServiceType())?res.getServiceName().concat("(").concat(serviceTypeMap.get(res.getServiceType())).concat(")"):StrConstant.EPMETY_STR);
}
}
return new PageData<>(list, pageInfo.getTotal());
return new PageData<>(list, total);
}
}

2
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml

@ -246,7 +246,7 @@
<if test="null != orgType and orgType == 'grid' ">
and r.GRID_ID=#{orgId}
</if>
<if test="null != orgType or orgType == 'agency' ">
<if test="null != orgType and orgType == 'agency' ">
AND r.GRID_PIDS LIKE concat(#{gridPids},'%')
</if>
<if test="null != categoryCode and categoryCode !='' ">

Loading…
Cancel
Save