Commit 8c5e31e9 authored by KeYong's avatar KeYong

风险查询业务数据接口

parent 058963b6
......@@ -81,9 +81,6 @@ public class EquipmentIndexVO {
@ApiModelProperty(value = "网关标识")
private String gatewayId;
@ApiModelProperty(value = "是否是告警设备")
private String isAlarm;
@ApiModelProperty(value = "装备名称")
private String equipmentSpecificName;
......
package com.yeejoin.equipmanage.common.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* @author keyong
* @title: RiskSourceTypeEnum
* <pre>
* @description: TODO
* </pre>
* @date 2023/8/2 18:40
*/
@Getter
@AllArgsConstructor
public enum RiskSourceTypeEnum {
EQUIP("equip", "装备告警"), PATROL("patrol", "巡检异常"),
HIDDENDANGER("danger", "隐患"), DEFECT("defect", "缺陷");
private String name;
private String describe;
}
......@@ -18,6 +18,8 @@ public class SendToMsgRiskEquipInfoVo {
// 装备名称
private String name;
private String value;
// 装备编码
private String code;
......
......@@ -4,17 +4,16 @@ import com.yeejoin.equipmanage.common.dto.FireRiskSourceDto;
import com.yeejoin.equipmanage.common.request.Common3dRequest;
import com.yeejoin.equipmanage.common.response.Common3dResponse;
import com.yeejoin.equipmanage.common.response.Common3dResponseUtil;
import com.yeejoin.equipmanage.common.utils.CommonResponseUtil;
import com.yeejoin.equipmanage.common.vo.Request3dVo;
import com.yeejoin.equipmanage.service.IRiskSourceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.List;
......@@ -56,4 +55,13 @@ public class RiskSourceController extends AbstractBaseController {
return Common3dResponseUtil.success(list);
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "获取巡检记录设备详情发送至风险", notes = "获取巡检记录设备详情发送至风险")
@RequestMapping(value = "/risk/equip/detail", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public ResponseModel getEquipDetailByCheckId( @RequestParam(value = "source") String source,
@RequestParam(value = "id") String id,
@RequestParam(value = "indexKey", required = false) String indexKey) {
return CommonResponseUtil.success(riskSourceService.getEquipmentToRiskInfo(source, id, indexKey));
}
}
......@@ -272,4 +272,8 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> {
List<String> selectIdsByPatrolCheck(String id);
List<Map<String, Object>> queryCheckInputItemsByCheckId(@Param(value="checkId") String checkId);
Map<String, Object> getPointById(@Param(value = "pointId") Long id);
}
......@@ -2,6 +2,8 @@ package com.yeejoin.equipmanage.service;
import com.yeejoin.equipmanage.common.dto.FireRiskSourceDto;
import com.yeejoin.equipmanage.common.vo.RiskBizInfoVo;
import com.yeejoin.equipmanage.common.vo.RiskDataVo;
import java.util.List;
......@@ -14,4 +16,6 @@ public interface IRiskSourceService {
* @return
*/
List<FireRiskSourceDto> getFiskSourceTierTree(Integer tier, Boolean isRegion);
RiskBizInfoVo getEquipmentToRiskInfo(String source, String id, String indexKey);
}
package com.yeejoin.amos.patrol.business.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.patrol.business.constants.XJConstant;
......@@ -50,10 +51,8 @@ import javax.xml.transform.*;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
import java.io.*;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;
......
......@@ -2374,6 +2374,56 @@
ppc.equipment_id = #{id}
</select>
<select id="queryCheckInputItemsByCheckId" resultType="Map">
SELECT
c.id,
c.point_id pointId,
ii.item_no,
ii.NAME inputItem,
ci.input_value,
CASE
ci.is_ok
WHEN 1 THEN
'合格'
WHEN 2 THEN
'不合格' ELSE '漏检'
END AS is_ok,
ii.biz_org_code,
ii.biz_org_name,
ci.score ,
ci.id as traceId,
ppc.equipment_id as equipId
FROM
p_check c
LEFT JOIN p_check_input ci ON ci.check_id = c.id
LEFT JOIN p_input_item ii ON ii.id = ci.input_id
LEFT JOIN p_point_classify ppc on ci.point_classify_id = ppc.id
WHERE
c.id = #{checkId}
ORDER BY
ci.order_no
</select>
<select id="getPointById" resultType="Map">
SELECT
p.id,
p.route_name routeName,
p.point_no pointNo,
p.NAME pointName,
(CASE p.is_fixed
WHEN 1 THEN
'固定点'
ELSE
'移动点'
END) fixed,
p.charge_person_name userName,
p.biz_org_name departmentName,
IFNULL(p.risk_source_id, '') as buildingId,
p.remark,
p.offline
FROM
p_point p
where p.id = #{pointId}
</select>
</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