Browse Source

Merge branch 'dev_bugfix_ljj'

dev
wangxianzhang 3 years ago
parent
commit
07504d21d5
  1. 24
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java
  2. 19
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml
  3. 2
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyRuleDetailDTO.java

24
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java

@ -149,10 +149,17 @@ public class ResiServiceImpl implements ResiService, ResultDataResolver {
// 使用年龄计算出生日期
if (resiRule != null) {
resiRule.stream().forEach((r) -> {
// 对生日列计算
if ("BIRTHDAY".equals(r.getColKey())) {
LocalDate birthday = LocalDate.now().minus(Long.valueOf(r.getColVal()), ChronoUnit.YEARS);
r.setQueryType(revertQueryType(r.getQueryType()));
r.setColVal(birthday.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
if ("is_null".equals(r.getQueryType()) || "is_not_null".equals(r.getQueryType())) {
// 如果是is_null、is_not_null,那么直接用这个条件
return;
} else {
//如果不是is_null、is_not_null,那么需要转换为出生日期
LocalDate birthday = LocalDate.now().minus(Long.valueOf(r.getColVal()), ChronoUnit.YEARS);
r.setQueryType(revertQueryType(r.getQueryType()));
r.setColVal(birthday.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
}
}
});
}
@ -209,7 +216,16 @@ public class ResiServiceImpl implements ResiService, ResultDataResolver {
resultResis.stream().forEach((r) -> {
// 小区名称
r.setNeighborHoodName(gridIdAndName.get(r.getGridId()).concat("-").concat(neighborhoodIdAndName.get(r.getNeighborhoodId())));
String gridName = gridIdAndName.get(r.getGridId());
String neighborhoodName = neighborhoodIdAndName.get(r.getNeighborhoodId());
if (StringUtils.isNoneBlank(gridName, neighborhoodName)) {
// 网格或者小区都能找到,给填充数据
r.setNeighborHoodName(gridIdAndName.get(r.getGridId()).concat("-").concat(neighborhoodIdAndName.get(r.getNeighborhoodId())));
} else {
// 网格或者小区中任何一个找不到,给个空
r.setNeighborHoodName("");
}
// 出生日期 & 年龄
if (r.getBirthday() != null) {

19
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml

@ -116,13 +116,24 @@
<if test="resiRules != null and resiRules.size() > 0">
and
<foreach collection="resiRules" item="rule" open="(" close=")">
${rule.colTable}.${rule.colKey} ${rule.queryType}
<choose>
<when test="rule.queryType == 'like'">
CONCAT('%',#{rule.colVal} ,'%')
<!--针对为空/不为空进行单独处理-->
<when test="rule.queryType == 'is_null'">
(${rule.colTable}.${rule.colKey} is null or ${rule.colTable}.${rule.colKey} = '')
</when>
<when test="rule.queryType == 'is_not_null'">
(${rule.colTable}.${rule.colKey} is not null and ${rule.colTable}.${rule.colKey} != '')
</when>
<otherwise>
#{rule.colVal}
${rule.colTable}.${rule.colKey} ${rule.queryType}
<choose>
<when test="rule.queryType == 'like'">
CONCAT('%',#{rule.colVal} ,'%')
</when>
<otherwise>
#{rule.colVal}
</otherwise>
</choose>
</otherwise>
</choose>
${rule.nextLogicalRel}

2
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyRuleDetailDTO.java

@ -64,7 +64,7 @@ public class IcPolicyRuleDetailDTO {
/**
* 参数值
*/
@NotBlank(message = "参数值不能为空", groups = {ResiRulerShowGroup.class,HouseRulerShowGroup.class,StatRulerShowGroup.class})
// @NotBlank(message = "参数值不能为空", groups = {ResiRulerShowGroup.class,HouseRulerShowGroup.class,StatRulerShowGroup.class})
private String colVal;
/**

Loading…
Cancel
Save