Commit bdbd215c authored by chenzhao's avatar chenzhao

修改代码

parent 0f0d4d3f
...@@ -19,6 +19,14 @@ public class RequestData { ...@@ -19,6 +19,14 @@ public class RequestData {
@ApiModelProperty(value = "纬度") @ApiModelProperty(value = "纬度")
private Double latitude; private Double latitude;
//视频匹配规则方便查询 增加第二个经纬度 用来传递 优先级2的坐标
@ApiModelProperty(value = "经度2")
private Double longitudeTwo;
@ApiModelProperty(value = "纬度2")
private Double latitudeTwo;
@ApiModelProperty(value = "距离") @ApiModelProperty(value = "距离")
private Double distance; private Double distance;
...@@ -48,4 +56,19 @@ public class RequestData { ...@@ -48,4 +56,19 @@ public class RequestData {
@ApiModelProperty(value = "排序") @ApiModelProperty(value = "排序")
private String orderTime; private String orderTime;
@ApiModelProperty(value = "筛选条件-建筑Id")
private String buildingId;
@ApiModelProperty(value = "筛选条件-视频类型")
private String type;
@ApiModelProperty(value = "筛选条件-视频编码")
private String code;
@ApiModelProperty(value = "筛选条件-视频名称")
private String remark;
@ApiModelProperty(value = "筛选条件-所属单位")
private String bizOrgCode;
} }
...@@ -4,7 +4,7 @@ import java.util.LinkedHashMap; ...@@ -4,7 +4,7 @@ import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import com.yeejoin.amos.boot.module.common.api.dto.CarInfoDto; import com.yeejoin.amos.boot.module.common.api.dto.*;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -20,9 +20,6 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel; ...@@ -20,9 +20,6 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.feign.MultipartSupportConfig; import com.yeejoin.amos.boot.biz.common.feign.MultipartSupportConfig;
import com.yeejoin.amos.boot.module.common.api.dto.EquipmentIndexDto;
import com.yeejoin.amos.boot.module.common.api.dto.PerfQuotaIotDTO;
import com.yeejoin.amos.boot.module.common.api.dto.VideoDto;
import com.yeejoin.amos.component.feign.config.InnerInvokException; import com.yeejoin.amos.component.feign.config.InnerInvokException;
/** /**
...@@ -212,7 +209,8 @@ public interface EquipFeignClient { ...@@ -212,7 +209,8 @@ public interface EquipFeignClient {
@RequestParam("buildingId") String buildingId, @RequestParam("buildingId") String buildingId,
@RequestParam("code") String code, @RequestParam("code") String code,
@RequestParam("equipmentName") String equipmentName, @RequestParam("equipmentName") String equipmentName,
@RequestParam("bizOrgCode") String bizOrgCode @RequestParam("bizOrgCode") String bizOrgCode,
@RequestParam("type") String type
); );
...@@ -243,6 +241,11 @@ public interface EquipFeignClient { ...@@ -243,6 +241,11 @@ public interface EquipFeignClient {
@RequestParam("latitude") Double latitude, @RequestParam("latitude") Double latitude,
@RequestParam("distance") Double distance); @RequestParam("distance") Double distance);
@RequestMapping(value = "/video/pageVideoByAlertType", method = RequestMethod.GET)
ResponseModel<Page<Map<String, Object>>> pageVideoByAlertType(@RequestParam("pageNum") Integer pageNum,
@RequestParam("pageSize") Integer pageSize,
@RequestParam("par") RequestData par);
@RequestMapping(value = "/video/pageList", method = RequestMethod.GET) @RequestMapping(value = "/video/pageList", method = RequestMethod.GET)
ResponseModel<Page<VideoDto>> pageList(@RequestParam("current") Integer current, ResponseModel<Page<VideoDto>> pageList(@RequestParam("current") Integer current,
...@@ -386,4 +389,7 @@ public interface EquipFeignClient { ...@@ -386,4 +389,7 @@ public interface EquipFeignClient {
@RequestMapping(value = "/building/companyBuildingTree", method = RequestMethod.GET) @RequestMapping(value = "/building/companyBuildingTree", method = RequestMethod.GET)
public ResponseModel<Object> getCompanyBuildingTree(); public ResponseModel<Object> getCompanyBuildingTree();
@RequestMapping(value = "/building/tree", method = RequestMethod.GET)
LinkedHashMap<String,Object> getTreeBuilding();
} }
...@@ -22,7 +22,7 @@ public interface KeySiteMapper extends BaseMapper<KeySite> { ...@@ -22,7 +22,7 @@ public interface KeySiteMapper extends BaseMapper<KeySite> {
*/ */
public IPage<KeySiteDto> getPageList(Page<KeySiteDto> page, String name, List<Long> buildingIds, String fireEnduranceRate, public IPage<KeySiteDto> getPageList(Page<KeySiteDto> page, String name, List<Long> buildingIds, String fireEnduranceRate,
String useNature, String fireFacilitiesInfo, String bizOrgCode); String useNature, String fireFacilitiesInfo, String bizOrgCode,String belongId);
/** /**
* 获取所有的重点部位数据 * 获取所有的重点部位数据
* @return * @return
......
...@@ -47,7 +47,7 @@ public interface WaterResourceMapper extends BaseMapper<WaterResource> { ...@@ -47,7 +47,7 @@ public interface WaterResourceMapper extends BaseMapper<WaterResource> {
*/ */
Page<WaterResourceDto> getWaterResourcePageByParams(Page<WaterResourceDto> page, String name, String resourceType, Page<WaterResourceDto> getWaterResourcePageByParams(Page<WaterResourceDto> page, String name, String resourceType,
ArrayList<Long> belongBuildingId, Long belongFightingSystemId, ArrayList<Long> belongBuildingId, Long belongFightingSystemId,
Long sequenceNbr, String equipId,String bizOrgCode, String equipCateGoryCode,List<String> ids); Long sequenceNbr, String equipId,String bizOrgCode, String equipCateGoryCode,List<String> ids,String companyId);
List<Map<String, Object>> getWaterTypeByBizOrgCode(String bizOrgCode); List<Map<String, Object>> getWaterTypeByBizOrgCode(String bizOrgCode);
} }
...@@ -53,6 +53,9 @@ ...@@ -53,6 +53,9 @@
<if test="fireEnduranceRate != null and fireEnduranceRate != ''"> <if test="fireEnduranceRate != null and fireEnduranceRate != ''">
AND c.`fire_endurance_rate`= #{fireEnduranceRate} AND c.`fire_endurance_rate`= #{fireEnduranceRate}
</if> </if>
<if test="belongId != null and belongId != '' and belongId != -1 ">
AND c.`belong_id`= #{belongId}
</if>
<if test="useNature != null and useNature != ''"> <if test="useNature != null and useNature != ''">
AND c.`use_nature`= #{useNature} AND c.`use_nature`= #{useNature}
</if> </if>
......
...@@ -968,7 +968,7 @@ LEFT JOIN ( ...@@ -968,7 +968,7 @@ LEFT JOIN (
FROM FROM
cb_org_usr usr cb_org_usr usr
where where
(usr.biz_org_type = 'COMPANY' OR usr.biz_org_type = 'DEPARTMENT') (usr.biz_org_type = 'COMPANY' OR usr.biz_org_type = 'DEPARTMENT') and usr.biz_org_code like concat (#{bizOrgCode},'%')
and usr.is_delete = false and usr.is_delete = false
</select> </select>
......
...@@ -149,7 +149,10 @@ ...@@ -149,7 +149,10 @@
</if> </if>
</if> </if>
<if test="belongBuildingId != null and belongBuildingId.size() > 0"> <if test="belongBuildingId != null and belongBuildingId.size() > 0">
and find_in_set(belong_building_id, #{belongBuildingId}) > 0 and belong_building_id in
<foreach collection="belongBuildingId" open="(" close=")" separator="," item="sid">
#{sid}
</foreach>
</if> </if>
<if test="ids != null and ids.size()>0"> <if test="ids != null and ids.size()>0">
AND sequence_nbr NOT IN AND sequence_nbr NOT IN
...@@ -158,6 +161,9 @@ ...@@ -158,6 +161,9 @@
</foreach> </foreach>
</if> </if>
<if test="bizOrgCode != null and bizOrgCode != ''">and biz_org_code like concat( #{bizOrgCode}, '%')</if> <if test="bizOrgCode != null and bizOrgCode != ''">and biz_org_code like concat( #{bizOrgCode}, '%')</if>
<if test="companyId != null and companyId != ''">
and management_unit_id = #{companyId}
</if>
order by cb_water_resource.rec_date desc order by cb_water_resource.rec_date desc
</select> </select>
<select id="getWaterTypeByBizOrgCode" resultType="map"> <select id="getWaterTypeByBizOrgCode" resultType="map">
......
...@@ -152,4 +152,6 @@ public class AlertCalled extends BaseEntity { ...@@ -152,4 +152,6 @@ public class AlertCalled extends BaseEntity {
private String systemSource; private String systemSource;
@ApiModelProperty(value = "系统来源code") @ApiModelProperty(value = "系统来源code")
private String systemSourceCode; private String systemSourceCode;
@ApiModelProperty(value = "物联报警关联Id")
private String relationId;
} }
...@@ -26,12 +26,10 @@ import com.yeejoin.amos.boot.module.common.api.feign.IotFeignClient; ...@@ -26,12 +26,10 @@ import com.yeejoin.amos.boot.module.common.api.feign.IotFeignClient;
import com.yeejoin.amos.boot.module.common.api.feign.VideoFeignClient; import com.yeejoin.amos.boot.module.common.api.feign.VideoFeignClient;
import com.yeejoin.amos.boot.module.common.api.service.*; import com.yeejoin.amos.boot.module.common.api.service.*;
import com.yeejoin.amos.boot.module.jcs.api.dto.*; import com.yeejoin.amos.boot.module.jcs.api.dto.*;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled; import com.yeejoin.amos.boot.module.jcs.api.entity.*;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.jcs.api.entity.PowerTransferCompanyResources;
import com.yeejoin.amos.boot.module.jcs.api.entity.UserCar;
import com.yeejoin.amos.boot.module.jcs.api.enums.AlertStageEnums; import com.yeejoin.amos.boot.module.jcs.api.enums.AlertStageEnums;
import com.yeejoin.amos.boot.module.jcs.api.enums.FireCarStatusEnum; import com.yeejoin.amos.boot.module.jcs.api.enums.FireCarStatusEnum;
import com.yeejoin.amos.boot.module.jcs.api.mapper.AirportStandMapper;
import com.yeejoin.amos.boot.module.jcs.api.mapper.PowerTransferCompanyResourcesMapper; import com.yeejoin.amos.boot.module.jcs.api.mapper.PowerTransferCompanyResourcesMapper;
import com.yeejoin.amos.boot.module.jcs.api.mapper.PowerTransferMapper; import com.yeejoin.amos.boot.module.jcs.api.mapper.PowerTransferMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.*; import com.yeejoin.amos.boot.module.jcs.api.service.*;
...@@ -44,6 +42,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -44,6 +42,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import org.typroject.tyboot.core.foundation.context.RequestContext; import org.typroject.tyboot.core.foundation.context.RequestContext;
...@@ -100,7 +99,6 @@ public class CommandController extends BaseController { ...@@ -100,7 +99,6 @@ public class CommandController extends BaseController {
IDutyCarService dutyCarService; IDutyCarService dutyCarService;
@Autowired @Autowired
IFireExpertsService fireExpertsService; IFireExpertsService fireExpertsService;
@Autowired @Autowired
IFirefightersService firefightersService; IFirefightersService firefightersService;
@Autowired @Autowired
...@@ -157,6 +155,11 @@ public class CommandController extends BaseController { ...@@ -157,6 +155,11 @@ public class CommandController extends BaseController {
@Autowired @Autowired
RestTemplate restTemplate; RestTemplate restTemplate;
@Autowired
AirportStandMapper airportStandMapper;
private static final String JW = "mechinePosition";
private static final String KEYSITE = "keySiteExcle";
/** /**
* 警情列表 * 警情列表
* *
...@@ -307,12 +310,69 @@ public class CommandController extends BaseController { ...@@ -307,12 +310,69 @@ public class CommandController extends BaseController {
@GetMapping(value = "video/list") @GetMapping(value = "video/list")
@ApiOperation(httpMethod = "GET", value = " 视频分页查询88", notes = "视频分页查询88") @ApiOperation(httpMethod = "GET", value = " 视频分页查询88", notes = "视频分页查询88")
public ResponseModel<Object> getVideo(Integer pageNum, Integer pageSize, RequestData par) { public ResponseModel<Object> getVideo(Integer pageNum, Integer pageSize, RequestData par) {
par.setDistance(500D);
ResponseModel<Map<String, Object>> result = null;
if (par.getAlertId() != null) { if (par.getAlertId() != null) {
AlertCalled alertCalled = iAlertCalledService.getAlertCalledById(par.getAlertId()); AlertCalled alertCalled = iAlertCalledService.getAlertCalledById(par.getAlertId());
par.setLatitude(alertCalled.getCoordinateX()); List<AlertFormValue> list = alertFormValueService.getzqlist(alertCalled.getSequenceNbr());
par.setLongitude(alertCalled.getCoordinateY()); switch (alertCalled.getAlertTypeCode()){
case "230":
case "237":
case "238":
for (AlertFormValue alertFormValue : list) {
if (alertFormValue.getFieldCode().equals(JW) && !StringUtils.isEmpty(alertFormValue.getFieldValue())){
QueryWrapper<AirportStand> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("stand_code",alertFormValue.getFieldValue());
AirportStand airportStand = airportStandMapper.selectOne(queryWrapper);
par.setLatitude(Double.valueOf(airportStand.getLatitude()));
par.setLongitude(Double.valueOf(airportStand.getLongitude()));
}
}
par.setLatitudeTwo(alertCalled.getCoordinateX());
par.setLongitudeTwo(alertCalled.getCoordinateY());
break;
case "229":
if (alertCalled.getAlertSourceCode().equals("1326")){
result = this.getDetailsById(Long.valueOf(alertCalled.getRelationId()),null,null,null);
par.setLatitudeTwo(alertCalled.getCoordinateX());
par.setLongitudeTwo(alertCalled.getCoordinateY());
}else {
for (AlertFormValue alertFormValue : list) {
if (alertFormValue.getFieldCode().equals(KEYSITE) && !StringUtils.isEmpty(alertFormValue.getFieldValueCode())) {
KeySiteDto keySiteDto = keySiteService.getSequenceNbr(Long.parseLong(alertFormValue.getFieldValueCode()));
par.setBuildingId( keySiteDto.getBuildingId().toString()) ;
}
}
}
break;
case "235":
par.setLatitude(alertCalled.getCoordinateX());
par.setLongitude(alertCalled.getCoordinateY());
break;
}
}
ResponseModel<Page<Map<String, Object>>> data = null;
if (ValidationUtil.isEmpty(par.getLatitudeTwo()) ){
data = equipFeignClient.getVideopag(pageNum == 0 ? "1" : pageNum.toString(), pageSize.toString(),par.getBuildingId(),par.getCode(),null,par.getBizOrgCode(),par.getType());
}else {
data = equipFeignClient.pageVideoByAlertType(pageNum == 0 ? 1 : pageNum, pageSize, par);
} }
ResponseModel<Page<Map<String, Object>>> data = equipFeignClient.pageVideo(pageNum == 0 ? 1 : pageNum, pageSize, par.getLongitude(), par.getLatitude(), par.getDistance());
if (!ObjectUtils.isEmpty(result)&&!ObjectUtils.isEmpty(result.getResult().get("video"))){
List<Map<String, Object>> records = result != null ? (List<Map<String, Object>>) result.getResult().get("video") : null;
Page<Map<String, Object>> page = data.getResult();
records.addAll(data.getResult().getRecords());
page.setRecords(records);
data.setResult(page);
}
// ResponseModel<Page<Map<String, Object>>> data = equipFeignClient.pageVideo(pageNum == 0 ? 1 : pageNum, pageSize, par.getLongitude(), par.getLatitude(), par.getDistance());
Page<Map<String, Object>> pag = data != null ? data.getResult() : null; Page<Map<String, Object>> pag = data != null ? data.getResult() : null;
List<Map<String, Object>> records = pag != null ? pag.getRecords() : null; List<Map<String, Object>> records = pag != null ? pag.getRecords() : null;
if (records != null && records.size() > 0) { if (records != null && records.size() > 0) {
...@@ -338,7 +398,7 @@ public class CommandController extends BaseController { ...@@ -338,7 +398,7 @@ public class CommandController extends BaseController {
String bizOrgCode String bizOrgCode
) { ) {
ResponseModel<Page<Map<String, Object>>> data = equipFeignClient.getVideopag(current, size, buildingId, code, equipmentName, bizOrgCode); ResponseModel<Page<Map<String, Object>>> data = equipFeignClient.getVideopag(current, size, buildingId, code, equipmentName, bizOrgCode,null);
Page<Map<String, Object>> pag = data != null ? data.getResult() : null; Page<Map<String, Object>> pag = data != null ? data.getResult() : null;
List<Map<String, Object>> records = pag != null ? pag.getRecords() : null; List<Map<String, Object>> records = pag != null ? pag.getRecords() : null;
if (records != null && records.size() > 0) { if (records != null && records.size() > 0) {
......
...@@ -322,13 +322,13 @@ public class KeySiteController extends BaseController { ...@@ -322,13 +322,13 @@ public class KeySiteController extends BaseController {
@RequestParam(value = "size") int size, @RequestParam(required = false) String name, @RequestParam(value = "size") int size, @RequestParam(required = false) String name,
@RequestParam(required = false) Long buildingId, @RequestParam(required = false) String fireEnduranceRate, @RequestParam(required = false) Long buildingId, @RequestParam(required = false) String fireEnduranceRate,
@RequestParam(required = false) String useNature, @RequestParam(required = false) String fireFacilitiesInfo, @RequestParam(required = false) String useNature, @RequestParam(required = false) String fireFacilitiesInfo,
@RequestParam(required = false) String bizOrgCode) { @RequestParam(required = false) String bizOrgCode,@RequestParam(required = false) String belongId) {
Page<KeySiteDto> page = new Page<KeySiteDto>(); Page<KeySiteDto> page = new Page<KeySiteDto>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
return ResponseHelper.buildResponse(keySiteServiceImpl.getPageList(page, name, buildingId, fireEnduranceRate, return ResponseHelper.buildResponse(keySiteServiceImpl.getPageList(page, name, buildingId, fireEnduranceRate,
useNature, fireFacilitiesInfo, bizOrgCode)); useNature, fireFacilitiesInfo, bizOrgCode,belongId));
} }
/** /**
...@@ -352,7 +352,7 @@ public class KeySiteController extends BaseController { ...@@ -352,7 +352,7 @@ public class KeySiteController extends BaseController {
page.setSize(size); page.setSize(size);
return ResponseHelper.buildResponse(keySiteServiceImpl.getPageList(page, name, buildingId, fireEnduranceRate, return ResponseHelper.buildResponse(keySiteServiceImpl.getPageList(page, name, buildingId, fireEnduranceRate,
useNature, fireFacilitiesInfo, bizOrgCode)); useNature, fireFacilitiesInfo, bizOrgCode,null));
} }
@PersonIdentify @PersonIdentify
......
...@@ -26,6 +26,7 @@ import org.springframework.beans.factory.annotation.Value; ...@@ -26,6 +26,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
...@@ -436,14 +437,30 @@ public class WaterResourceController extends BaseController { ...@@ -436,14 +437,30 @@ public class WaterResourceController extends BaseController {
@RequestParam(value = "classifyId", required = false) String classifyId, @RequestParam(value = "classifyId", required = false) String classifyId,
@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode, @RequestParam(value = "bizOrgCode", required = false) String bizOrgCode,
@RequestParam(value = "equipCateGoryCode", required = false) String equipCateGoryCode, @RequestParam(value = "equipCateGoryCode", required = false) String equipCateGoryCode,
@RequestParam(value = "companyId", required = false) String companyId,
@RequestParam(value = "ids", required = false) List<String> ids) { @RequestParam(value = "ids", required = false) List<String> ids) {
Page<WaterResourceDto> page = new Page<>(); Page<WaterResourceDto> page = new Page<>();
page.setCurrent(pageNum); page.setCurrent(pageNum);
page.setSize(pageSize); page.setSize(pageSize);
//消防巡查 巡查对象用
if (belongBuildingId != null && belongBuildingId.size() == 1 ){
LinkedHashMap<String,Object> o = equipFeignClient.getTreeBuilding();
if(o==null||!"200".equals(o.get("status").toString())) {
throw new BadRequest("获取建筑树出错");
}
List<Map<String, Object>> buildingTree = (List<Map<String, Object>>) o.get("result");
ArrayList<Long> finalBelongBuildingId = belongBuildingId;
Map<String, Object> node = getAllNodes(buildingTree).stream().filter(map -> finalBelongBuildingId.get(0).toString().equals(map.get("id"))).findFirst().orElse(null);
if (node != null) {
belongBuildingId = findBuildChildrenIds(node);
}
}
/*bug 2913 更换保存方式 存储到公共附件表 chenzhao 2021-10-18 start*/ /*bug 2913 更换保存方式 存储到公共附件表 chenzhao 2021-10-18 start*/
Page<WaterResourceDto> waterResourceDtoPage = waterResourceServiceImpl.queryForWaterResourcePage(page, name, resourceType, Page<WaterResourceDto> waterResourceDtoPage = waterResourceServiceImpl.queryForWaterResourcePage(page, name, resourceType,
belongBuildingId, belongFightingSystemId, sequenceNbr, classifyId, bizOrgCode, equipCateGoryCode,ids); belongBuildingId, belongFightingSystemId, sequenceNbr, classifyId, bizOrgCode, equipCateGoryCode,ids,companyId);
List<WaterResourceDto> records = waterResourceDtoPage.getRecords(); List<WaterResourceDto> records = waterResourceDtoPage.getRecords();
records.forEach(i -> { records.forEach(i -> {
Map<String, List<AttachmentDto>> attachments = sourceFileService.getAttachments(i.getSequenceNbr()); Map<String, List<AttachmentDto>> attachments = sourceFileService.getAttachments(i.getSequenceNbr());
...@@ -455,6 +472,29 @@ public class WaterResourceController extends BaseController { ...@@ -455,6 +472,29 @@ public class WaterResourceController extends BaseController {
return ResponseHelper.buildResponse(waterResourceDtoPage); return ResponseHelper.buildResponse(waterResourceDtoPage);
} }
private ArrayList<Long> findBuildChildrenIds(Map<String, Object> building) {
List<Map<String, Object>> buildingTree = getAllNodes(Collections.singletonList(building));
ArrayList<Long> objects = new ArrayList<>();
List<Long> id = buildingTree.stream().map(building123 -> Long.valueOf(building123.get("id").toString())).collect(Collectors.toList());
if (id.size()>0){
objects.addAll(id);
}
return objects;
}
private List<Map<String, Object>> getAllNodes(List<Map<String, Object>> buildingTree) {
List<Map<String, Object>> res = new LinkedList<>();
if (buildingTree != null && !buildingTree.isEmpty()) {
res.addAll(buildingTree);
buildingTree.forEach(building -> {
List<Map<String, Object>> childrenTree = (List<Map<String, Object>>) building.get("children");
res.addAll(getAllNodes(childrenTree));
});
}
return res;
}
/** /**
* 列表全部数据查询 * 列表全部数据查询
* *
......
...@@ -87,12 +87,12 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite ...@@ -87,12 +87,12 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
* 分页查询 * 分页查询
*/ */
public IPage<KeySiteDto> getPageList(Page<KeySiteDto> page, String name, Long buildingId, String fireEnduranceRate, public IPage<KeySiteDto> getPageList(Page<KeySiteDto> page, String name, Long buildingId, String fireEnduranceRate,
String useNature, String fireFacilitiesInfo, String bizOrgCode) { String useNature, String fireFacilitiesInfo, String bizOrgCode,String belongId) {
List<Long> ids = null; List<Long> ids = null;
if (buildingId != null&& buildingId!=-1 && buildingId.intValue() != 0) { if (buildingId != null&& buildingId!=-1 && buildingId.intValue() != 0) {
ids = getNodeAllnodeIds(buildingId); ids = getNodeAllnodeIds(buildingId);
} }
return keySiteMapper.getPageList(page, name, ids, fireEnduranceRate, useNature, fireFacilitiesInfo, bizOrgCode); return keySiteMapper.getPageList(page, name, ids, fireEnduranceRate, useNature, fireFacilitiesInfo, bizOrgCode,belongId);
} }
@Override @Override
......
...@@ -87,9 +87,9 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate ...@@ -87,9 +87,9 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate
@Condition(Operator.eq) Long sequenceNbr, @Condition(Operator.eq) Long sequenceNbr,
String equipId, String equipId,
String bizOrgCode, String bizOrgCode,
String equipCateGoryCode,List<String> ids) { String equipCateGoryCode,List<String> ids, String companyId) {
return this.waterResourceMapper.getWaterResourcePageByParams(page, name, resourceType, belongBuildingId, return this.waterResourceMapper.getWaterResourcePageByParams(page, name, resourceType, belongBuildingId,
belongFightingSystemId, sequenceNbr, equipId, bizOrgCode, equipCateGoryCode,ids); belongFightingSystemId, sequenceNbr, equipId, bizOrgCode, equipCateGoryCode,ids,companyId);
} }
/** /**
......
...@@ -54,10 +54,11 @@ public class EquipmentManageController extends AbstractBaseController{ ...@@ -54,10 +54,11 @@ public class EquipmentManageController extends AbstractBaseController{
@RequestParam(value = "maintenance",required = false) String maintenance, @RequestParam(value = "maintenance",required = false) String maintenance,
@RequestParam(value = "maintenance",required = false) String bizOrgCode, @RequestParam(value = "maintenance",required = false) String bizOrgCode,
@RequestParam(value = "maintenance",required = false) String formGroupId, @RequestParam(value = "maintenance",required = false) String formGroupId,
@RequestParam(value = "controBoxBuildId",required = false) String controBoxBuildId,
@RequestParam(value = "current") int current, @RequestParam(value = "current") int current,
@RequestParam(value = "size") int pageSize @RequestParam(value = "size") int pageSize
) { ) {
return equipmentManageService.queryEquipmenInfoAndCount(equipmentName,equipmentCode,construction,maintenance,bizOrgCode,formGroupId,current,pageSize); return equipmentManageService.queryEquipmenInfoAndCount(equipmentName,equipmentCode,construction,maintenance,bizOrgCode,formGroupId,current,pageSize,controBoxBuildId);
} }
@GetMapping(value = "/getUtils") @GetMapping(value = "/getUtils")
......
...@@ -7,8 +7,10 @@ import java.util.List; ...@@ -7,8 +7,10 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.equipmanage.common.entity.*; import com.yeejoin.equipmanage.common.entity.*;
import com.yeejoin.equipmanage.common.utils.SpringUtils; import com.yeejoin.equipmanage.common.utils.SpringUtils;
import com.yeejoin.equipmanage.fegin.JcsFeign;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
...@@ -102,6 +104,8 @@ public class FireFightingSystemController extends AbstractBaseController { ...@@ -102,6 +104,8 @@ public class FireFightingSystemController extends AbstractBaseController {
IEquipmentService iEquipmentService; IEquipmentService iEquipmentService;
@Autowired @Autowired
FireFightingSystemMapper fireFightingSystemMapper; FireFightingSystemMapper fireFightingSystemMapper;
@Autowired
JcsFeign jcsFeign;
@Value("${equipment.hierarchy}") @Value("${equipment.hierarchy}")
private String hierarchy; private String hierarchy;
...@@ -490,13 +494,25 @@ public class FireFightingSystemController extends AbstractBaseController { ...@@ -490,13 +494,25 @@ public class FireFightingSystemController extends AbstractBaseController {
@RequestParam(value = "maintenance", required = false) String maintenance, @RequestParam(value = "maintenance", required = false) String maintenance,
@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode, @RequestParam(value = "bizOrgCode", required = false) String bizOrgCode,
@RequestParam(value = "formGroupId", required = false) String formGroupId, @RequestParam(value = "formGroupId", required = false) String formGroupId,
@RequestParam(value = "controBoxBuildId", required = false) String controBoxBuildId,
@RequestParam(value = "current") int current, @RequestParam(value = "current") int current,
@RequestParam(value = "size") int pageSize @RequestParam(value = "size") int pageSize, @RequestParam(value = "companyId",required = false) String companyId
) { ) {
if (current > 0){ if (current > 0){
current = (current - 1) * pageSize; current = (current - 1) * pageSize;
} }
return fireFightingSystemService.queryEquipmenInfoAndCount(equipmentName, equipmentCode, construction, maintenance, bizOrgCode, formGroupId, current, pageSize); if (StringUtil.isNotEmpty(companyId)){
String token = getToken();
String appKey = getAppKey();
String product = getProduct();
ResponseModel<JSONObject> obj = jcsFeign.getUnitById(appKey,product,token,companyId);
JSONObject result = obj.getResult();
if (result.containsKey("bizOrgCode")) {
bizOrgCode = result.get("bizOrgCode").toString();
}
}
return fireFightingSystemService.queryEquipmenInfoAndCount(equipmentName, equipmentCode, construction, maintenance, bizOrgCode, formGroupId, current, pageSize,controBoxBuildId);
} }
/** /**
......
...@@ -263,10 +263,11 @@ public class RiskSourceSceneController extends AbstractBaseController { ...@@ -263,10 +263,11 @@ public class RiskSourceSceneController extends AbstractBaseController {
@RequestParam(value = "sourceId") String sourceId, @RequestParam(value = "sourceId") String sourceId,
@RequestParam(value = "categoryId" ,required = false) String categoryId, @RequestParam(value = "categoryId" ,required = false) String categoryId,
@RequestParam(value = "equipCode",required = false) String equipCode, @RequestParam(value = "equipCode",required = false) String equipCode,
@RequestParam(value = "equipName",required = false) String equipName @RequestParam(value = "equipName",required = false) String equipName,
@RequestParam(value = "companyId",required = false) String companyId
) { ) {
Page page = new Page(pageNumber, pageSize); Page page = new Page(pageNumber, pageSize);
return iRiskSourceSceneService.getEquipBySourceId(page, sourceId,categoryId,equipCode,equipName); return iRiskSourceSceneService.getEquipBySourceId(page, sourceId,categoryId,equipCode,equipName,companyId);
} }
} }
...@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject; ...@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto; import com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto;
import com.yeejoin.equipmanage.common.entity.RequestData;
import com.yeejoin.equipmanage.common.entity.Video; import com.yeejoin.equipmanage.common.entity.Video;
import com.yeejoin.equipmanage.common.entity.dto.VideoDTO; import com.yeejoin.equipmanage.common.entity.dto.VideoDTO;
import com.yeejoin.equipmanage.common.entity.dto.VideoSaveDto; import com.yeejoin.equipmanage.common.entity.dto.VideoSaveDto;
...@@ -197,6 +198,31 @@ public class VideoController extends AbstractBaseController { ...@@ -197,6 +198,31 @@ public class VideoController extends AbstractBaseController {
return CommonResponseUtil.success(pageBean); return CommonResponseUtil.success(pageBean);
} }
/**
* 视频分页资源查询
*
* @return
*/
@RequestMapping(value = "/pageVideoByAlertType", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "视频分页资源查询", notes = "视频分页资源查询")
public ResponseModel<Page<VideoListVo>> pageVideoByAlertType(Integer pageNum, Integer pageSize, RequestData par) {
if (null == pageNum || null == pageSize) {
pageNum = 1;
pageSize = Integer.MAX_VALUE;
} else {
pageNum = (pageNum - 1) * pageSize;
}
List<VideoListVo> listVos = videoService.pageVideoListByAlert(pageNum, pageSize, par);
int num = videoService.VideoListByAlertCount(par);
Page<VideoListVo> pageBean = new Page<>(pageNum, pageSize);
pageBean.setRecords(listVos);
pageBean.setTotal(num);
return CommonResponseUtil.success(pageBean);
}
/** /**
* 详情 * 详情
......
...@@ -180,9 +180,9 @@ public class WarehouseStructureController extends AbstractBaseController { ...@@ -180,9 +180,9 @@ public class WarehouseStructureController extends AbstractBaseController {
@RequestMapping(value = "/gettree/{id}", method = RequestMethod.GET) @RequestMapping(value = "/gettree/{id}", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "树查询", notes = "树查询") @ApiOperation(httpMethod = "GET", value = "树查询", notes = "树查询")
public List<WarehouseStructure> gettree(@PathVariable Long id,String bizOrgCode) { public List<WarehouseStructure> gettree(@PathVariable Long id,String bizOrgCode,String buildingId) {
return iWarehouseStructureService.gettree(id,bizOrgCode); return iWarehouseStructureService.gettree(id,bizOrgCode,buildingId);
} }
/** /**
......
...@@ -87,7 +87,7 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> { ...@@ -87,7 +87,7 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> {
List<String> getEquipmentIotCodeLists(); List<String> getEquipmentIotCodeLists();
List<HashMap<String, Object>> getEquipBySourceId(@Param("sourceIds") List<Long> sourceIds, @Param("categoryId") List<Long> categoryId, @Param("equipCode") String equipCode, @Param("equipName") String equipName); List<HashMap<String, Object>> getEquipBySourceId(@Param("sourceIds") List<Long> sourceIds, @Param("categoryId") List<Long> categoryId, @Param("equipCode") String equipCode, @Param("equipName") String equipName,@Param("companyId") String companyId);
List getMenuChildren(@Param("id") Long id); List getMenuChildren(@Param("id") Long id);
......
...@@ -3,6 +3,7 @@ package com.yeejoin.equipmanage.mapper; ...@@ -3,6 +3,7 @@ package com.yeejoin.equipmanage.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.equipmanage.common.entity.RequestData;
import com.yeejoin.equipmanage.common.entity.Video; import com.yeejoin.equipmanage.common.entity.Video;
import com.yeejoin.equipmanage.common.entity.vo.*; import com.yeejoin.equipmanage.common.entity.vo.*;
import com.yeejoin.equipmanage.dto.CountDto; import com.yeejoin.equipmanage.dto.CountDto;
...@@ -25,6 +26,7 @@ public interface VideoMapper extends BaseMapper<Video> { ...@@ -25,6 +26,7 @@ public interface VideoMapper extends BaseMapper<Video> {
/** /**
* 视屏监控绑定的消防设备查询 * 视屏监控绑定的消防设备查询
*
* @param videoId * @param videoId
* @return * @return
*/ */
...@@ -32,6 +34,7 @@ public interface VideoMapper extends BaseMapper<Video> { ...@@ -32,6 +34,7 @@ public interface VideoMapper extends BaseMapper<Video> {
/** /**
* 视屏监控绑定的电力设备查询 * 视屏监控绑定的电力设备查询
*
* @param videoId * @param videoId
* @return * @return
*/ */
...@@ -39,16 +42,18 @@ public interface VideoMapper extends BaseMapper<Video> { ...@@ -39,16 +42,18 @@ public interface VideoMapper extends BaseMapper<Video> {
/** /**
* 获取监控 * 获取监控
*
* @param id * @param id
* @return * @return
*/ */
List<AlamVideoVO> getVideoBySpeId(Long id); List<AlamVideoVO> getVideoBySpeId(Long id);
AlamVideoVO getVideoById(Long id); AlamVideoVO getVideoById(Long id);
/** /**
* 可乐视频列表展示 * 可乐视频列表展示
*
* @param page * @param page
* @param dto * @param dto
* @return * @return
...@@ -65,28 +70,35 @@ public interface VideoMapper extends BaseMapper<Video> { ...@@ -65,28 +70,35 @@ public interface VideoMapper extends BaseMapper<Video> {
/** /**
* 视屏监控绑定的安防消防设备查询 * 视屏监控绑定的安防消防设备查询
*
* @param id * @param id
* @return * @return
*/ */
BuildingListVO getSecurityOrFireEquipment(@Param("id") Long id); BuildingListVO getSecurityOrFireEquipment(@Param("id") Long id);
List<String> selectBuildList(Long id); List<String> selectBuildList(Long id);
List<EquipmentSpecificVo> selectImportantEquipment();
List<VideoListVo> pageVideoList(@Param("pageNum") Integer pageNum,
@Param("pageSize") Integer pageSize,
@Param("longitude") Double longitude,
@Param("latitude") Double latitude,
@Param("distance") Double distance);
List<VideoListVo> pageVideoListByAlert(@Param("pageNum") Integer pageNum,
@Param("pageSize") Integer pageSize,
@Param("par") RequestData par);
List<EquipmentSpecificVo> selectImportantEquipment(); int VideoListByAlertCount( @Param("par") RequestData par);
List<VideoListVo> pageVideoList(@Param("pageNum")Integer pageNum, int pageVideoCount(@Param("longitude") Double longitude,
@Param("pageSize")Integer pageSize, @Param("latitude") Double latitude,
@Param("longitude")Double longitude, @Param("distance") Double distance);
@Param("latitude")Double latitude,
@Param("distance")Double distance) ;
int pageVideoCount( @Param("longitude")Double longitude, List<VideoListVo> listByType(@Param("type") String type);
@Param("latitude")Double latitude,
@Param("distance")Double distance) ;
List<VideoListVo>listByType(@Param("type")String type); List<Video> listByCode(@Param("code") String code);
List<Video>listByCode(@Param("code")String code);
List<Video> selectListBySourceId(Long floorId); List<Video> selectListBySourceId(Long floorId);
......
...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService; ...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.yeejoin.equipmanage.common.entity.EquipmentManageEntity; import com.yeejoin.equipmanage.common.entity.EquipmentManageEntity;
import com.yeejoin.equipmanage.common.vo.EquipmentManageVo; import com.yeejoin.equipmanage.common.vo.EquipmentManageVo;
import com.yeejoin.equipmanage.common.vo.FileUploadVo; import com.yeejoin.equipmanage.common.vo.FileUploadVo;
import liquibase.pro.packaged.S;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.List; import java.util.List;
...@@ -26,7 +27,7 @@ public interface EquipmentManageService extends IService<EquipmentManageEntity> ...@@ -26,7 +27,7 @@ public interface EquipmentManageService extends IService<EquipmentManageEntity>
* @param pageSize * @param pageSize
* @return * @return
*/ */
Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction, String maintenance, String bizOrgCode, String formGroupId , int spage, int pageSize); Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction, String maintenance, String bizOrgCode, String formGroupId , int spage, int pageSize, String controBoxBuildId);
/** /**
* 获取下拉菜单数据 * 获取下拉菜单数据
......
...@@ -34,7 +34,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE ...@@ -34,7 +34,7 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
* @param pageSize * @param pageSize
* @return * @return
*/ */
Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction, String maintenance, String bizOrgCode, String formGroupId, int current, int pageSize); Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction, String maintenance, String bizOrgCode, String formGroupId, int current, int pageSize,String controBoxBuildId);
FireFightingSystemEntity getOneById(Long id); FireFightingSystemEntity getOneById(Long id);
......
...@@ -137,6 +137,6 @@ public interface IRiskSourceSceneService extends IService <RiskSourceScene> { ...@@ -137,6 +137,6 @@ public interface IRiskSourceSceneService extends IService <RiskSourceScene> {
* @param riskSourceId 风险区域ID * @param riskSourceId 风险区域ID
* @return 分页对象 * @return 分页对象
*/ */
IPage getEquipBySourceId(Page page, String riskSourceId, String categoryId,String equipCode,String equipName); IPage getEquipBySourceId(Page page, String riskSourceId, String categoryId,String equipCode,String equipName,String companyId);
} }
...@@ -3,6 +3,7 @@ package com.yeejoin.equipmanage.service; ...@@ -3,6 +3,7 @@ package com.yeejoin.equipmanage.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto; import com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto;
import com.yeejoin.equipmanage.common.entity.RequestData;
import com.yeejoin.equipmanage.common.entity.Video; import com.yeejoin.equipmanage.common.entity.Video;
import com.yeejoin.equipmanage.common.entity.dto.VideoDTO; import com.yeejoin.equipmanage.common.entity.dto.VideoDTO;
import com.yeejoin.equipmanage.common.entity.dto.VideoSaveDto; import com.yeejoin.equipmanage.common.entity.dto.VideoSaveDto;
...@@ -62,9 +63,15 @@ public interface IVideoService extends IService<Video> { ...@@ -62,9 +63,15 @@ public interface IVideoService extends IService<Video> {
List<VideoListVo> pageVideoList(Integer pageNum, Integer pageSize, Double longitude, Double latitude, Double distance); List<VideoListVo> pageVideoList(Integer pageNum, Integer pageSize, Double longitude, Double latitude, Double distance);
int pageVideoCount( Double longitude,
Double latitude, List<VideoListVo> pageVideoListByAlert(Integer pageNum, Integer pageSize, RequestData par);
Double distance) ;
int VideoListByAlertCount(RequestData par);
int pageVideoCount(Double longitude,
Double latitude,
Double distance) ;
List<VideoListVo>listByType(String type); List<VideoListVo>listByType(String type);
......
...@@ -17,7 +17,9 @@ public interface IWarehouseStructureService extends IService<WarehouseStructure> ...@@ -17,7 +17,9 @@ public interface IWarehouseStructureService extends IService<WarehouseStructure>
WarehouseStructure saveOne(WarehouseStructure warehouseStructure); WarehouseStructure saveOne(WarehouseStructure warehouseStructure);
List<WarehouseStructure> tree(Long warehouseId); List<WarehouseStructure> tree(Long warehouseId);
List<WarehouseStructure> gettree(Long warehouseId,String bizOrgCode);
List<WarehouseStructure> gettree(Long warehouseId, String bizOrgCode, String buildingId);
WarehouseStructure updateOneById(WarehouseStructure warehouseStructure); WarehouseStructure updateOneById(WarehouseStructure warehouseStructure);
boolean removeOneById(Long id) throws Exception; boolean removeOneById(Long id) throws Exception;
......
...@@ -56,7 +56,7 @@ public class EquipmentManageServiceImpl extends ServiceImpl<EquipmentManageMappe ...@@ -56,7 +56,7 @@ public class EquipmentManageServiceImpl extends ServiceImpl<EquipmentManageMappe
@Override @Override
public Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction, String maintenance, public Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction, String maintenance,
String bizOrgCode, String formGroupId, int current, int pageSize) { String bizOrgCode, String formGroupId, int current, int pageSize,String controBoxBuildId) {
HttpServletRequest request = null; HttpServletRequest request = null;
Map map = new HashMap<String, Object>(); Map map = new HashMap<String, Object>();
map.put("equimentName", equimentName); map.put("equimentName", equimentName);
...@@ -67,6 +67,7 @@ public class EquipmentManageServiceImpl extends ServiceImpl<EquipmentManageMappe ...@@ -67,6 +67,7 @@ public class EquipmentManageServiceImpl extends ServiceImpl<EquipmentManageMappe
map.put("pageSize", pageSize); map.put("pageSize", pageSize);
map.put("bizOrgCode", bizOrgCode); map.put("bizOrgCode", bizOrgCode);
map.put("formGroupId", formGroupId); map.put("formGroupId", formGroupId);
map.put("controBoxBuildId",controBoxBuildId);
List<EquipmentManageVo> dataList = equipmentManageMapper.queryEquipmenInfo(map); List<EquipmentManageVo> dataList = equipmentManageMapper.queryEquipmenInfo(map);
Long count = equipmentManageMapper.queryEquipmenCount(map); Long count = equipmentManageMapper.queryEquipmenCount(map);
map.clear(); map.clear();
......
...@@ -147,9 +147,9 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -147,9 +147,9 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
@Override @Override
public Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction, public Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction,
String maintenance, String bizOrgCode, String formGroupId, int current, int pageSize) { String maintenance, String bizOrgCode, String formGroupId, int current, int pageSize,String controBoxBuildId) {
Map<String, Object> map = equipmentManageService.queryEquipmenInfoAndCount(equimentName, equimentCode, Map<String, Object> map = equipmentManageService.queryEquipmenInfoAndCount(equimentName, equimentCode,
construction, maintenance, bizOrgCode, formGroupId, current, pageSize); construction, maintenance, bizOrgCode, formGroupId, current, pageSize,controBoxBuildId);
List<EquipmentManageVo> dataList = (List<EquipmentManageVo>) map.get("dataList"); List<EquipmentManageVo> dataList = (List<EquipmentManageVo>) map.get("dataList");
StringBuilder stb = new StringBuilder(); StringBuilder stb = new StringBuilder();
dataList.forEach(y -> { dataList.forEach(y -> {
......
...@@ -643,7 +643,7 @@ public class RiskSourceSceneServiceImpl extends ServiceImpl<RiskSourceSceneMappe ...@@ -643,7 +643,7 @@ public class RiskSourceSceneServiceImpl extends ServiceImpl<RiskSourceSceneMappe
} }
@Override @Override
public IPage getEquipBySourceId(Page page, String sourceId, String categoryId, String equipCode, String equipName) { public IPage getEquipBySourceId(Page page, String sourceId, String categoryId, String equipCode, String equipName,String companyId) {
// 获取sourceId下所有子项 // 获取sourceId下所有子项
Long root = 0L; Long root = 0L;
if (!ValidationUtil.isEmpty(sourceId) && !"null".equals(sourceId)) { if (!ValidationUtil.isEmpty(sourceId) && !"null".equals(sourceId)) {
...@@ -661,7 +661,7 @@ public class RiskSourceSceneServiceImpl extends ServiceImpl<RiskSourceSceneMappe ...@@ -661,7 +661,7 @@ public class RiskSourceSceneServiceImpl extends ServiceImpl<RiskSourceSceneMappe
// 获取categoryId下所有子项 // 获取categoryId下所有子项
Long categoryRoot = null; Long categoryRoot = null;
List<Long> categoryIdList = new ArrayList<>(); List<Long> categoryIdList = new ArrayList<>();
if (!ValidationUtil.isEmpty(categoryId) && !"null".equals(sourceId)) { if (!ValidationUtil.isEmpty(categoryId) && !"null".equals(categoryId) && !"null".equals(sourceId)) {
try { try {
categoryRoot = Long.valueOf(categoryId); categoryRoot = Long.valueOf(categoryId);
} catch (Exception e) { } catch (Exception e) {
...@@ -673,7 +673,7 @@ public class RiskSourceSceneServiceImpl extends ServiceImpl<RiskSourceSceneMappe ...@@ -673,7 +673,7 @@ public class RiskSourceSceneServiceImpl extends ServiceImpl<RiskSourceSceneMappe
categoryIdList = categorieChildren.stream().map(category -> category.getId()).collect(Collectors.toList()); categoryIdList = categorieChildren.stream().map(category -> category.getId()).collect(Collectors.toList());
categoryIdList.add(categoryRoot); categoryIdList.add(categoryRoot);
} }
List<HashMap<String,Object>> equipmentList = equipmentSpecificMapper.getEquipBySourceId(idsList, categoryIdList,equipCode == null ?equipCode:equipCode.replace(" ", ""), equipName == null ? equipName: equipName .replace(" ", "")); List<HashMap<String,Object>> equipmentList = equipmentSpecificMapper.getEquipBySourceId(idsList, categoryIdList,equipCode == null ?equipCode:equipCode.replace(" ", ""), equipName == null ? equipName: equipName .replace(" ", ""),companyId);
page.setTotal(equipmentList.size()); page.setTotal(equipmentList.size());
page.setRecords(equipmentList); page.setRecords(equipmentList);
return page; return page;
......
...@@ -530,10 +530,28 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements ...@@ -530,10 +530,28 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
} }
@Override @Override
public List<VideoListVo> pageVideoListByAlert(Integer pageNum, Integer pageSize,RequestData par) {
return videoMapper.pageVideoListByAlert(pageNum, pageSize, par);
}
@Override
public int VideoListByAlertCount(RequestData par) {
return videoMapper.VideoListByAlertCount( par);
}
@Override
public int pageVideoCount(Double longitude, Double latitude, Double distance) { public int pageVideoCount(Double longitude, Double latitude, Double distance) {
return videoMapper.pageVideoCount(longitude, latitude, distance); return videoMapper.pageVideoCount(longitude, latitude, distance);
} }
@Override @Override
public List<VideoListVo> listByType(String type) { public List<VideoListVo> listByType(String type) {
return videoMapper.listByType(type); return videoMapper.listByType(type);
......
...@@ -6,7 +6,9 @@ import java.util.HashMap; ...@@ -6,7 +6,9 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import com.google.common.base.Joiner;
import com.yeejoin.equipmanage.common.entity.FormInstance; import com.yeejoin.equipmanage.common.entity.FormInstance;
import com.yeejoin.equipmanage.mapper.FormInstanceMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -19,6 +21,7 @@ import com.yeejoin.equipmanage.mapper.WarehouseStructureMapper; ...@@ -19,6 +21,7 @@ import com.yeejoin.equipmanage.mapper.WarehouseStructureMapper;
import com.yeejoin.equipmanage.service.IStockDetailService; import com.yeejoin.equipmanage.service.IStockDetailService;
import com.yeejoin.equipmanage.service.IWarehouseService; import com.yeejoin.equipmanage.service.IWarehouseService;
import com.yeejoin.equipmanage.service.IWarehouseStructureService; import com.yeejoin.equipmanage.service.IWarehouseStructureService;
import org.springframework.util.StringUtils;
/** /**
* 货架结构 服务实现类 * 货架结构 服务实现类
...@@ -37,6 +40,9 @@ public class WarehouseStructureServiceImpl extends ServiceImpl<WarehouseStructur ...@@ -37,6 +40,9 @@ public class WarehouseStructureServiceImpl extends ServiceImpl<WarehouseStructur
IWarehouseService iWarehouseService; IWarehouseService iWarehouseService;
@Autowired @Autowired
FormInstanceMapper formInstanceMapper;
@Autowired
private WarehouseStructureMapper warehouseStructureMapper; private WarehouseStructureMapper warehouseStructureMapper;
@Override @Override
...@@ -65,14 +71,42 @@ public class WarehouseStructureServiceImpl extends ServiceImpl<WarehouseStructur ...@@ -65,14 +71,42 @@ public class WarehouseStructureServiceImpl extends ServiceImpl<WarehouseStructur
} }
@Override @Override
public List<WarehouseStructure> gettree(Long warehouseId,String bizOrgCode) { public List<WarehouseStructure> gettree(Long warehouseId, String bizOrgCode, String buildingId) {
List<WarehouseStructure> list = new ArrayList<>();
if (!StringUtils.isEmpty(buildingId)){
Map<String, String> map = formInstanceMapper.getChildListdate(Long.parseLong(buildingId));
List<String> strings = new ArrayList<>();
if(map.get("ids")!=null && !map.get("ids").equals("")){
String ids = map.get("ids");
QueryWrapper<WarehouseStructure> one = new QueryWrapper<>();
if (ids.startsWith(",")){
String[] split = ids.substring(1).split(",");
one.in("id", split);
}else {
if (ids.contains(",")){
String[] split = ids.split(",");
one.in("id", split);
}else {
one.eq("id",ids);
}
}
one.eq("warehouse_id", warehouseId);
list = warehouseStructureMapper.selectList(one);
QueryWrapper<WarehouseStructure> one1 = new QueryWrapper<>();
one1.eq("warehouse_id", warehouseId);
one1.eq("id", buildingId);
list.addAll( warehouseStructureMapper.selectList(one1));
}
}else {
QueryWrapper<WarehouseStructure> one = new QueryWrapper<>(); QueryWrapper<WarehouseStructure> one = new QueryWrapper<>();
one.eq("warehouse_id",warehouseId); one.eq("warehouse_id", warehouseId);
one.likeRight("biz_org_code",bizOrgCode); one.likeRight("biz_org_code", bizOrgCode);
List<WarehouseStructure> list = warehouseStructureMapper.selectList(one); list = warehouseStructureMapper.selectList(one);
list = buildByRecursive(list,warehouseId);
}
list = buildByRecursive(list, warehouseId);
return list; return list;
} }
......
...@@ -45,6 +45,7 @@ import com.yeejoin.amos.patrol.dao.entity.InputItem; ...@@ -45,6 +45,7 @@ import com.yeejoin.amos.patrol.dao.entity.InputItem;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
/** /**
...@@ -467,6 +468,11 @@ public class InputItemController extends AbstractBaseController { ...@@ -467,6 +468,11 @@ public class InputItemController extends AbstractBaseController {
@RequestMapping(value = "/addItemNew", produces = "application/json;charset=UTF-8", method = RequestMethod.POST) @RequestMapping(value = "/addItemNew", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
public CommonResponse addNewItemNew(@ApiParam(value = "检查项信息") @RequestBody InputItemParam param) { public CommonResponse addNewItemNew(@ApiParam(value = "检查项信息") @RequestBody InputItemParam param) {
if (param.getEquipmentType() == null && param.getCustomType() == null&&param.getFacilitiesType() == null&&param.getKeyPartsType() == null){
throw new BadRequest("适用类型至少需选择一项");
}
AgencyUserModel user = getUserInfo(); AgencyUserModel user = getUserInfo();
if (ObjectUtils.isEmpty(user)) { if (ObjectUtils.isEmpty(user)) {
return CommonResponseUtil.failure("用户session过期"); return CommonResponseUtil.failure("用户session过期");
......
...@@ -6,12 +6,14 @@ import javax.servlet.http.HttpServletResponse; ...@@ -6,12 +6,14 @@ import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.patrol.business.dao.mapper.PointMapper;
import com.yeejoin.amos.patrol.business.dao.repository.IPointClassifyDao; import com.yeejoin.amos.patrol.business.dao.repository.IPointClassifyDao;
import com.yeejoin.amos.patrol.business.dao.repository.IPointInputItemDao; import com.yeejoin.amos.patrol.business.dao.repository.IPointInputItemDao;
import com.yeejoin.amos.patrol.business.dao.repository.IRoutePointDao; import com.yeejoin.amos.patrol.business.dao.repository.IRoutePointDao;
import com.yeejoin.amos.patrol.business.dao.repository.IRoutePointItemDao; import com.yeejoin.amos.patrol.business.dao.repository.IRoutePointItemDao;
import com.yeejoin.amos.patrol.business.feign.EquipFeign; import com.yeejoin.amos.patrol.business.feign.EquipFeign;
import com.yeejoin.amos.patrol.business.feign.JcsFeignClient; import com.yeejoin.amos.patrol.business.feign.JcsFeignClient;
import com.yeejoin.amos.patrol.business.service.impl.PointServiceImpl;
import com.yeejoin.amos.patrol.business.vo.*; import com.yeejoin.amos.patrol.business.vo.*;
import com.yeejoin.amos.patrol.dao.entity.*; import com.yeejoin.amos.patrol.dao.entity.*;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -78,6 +80,9 @@ public class PointController extends AbstractBaseController { ...@@ -78,6 +80,9 @@ public class PointController extends AbstractBaseController {
private IPointService iPointService; private IPointService iPointService;
@Autowired @Autowired
private PointMapper pointMapper;
@Autowired
private ICatalogTreeService catalogTreeService; private ICatalogTreeService catalogTreeService;
@Autowired @Autowired
...@@ -432,10 +437,15 @@ public class PointController extends AbstractBaseController { ...@@ -432,10 +437,15 @@ public class PointController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "获取当前登录人,单位下建筑树", notes = "获取当前登录人,单位下建筑树") @ApiOperation(value = "获取当前登录人,单位下建筑树", notes = "获取当前登录人,单位下建筑树")
@GetMapping(value = "/gettreeWarehouse", produces = "application/json;charset=UTF-8") @GetMapping(value = "/gettreeWarehouse", produces = "application/json;charset=UTF-8")
public CommonResponse gettreeWarehouse() { public CommonResponse gettreeWarehouse(@RequestParam(value = "pointId",required = false) String pointId) {
try { try {
Map<String, Object> map = new HashMap<>();
if (!StringUtils.isEmpty(pointId)){
map = pointMapper.getPointById(Long.valueOf(pointId));
}
ReginParams reginParams = getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
return CommonResponseUtil.success(equipFeign.gettreeWarehouse(reginParams.getPersonIdentity().getCompanyBizOrgCode())); return CommonResponseUtil.success(equipFeign.gettreeWarehouse(reginParams.getPersonIdentity().getCompanyBizOrgCode(),map.get("buildingId").toString()));
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
return CommonResponseUtil.failure("查询巡检点失败"); return CommonResponseUtil.failure("查询巡检点失败");
......
...@@ -41,7 +41,7 @@ public interface EquipFeign { ...@@ -41,7 +41,7 @@ public interface EquipFeign {
@RequestMapping(value = "${equip.fegin.prefix}"+"/warehouse-structure/gettree/0", method = RequestMethod.GET ,consumes="application/json") @RequestMapping(value = "${equip.fegin.prefix}"+"/warehouse-structure/gettree/0", method = RequestMethod.GET ,consumes="application/json")
LinkedHashMap<String,Object> gettreeWarehouse(@RequestParam(value = "bizOrgCode", required = true) String bizOrgCode); LinkedHashMap<String,Object> gettreeWarehouse(@RequestParam(value = "bizOrgCode", required = true) String bizOrgCode,@RequestParam(value = "buildingId", required = false) String buildingId);
@RequestMapping(value = "${equip.fegin.prefix}"+"/building/getOne", method = RequestMethod.GET ,consumes="application/json") @RequestMapping(value = "${equip.fegin.prefix}"+"/building/getOne", method = RequestMethod.GET ,consumes="application/json")
......
...@@ -61,6 +61,7 @@ import org.springframework.stereotype.Service; ...@@ -61,6 +61,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.text.DateFormat; import java.text.DateFormat;
...@@ -1050,6 +1051,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -1050,6 +1051,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
@Override @Override
@Transactional @Transactional
public void taskMessage(String runDate) { public void taskMessage(String runDate) {
SimpleDateFormat df = new SimpleDateFormat("HH:mm:ss"); SimpleDateFormat df = new SimpleDateFormat("HH:mm:ss");
//1.扫描plan表查询,需要生成执行数据的任务信息,无则return //1.扫描plan表查询,需要生成执行数据的任务信息,无则return
Date now = new Date();//今天 Date now = new Date();//今天
...@@ -1076,6 +1078,11 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -1076,6 +1078,11 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
public void sendMessage(Plan plan, PlanTask planTask) throws Exception { public void sendMessage(Plan plan, PlanTask planTask) throws Exception {
Toke toke= remoteSecurityService.getServerToken();
RequestContext.setToken(toke.getToke());
RequestContext.setProduct(toke.getProduct());
RequestContext.setAppKey(toke.getAppKey());
MsgRo msgRo = new MsgRo(); MsgRo msgRo = new MsgRo();
// 标题 // 标题
msgRo.setName(plan.getName()); msgRo.setName(plan.getName());
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
from from
f_fire_fighting_system as sys f_fire_fighting_system as sys
where 1=1 where 1=1
<if test="equimentName != 'null' "> <if test="equimentName != null and equimentName != '' and equimentName != 'null' ">
AND NAME like CONCAT('%',#{equimentName},'%') AND NAME like CONCAT('%',#{equimentName},'%')
</if> </if>
<if test="equimentCode != 'null' "> <if test="equimentCode != 'null' ">
...@@ -40,6 +40,9 @@ ...@@ -40,6 +40,9 @@
<if test="maintenance != 'all' "> <if test="maintenance != 'all' ">
AND MAINTENANCE_UNIT = #{maintenance} AND MAINTENANCE_UNIT = #{maintenance}
</if> </if>
<if test="controBoxBuildId != null ">
AND contro_box_build = #{controBoxBuildId}
</if>
<if test="bizOrgCode != null and bizOrgCode != ''"> <if test="bizOrgCode != null and bizOrgCode != ''">
AND biz_org_code like CONCAT(#{bizOrgCode},'%') AND biz_org_code like CONCAT(#{bizOrgCode},'%')
</if> </if>
...@@ -55,7 +58,7 @@ ...@@ -55,7 +58,7 @@
from from
f_fire_fighting_system f_fire_fighting_system
where 1=1 where 1=1
<if test="equimentName != 'null' "> <if test="equimentName != null and equimentName != '' and equimentName != 'null' ">
AND name like CONCAT('%',#{equimentName},'%') AND name like CONCAT('%',#{equimentName},'%')
</if> </if>
<if test="equimentCode != 'null' "> <if test="equimentCode != 'null' ">
...@@ -64,6 +67,9 @@ ...@@ -64,6 +67,9 @@
<if test="construction != 'all' "> <if test="construction != 'all' ">
AND construction_unit = #{construction} AND construction_unit = #{construction}
</if> </if>
<if test="controBoxBuildId != null ">
AND contro_box_build = #{controBoxBuildId}
</if>
<if test="maintenance != 'all' "> <if test="maintenance != 'all' ">
AND maintenance_unit = #{maintenance} AND maintenance_unit = #{maintenance}
</if> </if>
......
...@@ -361,6 +361,7 @@ ...@@ -361,6 +361,7 @@
equipment_detail.area AS address, equipment_detail.area AS address,
equipment_detail.equipment_name as eqpDefName, equipment_detail.equipment_name as eqpDefName,
equipment_detail.equipment_id as eqpDefId, equipment_detail.equipment_id as eqpDefId,
spec.biz_org_name as bizOrgName,
<!-- CONCAT(area.prevName,'-',structure.NAME) AS acre,--> <!-- CONCAT(area.prevName,'-',structure.NAME) AS acre,-->
spec.position AS acre, spec.position AS acre,
we.inspection_spec as inspectionSpecId, we.inspection_spec as inspectionSpecId,
...@@ -397,6 +398,9 @@ ...@@ -397,6 +398,9 @@
#{id} #{id}
</foreach> </foreach>
</if> </if>
<if test="companyId != null and companyId != ''">
and spec.agency_id = #{companyId}
</if>
<if test="equipCode != '' and equipCode != null">and spec.code like concat("%", #{equipCode}, "%")</if> <if test="equipCode != '' and equipCode != null">and spec.code like concat("%", #{equipCode}, "%")</if>
<if test="equipName != '' and equipName != null"> <if test="equipName != '' and equipName != null">
and spec.name like CONCAT("%", #{equipName},'%') and spec.name like CONCAT("%", #{equipName},'%')
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
and wlv.type=#{video.type} and wlv.type=#{video.type}
</if> </if>
group by wlv.id group by wlv.id
order by wlv.create_date desc order by wlv.create_date desc
</select> </select>
<!-- SELECT <!-- SELECT
...@@ -103,32 +103,29 @@ ...@@ -103,32 +103,29 @@
v.address, v.address,
v.preset_position as presetPosition v.preset_position as presetPosition
FROM wl_video v FROM wl_video v
<choose> <choose>
<when test="dto.buildingId!=null and dto.buildingId!=''"> <when test="dto.buildingId!=null and dto.buildingId!=''">
JOIN wl_video_source vc ON vc.video_id = v.id JOIN wl_video_source vc ON vc.video_id = v.id
join wl_form_instance wfl on wfl.instance_id = vc.source_id join wl_form_instance wfl on wfl.instance_id = vc.source_id
WHERE WHERE
FIND_IN_SET(#{dto.buildingId}, vc.parent_source_ids) FIND_IN_SET(#{dto.buildingId}, vc.parent_source_ids)
<if test="dto.equipmentName!=null and dto.equipmentName!=''"> <if test="dto.equipmentName!=null and dto.equipmentName!=''">
and v.name like concat('%',#{dto.equipmentName},'%') and v.name like concat('%',#{dto.equipmentName},'%')
</if> </if>
<if test="dto.code!=null and dto.code!=''"> <if test="dto.code!=null and dto.code!=''">
and v.code like concat('%',#{dto.code},'%') and v.code like concat('%',#{dto.code},'%')
</if> </if>
<if test=" dto.ip!=null and dto.ip!=''"> <if test=" dto.ip!=null and dto.ip!=''">
and v.ip like concat('%',#{dto.ip},'%') and v.ip like concat('%',#{dto.ip},'%')
</if> </if>
<if test="dto.type!=null and dto.type!=''"> <if test="dto.type!=null and dto.type!=''">
and v.type = #{dto.type} and v.type = #{dto.type}
</if> </if>
GROUP BY id
order by v.create_date
</when>
GROUP BY id <when test='dto.buildingId == null || dto.buildingId ==""'>
order by v.create_date <where>
</when>
<when test='dto.buildingId == null || dto.buildingId ==""'>
<where>
<if test="dto.bizOrgCode!=null and dto.bizOrgCode!=''"> <if test="dto.bizOrgCode!=null and dto.bizOrgCode!=''">
v.biz_org_code LIKE CONCAT(#{dto.bizOrgCode}, '%') v.biz_org_code LIKE CONCAT(#{dto.bizOrgCode}, '%')
</if> </if>
...@@ -138,79 +135,64 @@ ...@@ -138,79 +135,64 @@
<if test="dto.equipmentName!=null and dto.equipmentName!=''"> <if test="dto.equipmentName!=null and dto.equipmentName!=''">
and v.name like concat('%',#{dto.equipmentName},'%') and v.name like concat('%',#{dto.equipmentName},'%')
</if> </if>
<if test=" dto.ip!=null and dto.ip!=''"> <if test=" dto.ip!=null and dto.ip!=''">
and v.ip like concat('%',#{dto.ip},'%') and v.ip like concat('%',#{dto.ip},'%')
</if> </if>
<if test="dto.type!=null and dto.type!=''"> <if test="dto.type!=null and dto.type!=''">
and v.type =#{dto.type} and v.type =#{dto.type}
</if> </if>
</where>
GROUP BY id
order by v.create_date
</when>
</where> </choose>
GROUP BY id
order by v.create_date
</when>
</choose>
</select> </select>
<select id="getFireEquipByVideoId" resultType="com.yeejoin.equipmanage.common.entity.vo.BuildingListVO"> <select id="getFireEquipByVideoId" resultType="com.yeejoin.equipmanage.common.entity.vo.BuildingListVO">
SELECT SELECT wle.*,
wle.*, equd.`name` AS equipmentName,
equd.`name` AS equipmentName, wws.full_name AS equipmentAddress
wws.full_name AS equipmentAddress FROM wl_equipment_specific wle
FROM JOIN wl_video_equipment_specific ve ON wle.id = ve.equipment_specific_id
wl_equipment_specific wle LEFT JOIN wl_equipment_detail equd ON equd.id = wle.equipment_detail_id
JOIN wl_video_equipment_specific ve ON wle.id = ve.equipment_specific_id LEFT JOIN wl_stock_detail wsd ON wsd.equipment_detail_id = equd.id
LEFT JOIN wl_equipment_detail equd ON equd.id = wle.equipment_detail_id LEFT JOIN wl_warehouse_structure wws ON wws.id = wsd.warehouse_structure_id
LEFT JOIN wl_stock_detail wsd ON wsd.equipment_detail_id = equd.id WHERE ve.video_id = #{videoId}
LEFT JOIN wl_warehouse_structure wws ON wws.id = wsd.warehouse_structure_id
WHERE
ve.video_id = #{videoId}
</select> </select>
<select id="getPowerEquipByVideoId" resultType="com.yeejoin.equipmanage.common.entity.vo.BuildingListVO"> <select id="getPowerEquipByVideoId" resultType="com.yeejoin.equipmanage.common.entity.vo.BuildingListVO">
SELECT SELECT wle.id as id,
wle.id as id, wle.`code` AS code,
wle.`code` AS code, wle.`name` AS equipmentName,
wle.`name` AS equipmentName, wle.address AS equipmentAddress
wle.address AS equipmentAddress FROM f_equipment wle
FROM JOIN wl_video_important_equipment ve ON wle.id = ve.important_equipment_id
f_equipment wle WHERE ve.video_id = #{videoId}
JOIN wl_video_important_equipment ve ON wle.id = ve.important_equipment_id
WHERE
ve.video_id = #{videoId}
</select> </select>
<select id="getVideoBySpeId" resultType="com.yeejoin.equipmanage.common.entity.vo.AlamVideoVO"> <select id="getVideoBySpeId" resultType="com.yeejoin.equipmanage.common.entity.vo.AlamVideoVO">
select select vid.id,
vid.id, vid.token,
vid.token, vid.name as name,
vid.name as name, vid.url,
vid.url, vid.code,
vid.code, vid.preset_position as presetPosition,
vid.preset_position as presetPosition, vid.name
vid.name from wl_video_equipment_specific as ves
from left join wl_video as vid on ves.video_id = vid.id
wl_video_equipment_specific as ves
left join wl_video as vid on ves.video_id = vid.id
where equipment_specific_id = #{id} where equipment_specific_id = #{id}
</select> </select>
<select id="getVideoById" resultType="com.yeejoin.equipmanage.common.entity.vo.AlamVideoVO"> <select id="getVideoById" resultType="com.yeejoin.equipmanage.common.entity.vo.AlamVideoVO">
SELECT SELECT v.`name`,
v.`name`, v.`code`,
v.`code`, v.url,
v.url, v.token,
v.token, CONCAT_WS(' ', ws.full_name, v.address) AS address,
CONCAT_WS(' ', ws.full_name, v.address) AS address, v.img,
v.img, v.preset_position as presetPosition
v.preset_position as presetPosition FROM wl_video v
FROM LEFT JOIN wl_video_source vs ON vs.video_id = v.id
wl_video v LEFT JOIN wl_warehouse_structure ws ON ws.id = vs.source_id
LEFT JOIN wl_video_source vs ON vs.video_id = v.id WHERE v.id = #{id}
LEFT JOIN wl_warehouse_structure ws ON ws.id = vs.source_id
WHERE
v.id = #{id}
</select> </select>
<select id="pageColaBuildingVideo" resultType="com.yeejoin.equipmanage.common.entity.vo.BuildingVideoVO"> <select id="pageColaBuildingVideo" resultType="com.yeejoin.equipmanage.common.entity.vo.BuildingVideoVO">
...@@ -310,56 +292,46 @@ ...@@ -310,56 +292,46 @@
</select> </select>
<select id="findAllParents" resultMap="menuTree"> <select id="findAllParents" resultMap="menuTree">
SELECT SELECT wws.id AS id,
wws.id AS id, wws.parent_id AS parentId,
wws.parent_id AS parentId, wws.name AS name,
wws.name AS name, wws.full_name AS fullName
wws.full_name AS fullName FROM wl_warehouse_structure wws
FROM WHERE wws.parent_id = 0
wl_warehouse_structure wws
WHERE
wws.parent_id = 0
</select> </select>
<select id="getMenuChildren" resultMap="menuTree"> <select id="getMenuChildren" resultMap="menuTree">
SELECT SELECT wws.id AS id,
wws.id AS id, wws.parent_id AS parentId,
wws.parent_id AS parentId, wws.name AS name,
wws.name AS name, wws.full_name AS fullName
wws.full_name AS fullName FROM wl_warehouse_structure wws
FROM WHERE wws.parent_id = #{id}
wl_warehouse_structure wws
WHERE
wws.parent_id = #{id}
</select> </select>
<select id="getSecurityOrFireEquipment" resultType="com.yeejoin.equipmanage.common.entity.vo.BuildingListVO"> <select id="getSecurityOrFireEquipment" resultType="com.yeejoin.equipmanage.common.entity.vo.BuildingListVO">
SELECT SELECT wes.id AS id,
wes.id AS id, wed.name AS equipmentName,
wed.name AS equipmentName, wed.code AS code,
wed.code AS code, wws.full_name AS equipmentAddress
wws.full_name AS equipmentAddress FROM wl_equipment_specific wes
FROM LEFT JOIN wl_equipment_detail wed ON wed.id = wes.equipment_detail_id
wl_equipment_specific wes LEFT JOIN wl_stock_detail wsd ON wsd.equipment_detail_id = wed.id
LEFT JOIN wl_equipment_detail wed ON wed.id = wes.equipment_detail_id LEFT JOIN wl_warehouse_structure wws ON wws.id = wsd.warehouse_structure_id
LEFT JOIN wl_stock_detail wsd ON wsd.equipment_detail_id = wed.id WHERE wes.id = #{id}
LEFT JOIN wl_warehouse_structure wws ON wws.id = wsd.warehouse_structure_id
WHERE
wes.id = #{id}
</select> </select>
<select id="selectBuildList" resultType="String"> <select id="selectBuildList" resultType="String">
select source_name from wl_source_scene select source_name
where video_in_scene like CONCAT('%',#{id},'%' ) from wl_source_scene
where video_in_scene like CONCAT('%', #{id}, '%')
</select> </select>
<select id="selectImportantEquipment" resultType="com.yeejoin.equipmanage.common.entity.vo.EquipmentSpecificVo"> <select id="selectImportantEquipment" resultType="com.yeejoin.equipmanage.common.entity.vo.EquipmentSpecificVo">
select id,code from f_equipment select id, code
from f_equipment
</select> </select>
<select id="pageVideoList" resultType="com.yeejoin.equipmanage.common.entity.vo.VideoListVo"> <select id="pageVideoList" resultType="com.yeejoin.equipmanage.common.entity.vo.VideoListVo">
SELECT SELECT
wle.id , wle.id ,
...@@ -371,36 +343,184 @@ ...@@ -371,36 +343,184 @@
wle.address , wle.address ,
wle.longitude, wle.longitude,
<if test='longitude!=null and latitude!=null '> <if test='longitude!=null and latitude!=null '>
Round(st_distance(point(wle.longitude,wle.latitude),point(#{longitude},#{latitude}))*111195,1) AS distance, Round(st_distance(point(wle.longitude,wle.latitude),point(#{longitude},#{latitude}))*111195,1) AS distance,
</if> </if>
wle.latitude wle.latitude
FROM wl_video wle FROM wl_video wle
where wle.longitude is not null and wle.latitude is not null where wle.longitude is not null and wle.latitude is not null
<if test='longitude!=null and latitude!=null and distance!=null'> <if test='longitude!=null and latitude!=null and distance!=null'>
and distance &lt;= #{distance} and distance &lt;= #{distance}
</if> </if>
<if test='longitude!=null and latitude!=null '> <if test='longitude!=null and latitude!=null '>
ORDER BY distance ORDER BY distance
</if>
limit #{pageNum},#{pageSize}
</select>
<select id="pageVideoListByAlert" resultType="com.yeejoin.equipmanage.common.entity.vo.VideoListVo">
SELECT
a.*
FROM
(
SELECT
wle.id ,
wle.`code` ,
wle.url,
wle.position3d,
wle.token,
wle.`name` ,
wle.address ,
wle.longitude,
<if test='longitude!=null and latitude!=null '>
Round(st_distance(point(wle.longitude,wle.latitude),point(#{longitude},#{latitude}))*111195,1) AS distance,
</if>
wle.latitude
FROM wl_video wle
where wle.longitude is not null and wle.latitude is not null
<if test='longitude!=null and latitude!=null and distance!=null'>
and distance &lt;= #{distance}
</if>
<if test='type!=null and type!="" '>
wle.type = #{type}
</if>
<if test='remake !=null and remake!="" '>
wle.remake like concat ('%',#{remake},'%')
</if>
<if test='code!=null and code!="" '>
wle.code like concat ('%',#{code},'%')
</if>
UNION
SELECT
wle.id,
wle.`code`,
wle.url,
wle.position3d,
wle.token,
wle.`name`,
wle.address,
wle.longitude,
<if test='longitudeTwo!=null and latitudeTwo!=null '>Round(
st_distance (
point ( wle.longitude, wle.latitude ),
point (#{longitudeTwo},#{latitudeTwo} ) ) * 111195, 1 ) AS distance,
</if>
wle.latitude
FROM
wl_video wle
WHERE
wle.longitude IS NOT NULL
AND wle.latitude IS NOT NULL
<if test='longitudeTwo!=null and latitude!=null and distance!=null'>
AND distance &lt;= #{distance}
</if>
<if test='type!=null and type!="" '>
wle.type = #{type}
</if> </if>
<if test='remake !=null and remake!="" '>
wle.remake like concat ('%',#{remake},'%')
</if>
<if test='code!=null and code!="" '>
wle.code like concat ('%',#{code},'%')
</if>
<if test='longitudeTwo !=null and latitudeTwo !=null '>
ORDER BY
distance
</if>
) AS a
limit #{pageNum},#{pageSize} limit #{pageNum},#{pageSize}
</select> </select>
<select id="VideoListByAlertCount" resultType="int">
SELECT
count(a.*)
FROM
(
SELECT
wle.id ,
wle.`code` ,
wle.url,
wle.position3d,
wle.token,
wle.`name` ,
wle.address ,
wle.longitude,
<if test='longitude!=null and latitude!=null '>
Round(st_distance(point(wle.longitude,wle.latitude),point(#{longitude},#{latitude}))*111195,1) AS distance,
</if>
<if test='type!=null and type!="" '>
wle.type = #{type}
</if>
<if test='remake !=null and remake!="" '>
wle.remake like concat ('%',#{remake},'%')
</if>
<if test='code!=null and code!="" '>
wle.code like concat ('%',#{code},'%')
</if>
wle.latitude
FROM wl_video wle
where wle.longitude is not null and wle.latitude is not null
<if test='longitude!=null and latitude!=null and distance!=null'>
and distance &lt;= #{distance}
</if>
UNION
SELECT
wle.id,
wle.`code`,
wle.url,
wle.position3d,
wle.token,
wle.`name`,
wle.address,
wle.longitude,
<if test='longitudeTwo!=null and latitudeTwo!=null '>Round(
st_distance (
point ( wle.longitude, wle.latitude ),
point (#{longitudeTwo},#{latitudeTwo} ) ) * 111195, 1 ) AS distance,
</if>
wle.latitude
FROM
wl_video wle
WHERE
wle.longitude IS NOT NULL
AND wle.latitude IS NOT NULL
<if test='longitudeTwo!=null and latitude!=null and distance!=null'>
AND distance &lt;= #{distance}
</if>
<if test='type!=null and type!="" '>
wle.type = #{type}
</if>
<if test='remake !=null and remake!="" '>
wle.remake like concat ('%',#{remake},'%')
</if>
<if test='code!=null and code!="" '>
wle.code like concat ('%',#{code},'%')
</if>
<if test='longitudeTwo !=null and latitudeTwo !=null '>
ORDER BY
distance
</if>
) AS a
</select>
<select id="pageVideoCount" resultType="int"> <select id="pageVideoCount" resultType="int">
SELECT SELECT
count( wle.id ) num count( wle.id ) num
FROM wl_video wle FROM wl_video wle
where wle.longitude is not null and wle.latitude is not null where wle.longitude is not null and wle.latitude is not null
<if test='distance!=null'> <if test='distance!=null'>
and Round(st_distance(point(wle.longitude,wle.latitude),point(#{longitude},#{latitude}))*111195,1) &lt;= and Round(st_distance(point(wle.longitude,wle.latitude),point(#{longitude},#{latitude}))*111195,1) &lt;=
#{distance} #{distance}
</if> </if>
</select> </select>
<sql id="videoField" > <sql id="videoField">
wlv.id, wlv
.
id
,
wlv.code, wlv.code,
wlv.name, wlv.name,
wlv.address, wlv.address,
...@@ -427,11 +547,11 @@ ...@@ -427,11 +547,11 @@
<if test="type!=null and type!=''"> <if test="type!=null and type!=''">
and wlv.type = #{type} and wlv.type = #{type}
</if> </if>
group by wlv.id group by wlv.id
</select> </select>
<select id="listByCode" resultType="com.yeejoin.equipmanage.common.entity.Video"> <select id="listByCode" resultType="com.yeejoin.equipmanage.common.entity.Video">
SELECT SELECT
<include refid="videoField"/> <include refid="videoField"/>
wlv.code wlv.code
FROM FROM
...@@ -439,21 +559,19 @@ ...@@ -439,21 +559,19 @@
where wlv.code = #{code} where wlv.code = #{code}
</select> </select>
<select id="selectListBySourceId" resultType="com.yeejoin.equipmanage.common.entity.Video"> <select id="selectListBySourceId" resultType="com.yeejoin.equipmanage.common.entity.Video">
select select v.id,
v.id, v.code,
v.code, v.name,
v.name, (case v.type
(case v.type when 'behavioural' then '行为分析摄像头'
when 'behavioural' then '行为分析摄像头' when 'sharpEyes' then '火眼识别摄像头'
when 'sharpEyes' then '火眼识别摄像头' when 'other' then '其他'
when 'other' then '其他' else v.type
else v.type end) type
end ) type from wl_video v,
from wl_video_source vs
wl_video v, where vs.source_id = #{floorId}
wl_video_source vs and vs.video_id = v.id
where vs.source_id = #{floorId}
and vs.video_id = v.id
</select> </select>
<select id="getParentSourceIds" resultType="java.lang.String"> <select id="getParentSourceIds" resultType="java.lang.String">
......
...@@ -3270,7 +3270,17 @@ ...@@ -3270,7 +3270,17 @@
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="cz" id="2022-08-11-1">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="jc_alert_called" columnName="relation_id"/>
</not>
</preConditions>
<comment>增加物联警情关联Id</comment>
<sql>
ALTER TABLE jc_alert_called add relation_id varchar(255) DEFAULT NULL COMMENT '物联警情关联Id'
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
......
...@@ -335,6 +335,7 @@ ...@@ -335,6 +335,7 @@
END) fixed, END) fixed,
p.charge_person_id userName, p.charge_person_id userName,
p.charge_dept_id depid, p.charge_dept_id depid,
p.risk_source_id buildingId,
p.remark, p.remark,
p.offline p.offline
FROM FROM
......
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