导出问题处理

master
shijie 4 years ago
parent aa7c28808d
commit 3d1757b5fc
  1. 17
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgEfficiencyController.java
  2. 2
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgStatisticsController.java
  3. 35
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgStatisticsServiceImpl.java

@ -5,6 +5,7 @@ import com.daqing.financial.guarantee.feign.HrmsFeignService;
import com.daqing.financial.guarantee.model.request.CopyForMeRequest;
import com.daqing.financial.guarantee.model.request.DgEfficiencyTeamRequest;
import com.daqing.financial.guarantee.model.request.PersonalEfficiencyListRequest;
import com.daqing.financial.guarantee.model.response.BusinessApplicationListResponse;
import com.daqing.financial.guarantee.model.response.CopyForMeResponse;
import com.daqing.financial.guarantee.model.response.NumResponse;
import com.daqing.financial.guarantee.model.response.PersonalEfficiencyListResponse;
@ -293,14 +294,30 @@ public class DgEfficiencyController {
employeeMessage = (List<LinkedHashMap>) responseResult.getData();
}
if(employeeMessage!= null && employeeMessage.size()>0){
for (PersonalEfficiencyListResponse response : responseList) {
for (LinkedHashMap res : employeeMessage) {
if (response.getApplicantId().equals(res.get("id"))) {//如果提单人id相同情况下,就往对象里面赋值
response.setApplicant(JSONObject.toJSONString(res.get("account")).replace("\"", ""));
}
if(response != null){
if(response.getApplicant()==null){
response.setApplicant("客户");
}
}
}
}
}else{
for (PersonalEfficiencyListResponse response:responseList) {
if(response != null){
if(response.getApplicant()==null){
response.setApplicant("客户");
}
}
}
}
}
try {
EasyExcelUtil.download(httpServletResponse, PersonalEfficiencyListResponse.class, responseList, "个人效率记录列表", "第一页");
} catch (IOException e) {

@ -77,6 +77,6 @@ public class DgStatisticsController {
Boolean result = iDgStatisticsService.excelExportRefuse(response);
return result ? ResponseResult.SUCCESS() : ResponseResult.FAIL();
return result ? ResponseResult.SUCCESS() : ResponseResult.FAIL(70001,"导出数据为空!");
}
}

@ -120,9 +120,8 @@ public class DgStatisticsServiceImpl extends ServiceImpl<DgStatisticsMapper, DgA
IPage<DgStatisticsPO> list = this.getBaseMapper().list(new Page(), new DgStatisticsRequest());
List<DgStatisticsPO> dgStatisticsPOList = list.getRecords();
if (dgStatisticsPOList == null) {
return false;
}
List<DgStatisticsExcelResponse> excelResponse = new ArrayList<>();
if (dgStatisticsPOList.size()>0) {
Integer[] presenterIds = dgStatisticsPOList.stream().map(DgStatisticsPO::getPresenterId).toArray(Integer[]::new);
if (presenterIds.length != 0) {
// 强制类型转换
@ -134,7 +133,7 @@ public class DgStatisticsServiceImpl extends ServiceImpl<DgStatisticsMapper, DgA
ResponseResult<List<EmployeeTO>> empAndDeptList = hrmsFeignService.getAccountAndDeptNameByIds(ids);
if (empAndDeptList.getData() != null) {
List<DgStatisticsListResponse> listResponse = this.jointStatistics(dgStatisticsPOList, empAndDeptList.getData());
List<DgStatisticsExcelResponse> excelResponse = new ArrayList<>();
for (DgStatisticsListResponse dgStatisticsListResponse : listResponse) {
DgStatisticsExcelResponse dgStatisticsExcelResponse = new DgStatisticsExcelResponse();
StringBuilder stringBuilder = new StringBuilder();
@ -151,18 +150,19 @@ public class DgStatisticsServiceImpl extends ServiceImpl<DgStatisticsMapper, DgA
BeanUtils.copyProperties(dgStatisticsListResponse, dgStatisticsExcelResponse);
excelResponse.add(dgStatisticsExcelResponse);
}
}
}
}
try {
ExcelUtil.writeExcelWithSheets(response, excelResponse, "业务统计信息一览表", "statistics", new DgStatisticsExcelResponse())
.finish();
return true;
} catch (Exception e) {
ExceptionCast.cast(CrmsCode.CUSTOMER_EXPORT_EXSIT);
}
return true;
} else {
return false;
}
}
return false;
}
/**
@ -263,9 +263,9 @@ public class DgStatisticsServiceImpl extends ServiceImpl<DgStatisticsMapper, DgA
// 列表查询
IPage<DgStatisticsRefusePO> listRefuse = this.getBaseMapper().listRefuse(new Page(), new DgStatisticsRequest());
List<DgStatisticsRefusePO> statisticsRefusePOList = listRefuse.getRecords();
if (statisticsRefusePOList == null) {
return false;
}
List<DgStatisticsExcelRefuseResponse> excelResponse = new ArrayList<>();
if (statisticsRefusePOList.size()>0) {
Integer[] presenterIds = statisticsRefusePOList.stream().map(DgStatisticsRefusePO::getPresenterId).toArray(Integer[]::new);
if (presenterIds.length != 0) {
// 强制类型转换
@ -278,7 +278,7 @@ public class DgStatisticsServiceImpl extends ServiceImpl<DgStatisticsMapper, DgA
if (empAndDeptList.getData() != null) {
// 提单人姓名、部门拼装
List<DgStatisticsListRefuseResponse> listResponse = this.jointRefuseStatistics(statisticsRefusePOList, empAndDeptList.getData());
List<DgStatisticsExcelRefuseResponse> excelResponse = new ArrayList<>();
for (DgStatisticsListRefuseResponse listRefuseResponse : listResponse) {
DgStatisticsExcelRefuseResponse excelRefuseResponse = new DgStatisticsExcelRefuseResponse();
StringBuilder stringBuilder = new StringBuilder();
@ -295,15 +295,16 @@ public class DgStatisticsServiceImpl extends ServiceImpl<DgStatisticsMapper, DgA
BeanUtils.copyProperties(listRefuseResponse, excelRefuseResponse);
excelResponse.add(excelRefuseResponse);
}
}
}
}
try {
ExcelUtil.writeExcelWithSheets(response, excelResponse, "业务统计拒绝信息一览表", "statisticsRefuse", new DgStatisticsExcelRefuseResponse())
.finish();
return true;
} catch (Exception e) {
ExceptionCast.cast(CrmsCode.CUSTOMER_EXPORT_EXSIT);
}
}
return false;
} else {
return false;
}
}

Loading…
Cancel
Save