Commit f5db1fdb authored by 高建强's avatar 高建强

item:巡检数据新增同步范围

parent c451df44
...@@ -2,6 +2,7 @@ package com.yeejoin.amos.patrol.business.dao.mapper; ...@@ -2,6 +2,7 @@ package com.yeejoin.amos.patrol.business.dao.mapper;
import com.yeejoin.amos.patrol.business.bo.CheckInputSyncBo; import com.yeejoin.amos.patrol.business.bo.CheckInputSyncBo;
import com.yeejoin.amos.patrol.business.dto.InputCheckDto; import com.yeejoin.amos.patrol.business.dto.InputCheckDto;
import com.yeejoin.amos.patrol.dao.entity.CheckInput;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
...@@ -15,4 +16,6 @@ public interface CheckInputMapper extends BaseMapper { ...@@ -15,4 +16,6 @@ public interface CheckInputMapper extends BaseMapper {
"itemId") Long itemId, @Param(value = "routePointItemId") Long routePointItemId, @Param(value = "checkInputId") Long checkInputId); "itemId") Long itemId, @Param(value = "routePointItemId") Long routePointItemId, @Param(value = "checkInputId") Long checkInputId);
List<CheckInputSyncBo> getCheckInputSyncBoList(Map<String, Object> map); List<CheckInputSyncBo> getCheckInputSyncBoList(Map<String, Object> map);
List<CheckInput> findByIdIn(Map<String, Object> map);
} }
...@@ -141,6 +141,7 @@ public class AcceptEquipmentRules { ...@@ -141,6 +141,7 @@ public class AcceptEquipmentRules {
map.put("id", checkInput.getId()); map.put("id", checkInput.getId());
List<CheckInputSyncBo> checkInputSyncBoList = checkInputMapper.getCheckInputSyncBoList(map); List<CheckInputSyncBo> checkInputSyncBoList = checkInputMapper.getCheckInputSyncBoList(map);
patrolDataSyncService.checkInputBoDataSync(checkInputSyncBoList); patrolDataSyncService.checkInputBoDataSync(checkInputSyncBoList);
patrolDataSyncService.checkInputDataSync(checkInput);
} }
}); });
log.info(checkInput.getPointClassifyName()+"规则校验返回结果修改成功"); log.info(checkInput.getPointClassifyName()+"规则校验返回结果修改成功");
......
...@@ -448,6 +448,7 @@ public class CheckServiceImpl implements ICheckService { ...@@ -448,6 +448,7 @@ public class CheckServiceImpl implements ICheckService {
map.put("idList", checkInputList.stream().map(CheckInput::getId).collect(Collectors.toList())); map.put("idList", checkInputList.stream().map(CheckInput::getId).collect(Collectors.toList()));
List<CheckInputSyncBo> checkInputSyncBoList = checkInputMapper.getCheckInputSyncBoList(map); List<CheckInputSyncBo> checkInputSyncBoList = checkInputMapper.getCheckInputSyncBoList(map);
patrolDataSyncService.checkInputBoDataSync(checkInputSyncBoList); patrolDataSyncService.checkInputBoDataSync(checkInputSyncBoList);
patrolDataSyncService.checkInputDataSync(checkInputList);
} }
}); });
return new CheckDto(check.getId(), unqualifiedcheckItemList); return new CheckDto(check.getId(), unqualifiedcheckItemList);
...@@ -699,6 +700,7 @@ public class CheckServiceImpl implements ICheckService { ...@@ -699,6 +700,7 @@ public class CheckServiceImpl implements ICheckService {
map.put("idList", checkInputList.stream().map(CheckInput::getId).collect(Collectors.toList())); map.put("idList", checkInputList.stream().map(CheckInput::getId).collect(Collectors.toList()));
List<CheckInputSyncBo> checkInputSyncBoList = checkInputMapper.getCheckInputSyncBoList(map); List<CheckInputSyncBo> checkInputSyncBoList = checkInputMapper.getCheckInputSyncBoList(map);
patrolDataSyncService.checkInputBoDataSync(checkInputSyncBoList); patrolDataSyncService.checkInputBoDataSync(checkInputSyncBoList);
patrolDataSyncService.checkInputDataSync(checkInputList);
} }
}); });
return checkDto; return checkDto;
......
...@@ -399,6 +399,8 @@ public class LatentDangerServiceImpl implements ILatentDangerService { ...@@ -399,6 +399,8 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
map.put("id", id); map.put("id", id);
List<CheckInputSyncBo> checkInputSyncBoList = checkInputMapper.getCheckInputSyncBoList(map); List<CheckInputSyncBo> checkInputSyncBoList = checkInputMapper.getCheckInputSyncBoList(map);
patrolDataSyncService.checkInputBoDataSync(checkInputSyncBoList); patrolDataSyncService.checkInputBoDataSync(checkInputSyncBoList);
List<CheckInput> checkInputList = checkInputMapper.findByIdIn(map);
patrolDataSyncService.checkInputDataSync(checkInputList);
} }
}); });
} }
......
...@@ -103,6 +103,21 @@ public class PatrolDataSyncServiceImpl implements IPatrolDataSyncService { ...@@ -103,6 +103,21 @@ public class PatrolDataSyncServiceImpl implements IPatrolDataSyncService {
} }
@Override @Override
public void checkInputDataSync(CheckInput checkInput) {
try {
if (checkInput != null) {
String message = buildSyncMessage(PatrolDataSyncTopicEnum.CHECK_INPUT.getTopic(), checkInput);
webMqttComponent.publish(PatrolDataSyncTopicEnum.EQM_PATROL_CREATED.getTopic(), message);
if (patrolSyncSwitch) {
webMqttComponent.publish(PatrolDataSyncTopicEnum.CHECK_INPUT.getTopic(), JSON.toJSONString(checkInput, SerializerFeature.WriteMapNullValue));
}
}
} catch (Exception e) {
log.error("站端与中心级巡检数据【checkInput】同步推送失败-----------" + e.getMessage());
}
}
@Override
public void checkInputDataSync(List<CheckInput> checkInputList) { public void checkInputDataSync(List<CheckInput> checkInputList) {
try { try {
if (CollectionUtils.isNotEmpty(checkInputList)) { if (CollectionUtils.isNotEmpty(checkInputList)) {
......
...@@ -21,6 +21,8 @@ public interface IPatrolDataSyncService { ...@@ -21,6 +21,8 @@ public interface IPatrolDataSyncService {
void checkDataSync(List<Check> checkList); void checkDataSync(List<Check> checkList);
void checkInputDataSync(CheckInput checkInput);
void checkInputDataSync(List<CheckInput> checkInputList); void checkInputDataSync(List<CheckInput> checkInputList);
void checkShotDataSync(List<CheckShot> checkShotList); void checkShotDataSync(List<CheckShot> checkShotList);
......
...@@ -388,6 +388,8 @@ public class JobService implements IJobService { ...@@ -388,6 +388,8 @@ public class JobService implements IJobService {
map.put("idList", checkInputIdList); map.put("idList", checkInputIdList);
List<CheckInputSyncBo> checkInputSyncBoList = checkInputMapper.getCheckInputSyncBoList(map); List<CheckInputSyncBo> checkInputSyncBoList = checkInputMapper.getCheckInputSyncBoList(map);
patrolDataSyncService.checkInputBoDataSync(checkInputSyncBoList); patrolDataSyncService.checkInputBoDataSync(checkInputSyncBoList);
List<CheckInput> checkInputList = checkInputMapper.findByIdIn(map);
patrolDataSyncService.checkInputDataSync(checkInputList);
} }
}); });
} }
......
...@@ -144,4 +144,18 @@ ...@@ -144,4 +144,18 @@
</if> </if>
</where> </where>
</select> </select>
<select id="findByIdIn" resultType="com.yeejoin.amos.patrol.dao.entity.CheckInput">
select * from p_check_input
<where>
<if test="id != null">
id = #{id}
</if>
<if test="idList != null and idList.size() >0">
AND id IN
<foreach collection="idList" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
</select>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment