Browse Source

项目采集、处理进展采集接口调整

dev_shibei_match
yinzuomei 4 years ago
parent
commit
54bebb245f
  1. 5
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java
  2. 7
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectService.java
  3. 4
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java
  4. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java
  5. 14
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectProcessServiceImpl.java

5
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java

@ -17,6 +17,7 @@ import com.epmet.evaluationindex.screen.dto.form.ProjectDetailFormDTO;
import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDetailFormDTO; import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDetailFormDTO;
import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDistributionFormDTO; import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDistributionFormDTO;
import com.epmet.evaluationindex.screen.dto.result.ProjectDetailResultDTO; import com.epmet.evaluationindex.screen.dto.result.ProjectDetailResultDTO;
import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDistributionResultDTO;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -60,9 +61,9 @@ public class ScreenProjectController {
* @Date 2021/2/24 16:10 * @Date 2021/2/24 16:10
*/ */
@PostMapping("projectdistribution") @PostMapping("projectdistribution")
public Result projectDistribution(@RequestBody ScreenProjectDistributionFormDTO formDTO){ public Result<List<ScreenProjectDistributionResultDTO>> projectDistribution(@RequestBody ScreenProjectDistributionFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO); ValidatorUtils.validateEntity(formDTO);
return screenProjectService.projectDistribution(formDTO); return new Result<List<ScreenProjectDistributionResultDTO>>().ok(screenProjectService.projectDistribution(formDTO));
} }
/** /**

7
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectService.java

@ -1,12 +1,13 @@
package com.epmet.datareport.service.evaluationindex.screen; package com.epmet.datareport.service.evaluationindex.screen;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDetailFormDTO;
import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDistributionFormDTO;
import com.epmet.dto.form.screen.CategoryAnalysisFormDTO; import com.epmet.dto.form.screen.CategoryAnalysisFormDTO;
import com.epmet.dto.result.screen.CategoryAnalysisResultDTO; import com.epmet.dto.result.screen.CategoryAnalysisResultDTO;
import com.epmet.evaluationindex.screen.dto.form.ProjectDetailFormDTO; import com.epmet.evaluationindex.screen.dto.form.ProjectDetailFormDTO;
import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDetailFormDTO;
import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDistributionFormDTO;
import com.epmet.evaluationindex.screen.dto.result.ProjectDetailResultDTO; import com.epmet.evaluationindex.screen.dto.result.ProjectDetailResultDTO;
import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDistributionResultDTO;
import java.util.List; import java.util.List;
@ -36,7 +37,7 @@ public interface ScreenProjectService {
*/ */
List<CategoryAnalysisResultDTO> categoryAnalysis(String customerId, CategoryAnalysisFormDTO formDTO); List<CategoryAnalysisResultDTO> categoryAnalysis(String customerId, CategoryAnalysisFormDTO formDTO);
Result projectDistribution(ScreenProjectDistributionFormDTO formDTO); List<ScreenProjectDistributionResultDTO> projectDistribution(ScreenProjectDistributionFormDTO formDTO);
Result projectDistributionDetail(ScreenProjectDetailFormDTO formDTO); Result projectDistributionDetail(ScreenProjectDetailFormDTO formDTO);
} }

4
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java

@ -70,7 +70,7 @@ public class ScreenProjectServiceImpl implements ScreenProjectService {
*/ */
@Override @Override
@DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true)
public Result projectDistribution(ScreenProjectDistributionFormDTO formDTO) { public List<ScreenProjectDistributionResultDTO> projectDistribution(ScreenProjectDistributionFormDTO formDTO) {
// 1:红色:为刚提交未做任何响应处理未结案的项目; // 1:红色:为刚提交未做任何响应处理未结案的项目;
// 2:黄色: 至少做过一次响应处理答复但未结案的项目; // 2:黄色: 至少做过一次响应处理答复但未结案的项目;
// 3:绿色:已经结案的项目。 // 3:绿色:已经结案的项目。
@ -82,7 +82,7 @@ public class ScreenProjectServiceImpl implements ScreenProjectService {
formDTO.setPageSize(NumConstant.TWO_HUNDRED); formDTO.setPageSize(NumConstant.TWO_HUNDRED);
} }
List<ScreenProjectDistributionResultDTO> resultDTOS = screenProjectDataDao.projectDistribution(formDTO.getAgencyId(),areaIds,formDTO.getLevel(),formDTO.getPageSize()); List<ScreenProjectDistributionResultDTO> resultDTOS = screenProjectDataDao.projectDistribution(formDTO.getAgencyId(),areaIds,formDTO.getLevel(),formDTO.getPageSize());
return new Result().ok(resultDTOS); return resultDTOS;
} }
@Override @Override

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java

