Browse Source

Merge branches 'dev_ic_diaodong' and 'develop' of http://git.elinkit.com.cn:7070/r/epmet-cloud into develop

dev
wangxianzhang 4 years ago
parent
commit
4ef2568b3b
  1. 9
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcStatsResiWarnServiceImpl.java
  2. 14
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

9
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcStatsResiWarnServiceImpl.java

@ -32,6 +32,7 @@ import com.epmet.dao.IcStatsResiWarnDao;
import com.epmet.dto.IcResiCategoryWarnConfigDTO; import com.epmet.dto.IcResiCategoryWarnConfigDTO;
import com.epmet.dto.IcStatsResiWarnDTO; import com.epmet.dto.IcStatsResiWarnDTO;
import com.epmet.dto.PersonWarnLeftPieDTO; import com.epmet.dto.PersonWarnLeftPieDTO;
import com.epmet.dto.result.CustomerCategoryShowAndWarnListResultDTO;
import com.epmet.dto.result.PersonWarnLeftPieResultDTO; import com.epmet.dto.result.PersonWarnLeftPieResultDTO;
import com.epmet.entity.IcStatsResiWarnEntity; import com.epmet.entity.IcStatsResiWarnEntity;
import com.epmet.feign.OperCustomizeOpenFeignClient; import com.epmet.feign.OperCustomizeOpenFeignClient;
@ -126,7 +127,7 @@ public class IcStatsResiWarnServiceImpl extends BaseServiceImpl<IcStatsResiWarnD
throw new EpmetException(String.format("未查询到此工作人员%s",tokenDto.getUserId())); throw new EpmetException(String.format("未查询到此工作人员%s",tokenDto.getUserId()));
} }
// 查询设置预警的分类 // 查询设置预警的分类
Result<List<IcResiCategoryWarnConfigDTO>> listResult = operCustomizeOpenFeignClient.resiCategoryWarnList(tokenDto.getCustomerId()); Result<List<CustomerCategoryShowAndWarnListResultDTO>> listResult = operCustomizeOpenFeignClient.getCustomerCategoryShowAndWarnList(tokenDto.getCustomerId());
if (!listResult.success()){ if (!listResult.success()){
throw new EpmetException("查询设置预警的分类失败..."); throw new EpmetException("查询设置预警的分类失败...");
} }
@ -134,16 +135,16 @@ public class IcStatsResiWarnServiceImpl extends BaseServiceImpl<IcStatsResiWarnD
if (CollectionUtils.isEmpty(listResult.getData())){ if (CollectionUtils.isEmpty(listResult.getData())){
return result; return result;
} }
List<IcResiCategoryWarnConfigDTO> configList = listResult.getData(); List<CustomerCategoryShowAndWarnListResultDTO> configList = listResult.getData();
List<PersonWarnLeftPieResultDTO.PersonWarnLeftPie> list = new ArrayList<>(); List<PersonWarnLeftPieResultDTO.PersonWarnLeftPie> list = new ArrayList<>();
configList.forEach(c -> { configList.forEach(c -> {
PersonWarnLeftPieResultDTO.PersonWarnLeftPie p = new PersonWarnLeftPieResultDTO.PersonWarnLeftPie(); PersonWarnLeftPieResultDTO.PersonWarnLeftPie p = new PersonWarnLeftPieResultDTO.PersonWarnLeftPie();
p.setTypeName(c.getLabel()); p.setTypeName(c.getLabel());
p.setTypeCode(c.getColumnName()); p.setTypeCode(c.getColumnName());
p.setConfigId(c.getId()); p.setConfigId(c.getWarnConfigId());
list.add(p); list.add(p);
}); });
List<PersonWarnLeftPieDTO> dtos = baseDao.selectCategoryCount(configList.stream().map(m -> m.getId()).collect(Collectors.toList()), staffInfo.getAgencyId()); List<PersonWarnLeftPieDTO> dtos = baseDao.selectCategoryCount(configList.stream().map(m -> m.getWarnConfigId()).collect(Collectors.toList()), staffInfo.getAgencyId());
if (CollectionUtils.isNotEmpty(dtos)){ if (CollectionUtils.isNotEmpty(dtos)){
list.forEach(l -> dtos.stream().filter(d -> d.getConfigId().equals(l.getConfigId())).forEach(d -> l.setTypeCount(d.getCount()))); list.forEach(l -> dtos.stream().filter(d -> d.getConfigId().equals(l.getConfigId())).forEach(d -> l.setTypeCount(d.getCount())));
} }

14
epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

@ -51,13 +51,6 @@
<if test="resultTableName != null and resultTableName != ''"> <if test="resultTableName != null and resultTableName != ''">
AND ${resultTableName}.ID IS NOT NULL AND ${resultTableName}.ID IS NOT NULL
</if> </if>
<if test="keyword != null and keyword != ''">
AND (
NAME = #{keyword}
or MOBILE = #{keyword}
or ID_CARD = #{keyword}
)
</if>
and ic_resi_user.customer_id=#{customerId} and ic_resi_user.customer_id=#{customerId}
and (ic_resi_user.AGENCY_ID =#{currentStaffAgencyId} or ic_resi_user.pids like concat(#{staffOrgPath},'%')) and (ic_resi_user.AGENCY_ID =#{currentStaffAgencyId} or ic_resi_user.pids like concat(#{staffOrgPath},'%'))
<if test="null != conditions and conditions.size() > 0"> <if test="null != conditions and conditions.size() > 0">
@ -129,6 +122,13 @@
</if> </if>
<where> <where>
<include refid="listWhereForPage"></include> <include refid="listWhereForPage"></include>
<if test="keyword != null and keyword != ''">
AND (
NAME = #{keyword}
or MOBILE = #{keyword}
or ID_CARD = #{keyword}
)
</if>
</where> </where>
group by IC_RESI_USER.id group by IC_RESI_USER.id
order by ic_resi_user.CREATED_TIME desc order by ic_resi_user.CREATED_TIME desc

Loading…
Cancel
Save