Browse Source

Merge remote-tracking branch 'origin/dev_pyscreen' into dev_temp

dev_shibei_match
yinzuomei 5 years ago
parent
commit
395bc21935
  1. 18
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScreenProjectDistributionFormDTO.java
  2. 6
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java
  3. 5
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectDataDao.java
  4. 5
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java
  5. 7
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml
  6. 28
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java

18
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScreenProjectDistributionFormDTO.java

@ -2,6 +2,7 @@ package com.epmet.evaluationindex.screen.dto.form;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable; import java.io.Serializable;
/** /**
@ -13,9 +14,26 @@ import java.io.Serializable;
public class ScreenProjectDistributionFormDTO implements Serializable { public class ScreenProjectDistributionFormDTO implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/**
* 目前只有平阴在传默认赋值370124
*/
private String areaCode; private String areaCode;
/**
* 如果为空返回全部可选值1:红色事件2黄色事件3绿色事件
*/
private String level; private String level;
/**
* 当前组织id
*/
@NotBlank(message = "agencyId不能为空")
private String agencyId; private String agencyId;
/**
* 不必填默认查询的是处理中可选值all: 全部pending处理中 已结案closed_case 已关闭closed
* 默认查询pending
*/
private String status;
} }

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

@ -18,7 +18,6 @@ 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 lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
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.*;
@ -62,9 +61,10 @@ public class ScreenProjectController {
*/ */
@PostMapping("projectdistribution") @PostMapping("projectdistribution")
public Result projectDistribution(@RequestBody ScreenProjectDistributionFormDTO formDTO){ public Result projectDistribution(@RequestBody ScreenProjectDistributionFormDTO formDTO){
if (StringUtils.isBlank(formDTO.getAreaCode()) && StringUtils.isBlank(formDTO.getAgencyId())){ /*if (StringUtils.isBlank(formDTO.getAreaCode()) && StringUtils.isBlank(formDTO.getAgencyId())){
formDTO.setAreaCode("370124"); formDTO.setAreaCode("370124");
} }*/
ValidatorUtils.validateEntity(formDTO);
return screenProjectService.projectDistribution(formDTO); return screenProjectService.projectDistribution(formDTO);
} }

5
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectDataDao.java

@ -10,7 +10,10 @@ import java.util.List;
@Mapper @Mapper
public interface ScreenProjectDataDao { public interface ScreenProjectDataDao {
List<ScreenProjectDistributionResultDTO> projectDistribution(@Param("agencyId") String agencyId, @Param("ids") List<String> ids, @Param("level") String level); List<ScreenProjectDistributionResultDTO> projectDistribution(@Param("agencyId") String agencyId,
@Param("ids") List<String> ids,
@Param("level") String level,
@Param("status")String status);
List<String> selectIdsByAreaCode(@Param("areaCode") String areaCode); List<String> selectIdsByAreaCode(@Param("areaCode") String areaCode);

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

@ -70,11 +70,14 @@ 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 Result projectDistribution(ScreenProjectDistributionFormDTO formDTO) {
if(StringUtils.isBlank(formDTO.getStatus())){
formDTO.setStatus("pending");
}
List<String> areaIds = null; List<String> areaIds = null;
if (StringUtils.isNotBlank(formDTO.getAreaCode())){ if (StringUtils.isNotBlank(formDTO.getAreaCode())){
areaIds = screenProjectDataDao.selectIdsByAreaCode(formDTO.getAreaCode()); areaIds = screenProjectDataDao.selectIdsByAreaCode(formDTO.getAreaCode());
} }
List<ScreenProjectDistributionResultDTO> resultDTOS = screenProjectDataDao.projectDistribution(formDTO.getAgencyId(),areaIds,formDTO.getLevel()); List<ScreenProjectDistributionResultDTO> resultDTOS = screenProjectDataDao.projectDistribution(formDTO.getAgencyId(),areaIds,formDTO.getLevel(),formDTO.getStatus());
return new Result().ok(resultDTOS); return new Result().ok(resultDTOS);
} }

7
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml

@ -27,6 +27,13 @@
<if test="ids == null and agencyId != null"> <if test="ids == null and agencyId != null">
and org_id = #{agencyId} and org_id = #{agencyId}
</if> </if>
<choose>
<when test='"all" == status'>
</when>
<otherwise>
and PROJECT_STATUS_CODE=#{status}
</otherwise>
</choose>
</select> </select>
<select id="selectIdsByAreaCode" resultType="java.lang.String"> <select id="selectIdsByAreaCode" resultType="java.lang.String">
select agency_id as id from screen_customer_agency where del_flag = '0' and area_code like concat(#{areaCode},'%') select agency_id as id from screen_customer_agency where del_flag = '0' and area_code like concat(#{areaCode},'%')

28
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java

@ -786,14 +786,23 @@ public class DemoController {
} }
@PostMapping("event-all") @PostMapping("event-all-daily")
public Result screenProjectQuantityOrgMonthly(@RequestParam("customerId") String customerId, public Result eventAllDaily(@RequestParam("customerId") String customerId,
@RequestParam("dateId") String dateId, @RequestParam("dateId") String dateId) {
@RequestParam("monthId") String monthId) {
screenProjectGridDailyService.extractionProjectGridDaily(customerId, dateId); screenProjectGridDailyService.extractionProjectGridDaily(customerId, dateId);
screenProjectQuantityGridMonthlyService.extractionProjectGridMonthly(customerId, monthId);
screenProjectOrgDailyService.extractionProjectOrgDaily(customerId, dateId); screenProjectOrgDailyService.extractionProjectOrgDaily(customerId, dateId);
screenProjectQuantityOrgMonthlyService.extractionProjectOrgMonthly(customerId, monthId); return new Result();
}
@PostMapping("event-all-monthly")
public Result eventAllMonthly(@RequestParam("customerId") String customerId,
@RequestParam("startMonthId") String startMonthId,
@RequestParam("endMonthId") String endMonthId) {
List<String> monthIds = DateUtils.getMonthBetween(startMonthId,endMonthId);
for(String monthId:monthIds){
screenProjectQuantityGridMonthlyService.extractionProjectGridMonthly(customerId, monthId);
screenProjectQuantityOrgMonthlyService.extractionProjectOrgMonthly(customerId, monthId);
}
return new Result(); return new Result();
} }
@ -805,4 +814,11 @@ public class DemoController {
ndddYhjfService.difficultyDataHub(param); ndddYhjfService.difficultyDataHub(param);
return new Result(); return new Result();
} }
public static void main(String[] args) {
List<String> monthIds = DateUtils.getMonthBetween("202001","202012");
for(String monthId:monthIds){
System.out.println(monthId);
}
}
} }

Loading…
Cancel
Save