@ -123,12 +123,12 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl<ScreenProjectD
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true)
public void collect(ScreenCollFormDTO<ScreenProjectDataInfoFormDTO> param) { public void collect(ScreenCollFormDTO<ScreenProjectDataInfoFormDTO> param) {
if (param.getIsFirst()) { /*if (param.getIsFirst()) {
int affectedRows = baseDao.deleteByDateIdAndCustomerId(param.getCustomerId(), param.getDateId()); int affectedRows = baseDao.deleteByDateIdAndCustomerId(param.getCustomerId(), param.getDateId());
while (affectedRows > 0) { while (affectedRows > 0) {
affectedRows = baseDao.deleteByDateIdAndCustomerId(param.getCustomerId(), param.getDateId()); affectedRows = baseDao.deleteByDateIdAndCustomerId(param.getCustomerId(), param.getDateId());
} }
} }*/
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date today = new Date(); Date today = new Date();
param.getDataList().forEach(item -> { param.getDataList().forEach(item -> {

14
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectProcessServiceImpl.java

@ -35,6 +35,7 @@ import com.epmet.entity.evaluationindex.screen.ScreenProjectProcessAttachmentEnt
import com.epmet.entity.evaluationindex.screen.ScreenProjectProcessEntity; import com.epmet.entity.evaluationindex.screen.ScreenProjectProcessEntity;
import com.epmet.service.evaluationindex.screen.ScreenProjectProcessAttachmentService; import com.epmet.service.evaluationindex.screen.ScreenProjectProcessAttachmentService;
import com.epmet.service.evaluationindex.screen.ScreenProjectProcessService; import com.epmet.service.evaluationindex.screen.ScreenProjectProcessService;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.ListUtils; import org.apache.commons.collections4.ListUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -122,21 +123,24 @@ public class ScreenProjectProcessServiceImpl extends BaseServiceImpl<ScreenProje
if (CollectionUtils.isEmpty(param.getDataList())){ if (CollectionUtils.isEmpty(param.getDataList())){
return; return;
} }
if (param.getIsFirst()) { /*if (param.getIsFirst()) {
int affectedRows = baseDao.deleteByDateIdAndCustomerId(param.getCustomerId(), param.getDateId()); int affectedRows = baseDao.deleteByDateIdAndCustomerId(param.getCustomerId(), param.getDateId());
while (affectedRows > 0) { while (affectedRows > 0) {
affectedRows = baseDao.deleteByDateIdAndCustomerId(param.getCustomerId(), param.getDateId()); affectedRows = baseDao.deleteByDateIdAndCustomerId(param.getCustomerId(), param.getDateId());
} }
} }*/
List<String> processIdList = List<String> processIdList =
param.getDataList().stream().map(ScreenProjectProcessFormDTO :: getProcessId).collect(Collectors.toList()).stream().distinct() param.getDataList().stream().map(ScreenProjectProcessFormDTO :: getProcessId).collect(Collectors.toList()).stream().distinct()
.collect(Collectors.toList()); .collect(Collectors.toList());
if (CollectionUtils.isEmpty(processIdList)){ if (CollectionUtils.isEmpty(processIdList)){
return; return;
} }
//删除旧数据 Lists.partition(processIdList, NumConstant.TWO_HUNDRED).forEach(list -> {
baseDao.deleteByProcessIds(param.getCustomerId(), processIdList); //删除旧数据
screenProjectProcessAttachmentDao.deleteByProcessIds(param.getCustomerId(), processIdList); baseDao.deleteByProcessIds(param.getCustomerId(), list);
screenProjectProcessAttachmentDao.deleteByProcessIds(param.getCustomerId(), list);
});
List<ScreenProjectProcessAttachmentEntity> attachmentList = new ArrayList<>(); List<ScreenProjectProcessAttachmentEntity> attachmentList = new ArrayList<>();

Loading…
Cancel
Save