Browse Source

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

master
yinzuomei 5 years ago
parent
commit
0d9c70578c
  1. 15
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EnvEnum.java
  2. 4
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/SubAgencyIndexRankPyFormDTO.java
  3. 3
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java
  4. 10
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java
  5. 4
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java
  6. 2
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml

15
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EnvEnum.java

@ -11,11 +11,14 @@ import org.springframework.core.env.Environment;
* @date 2020-07-03 11:14
**/
public enum EnvEnum {
LOCAL("local", "本地环境","http://localhost:8080/api/"),
DEV("dev", "开发环境","http://192.168.1.130:8080/api/"),
TEST("test", "体验环境","https://epmet-dev.elinkservice.cn/api/"),
PROD("prod", "生产环境","https://epmet-cloud.elinkservice.cn/api/"),
UN_KNOWN("un_known", "未知","https://epmet-dev.elinkservice.cn/api/"),
/**
* 环境变量枚举
*/
LOCAL("local", "本地环境", "http://localhost:8080/api/"),
DEV("dev", "开发环境", "http://192.168.1.130:8080/api/"),
TEST("test", "体验环境", "https://epmet-dev.elinkservice.cn/api/"),
PROD("prod", "生产环境", "https://epmet-cloud.elinkservice.cn/api/"),
UN_KNOWN("un_known", "未知", "https://epmet-dev.elinkservice.cn/api/"),
;
private String code;
@ -44,7 +47,7 @@ public enum EnvEnum {
try {
Environment environment = SpringContextUtils.getBean(Environment.class);
String[] activeProfiles = environment.getActiveProfiles();
if (activeProfiles != null && activeProfiles.length > 0) {
if (activeProfiles.length > 0) {
return getEnum(activeProfiles[0]);
}
} catch (Exception e) {

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

@ -6,6 +6,7 @@ import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* 描述一下
*
@ -35,4 +36,7 @@ public class SubAgencyIndexRankPyFormDTO implements Serializable {
@NotBlank(message = "type不能为空,街道:street;网格:grid")
private String type;
@NotBlank(message = "customerId不能为空")
private String customerId;
}

3
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java

@ -157,7 +157,8 @@ public class IndexController {
* @Date 2021/2/28 14:33
**/
@PostMapping("subagencyindexrank-py")
Result<List<SubAgencyIndexRankResultDTO>> subAgencyIndexRankPy(@RequestBody SubAgencyIndexRankPyFormDTO formDTO) {
Result<List<SubAgencyIndexRankResultDTO>> subAgencyIndexRankPy(@RequestHeader("CustomerId") String customerId,@RequestBody SubAgencyIndexRankPyFormDTO formDTO) {
formDTO.setCustomerId(customerId);
ValidatorUtils.validateEntity(formDTO);
return new Result<List<SubAgencyIndexRankResultDTO>>().ok(indexService.subAgencyIndexRankPy(formDTO));
}

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

@ -110,7 +110,10 @@ public interface ScreenIndexDataMonthlyDao{
* @Description 根据areaCode查询下级指数
* @author yinzuomei
*/
List<SubAgencyIndexRankResultDTO> selectSubStreetByAreaCode(@Param("yearId")String yearId, @Param("areaCode")String areaCode,@Param("topNum") int topNum);
List<SubAgencyIndexRankResultDTO> selectSubStreetByAreaCode(@Param("customerId") String customerId,
@Param("yearId") String yearId,
@Param("areaCode") String areaCode,
@Param("topNum") int topNum);
/**
* @param yearId
@ -118,5 +121,8 @@ public interface ScreenIndexDataMonthlyDao{
* @Description 根据areaCode查询网格指数
* @author yinzuomei
*/
List<SubAgencyIndexRankResultDTO> selectSubGridByAreaCode(@Param("yearId")String yearId, @Param("areaCode")String areaCode,@Param("topNum") int topNum);
List<SubAgencyIndexRankResultDTO> selectSubGridByAreaCode(@Param("customerId") String customerId,
@Param("yearId") String yearId,
@Param("areaCode") String areaCode,
@Param("topNum") int topNum);
}

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

@ -401,7 +401,7 @@ public class IndexServiceImpl implements IndexService {
LocalDate now = LocalDate.now().minusMonths(NumConstant.ONE);
String yearId = String.valueOf(now.getYear());
if("street".equals(formDTO.getType())){
List<SubAgencyIndexRankResultDTO> streetList = screenIndexDataMonthlyDao.selectSubStreetByAreaCode(yearId,formDTO.getAreaCode(),formDTO.getTopNum());
List<SubAgencyIndexRankResultDTO> streetList = screenIndexDataMonthlyDao.selectSubStreetByAreaCode(formDTO.getCustomerId(),yearId,formDTO.getAreaCode(),formDTO.getTopNum());
// 小数四舍五入
streetList.forEach(indexRank -> {
indexRank.setPartyDevAbility(getRound(indexRank.getPartyDevAbility()));
@ -411,7 +411,7 @@ public class IndexServiceImpl implements IndexService {
});
return streetList;
}
List<SubAgencyIndexRankResultDTO> gridList = screenIndexDataMonthlyDao.selectSubGridByAreaCode(yearId,formDTO.getAreaCode(),formDTO.getTopNum());
List<SubAgencyIndexRankResultDTO> gridList = screenIndexDataMonthlyDao.selectSubGridByAreaCode(formDTO.getCustomerId(),yearId,formDTO.getAreaCode(),formDTO.getTopNum());
// 小数四舍五入
gridList.forEach(indexRank -> {
indexRank.setPartyDevAbility(getRound(indexRank.getPartyDevAbility()));

2
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml

@ -299,6 +299,7 @@
WHERE
sca.del_flag = '0'
AND sca.PARENT_AREA_CODE=#{areaCode}
and sy.CUSTOMER_ID=#{customerId}
ORDER BY index_total DESC
LIMIT #{topNum}
</select>
@ -319,6 +320,7 @@
WHERE
scg.del_flag = '0'
AND scg.AREA_CODE like CONCAT(#{areaCode},'%')
and sy.CUSTOMER_ID=#{customerId}
ORDER BY index_total DESC
LIMIT #{topNum}
</select>

Loading…
Cancel
Save