Browse Source

Merge remote-tracking branch 'origin/master'

thing_master
xiachao 1 year ago
parent
commit
574eaab6cf
  1. 4
      modules/alarm/src/main/java/com/thing/alarm/alarm/service/impl/AlarmRuleLogServiceImpl.java
  2. 11
      modules/alarm/src/main/java/com/thing/alarm/alarm/service/impl/AlarmRuleServiceImpl.java
  3. 6
      modules/alarm/src/main/resources/mapper/AlarmRuleEntityMapper.xml
  4. 6
      modules/alarm/src/main/resources/mapper/AlarmRuleLogMapper.xml

4
modules/alarm/src/main/java/com/thing/alarm/alarm/service/impl/AlarmRuleLogServiceImpl.java

@ -17,6 +17,7 @@ import com.thing.alarm.configuration.event.LogSaveActionEvent;
import com.thing.common.core.enumeration.AlarmStatus;
import com.thing.common.core.exception.SysException;
import com.thing.common.core.utils.DateTimeUtils;
import com.thing.common.core.utils.PageUtils;
import com.thing.common.core.web.response.PageData;
import com.thing.common.orm.annotation.DataFilter;
import com.thing.common.orm.service.impl.BaseServiceImpl;
@ -79,7 +80,8 @@ public class AlarmRuleLogServiceImpl extends BaseServiceImpl<AlarmRuleLogMapper,
}
List<AlarmRuleLogDTO> list = mapper.getList(params);
fillExtraInfo(list);
return new PageData<>(list, count);
List<AlarmRuleLogDTO> alarmRuleLogDTOS = PageUtils.startPage(list, page, limit);
return new PageData<>(alarmRuleLogDTOS, count);
}
private List<String> getThingCodesByPlantIds(Map<String, Object> params) {

11
modules/alarm/src/main/java/com/thing/alarm/alarm/service/impl/AlarmRuleServiceImpl.java

@ -98,10 +98,17 @@ public class AlarmRuleServiceImpl extends BaseServiceImpl<AlarmRuleMapper, Alarm
private void getIdByThingName(Map<String, Object> params) {
String thingName = (String) params.get("thingName");
if (StringUtils.isBlank(thingName)) {
String thingId = (String) params.get("thingId");
if (StringUtils.isBlank(thingName) && StringUtils.isBlank(thingId)) {
return;
}
paramsToLike(params, "thingName");
if (StringUtils.isNotBlank(thingName)) {
paramsToLike(params, "thingName");
}
if (StringUtils.isNotBlank(thingId)) {
List<Long> thingList = Arrays.stream(thingId.split(",")).map(Long::parseLong).toList();
params.put("thingIds", thingList);
}
List<AlarmRuleEntityDTO> list = alarmRuleEntityService.getThingNameList(params);
List<Long> collect = list.stream().map(AlarmRuleEntityDTO::getRuleId).distinct().collect(Collectors.toList());
params.put("ids", CollectionUtil.isNotEmpty(collect) ? collect : CollectionUtil.newArrayList(-1L));

6
modules/alarm/src/main/resources/mapper/AlarmRuleEntityMapper.xml

@ -31,6 +31,12 @@
#{id}
</foreach>
</if>
<if test="thingIds != null">
and a.thing_id in
<foreach item="thingId" collection="thingIds" open="(" separator="," close=")">
#{thingId}
</foreach>
</if>
</where>
</select>

6
modules/alarm/src/main/resources/mapper/AlarmRuleLogMapper.xml

@ -79,9 +79,9 @@
LEFT JOIN iot_thing_entity te ON ae.thing_id = te.id
</if>
<include refid="pageCondition" />
<if test="params.limit!=null and params.offset">
limit #{params.limit} offset #{params.offset}
</if>
<!-- <if test="params.limit!=null and params.offset">-->
<!-- limit #{params.limit} offset #{params.offset}-->
<!-- </if>-->
</select>
<select id="getProcessingUserList" resultType="com.thing.alarm.alarm.dto.AlarmProcessingUserDTO">

Loading…
Cancel
Save