Commit 36cd2bb0 authored by suhuiguang's avatar suhuiguang

Merge branch 'developer' into develop_ccs

parents 2bd5164a a7984014
...@@ -6,6 +6,7 @@ import org.springframework.boot.autoconfigure.http.HttpMessageConverters; ...@@ -6,6 +6,7 @@ import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
import org.springframework.cloud.openfeign.support.SpringEncoder; import org.springframework.cloud.openfeign.support.SpringEncoder;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.web.context.request.RequestContextListener;
import feign.codec.Encoder; import feign.codec.Encoder;
import feign.form.spring.SpringFormEncoder; import feign.form.spring.SpringFormEncoder;
...@@ -25,4 +26,12 @@ public class MultipartSupportConfig { ...@@ -25,4 +26,12 @@ public class MultipartSupportConfig {
public Encoder feignFormEncoder() { public Encoder feignFormEncoder() {
return new SpringFormEncoder(new SpringEncoder(messageConverters)); return new SpringFormEncoder(new SpringEncoder(messageConverters));
} }
/**
* 创建Feign请求拦截器,在发送请求前设置认证的token,各个微服务将token设置到环境变量中来达到通用
* @return
*/
@Bean
public RequestContextListener requestInterceptor() {
return new RequestContextListener();
}
} }
...@@ -50,7 +50,7 @@ public class Swagger2Config { ...@@ -50,7 +50,7 @@ public class Swagger2Config {
.apiInfo(apiInfo()) .apiInfo(apiInfo())
.select() .select()
//此包路径下的类,才生成接口文档 //此包路径下的类,才生成接口文档
.apis(RequestHandlerSelectors.basePackage("com.yeejoin.amos")) .apis(RequestHandlerSelectors.basePackage("com.yeejoin"))
//加了ApiOperation注解的类,才生成接口文档 //加了ApiOperation注解的类,才生成接口文档
.apis(RequestHandlerSelectors.withClassAnnotation(RestController.class)) .apis(RequestHandlerSelectors.withClassAnnotation(RestController.class))
.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
......
...@@ -115,4 +115,10 @@ public class FireEquipmentSignalLogDto extends BaseDto { ...@@ -115,4 +115,10 @@ public class FireEquipmentSignalLogDto extends BaseDto {
@ApiModelProperty(value = "负责人联系电话") @ApiModelProperty(value = "负责人联系电话")
private String chargePersonPhone; private String chargePersonPhone;
/**
* 3维页面访问地址
*/
@ApiModelProperty(value = "3维页面访问地址")
private String view3dUrl;
} }
...@@ -80,4 +80,10 @@ public class FireStationInfoDto extends BaseDto { ...@@ -80,4 +80,10 @@ public class FireStationInfoDto extends BaseDto {
@ApiModelProperty(value = "现存隐患") @ApiModelProperty(value = "现存隐患")
private Long existDangerNumber; private Long existDangerNumber;
/**
* 3维页面访问地址
*/
@ApiModelProperty(value = "3维页面访问地址")
private String view3dUrl;
} }
...@@ -129,4 +129,10 @@ public class FireStationInfo extends BaseEntity { ...@@ -129,4 +129,10 @@ public class FireStationInfo extends BaseEntity {
*/ */
@TableField("fire_captain_phone") @TableField("fire_captain_phone")
private String fireCaptainPhone; private String fireCaptainPhone;
/**
* 3维页面访问地址
*/
@TableField("view3d_url")
private String view3dUrl;
} }
...@@ -32,7 +32,8 @@ ...@@ -32,7 +32,8 @@
a.system_names, a.system_names,
s.station_charge_person, s.station_charge_person,
s.charge_person_phone, s.charge_person_phone,
a.fire_building_mrid a.fire_building_mrid,
s.view3d_url
from from
asf_fire_equipment_signal_log a, asf_fire_equipment_signal_log a,
asf_fire_station_info s asf_fire_station_info s
......
...@@ -32,4 +32,11 @@ public class FireTeamListDto { ...@@ -32,4 +32,11 @@ public class FireTeamListDto {
@ApiModelProperty(value = "树节点子节点id集合") @ApiModelProperty(value = "树节点子节点id集合")
private List<String> nodeIds; private List<String> nodeIds;
@ApiModelProperty(value = "地址")
private String address;
@ApiModelProperty(value = "所属单位")
private String company;
} }
...@@ -27,6 +27,7 @@ public interface FireStationMapper extends BaseMapper<FireStation> { ...@@ -27,6 +27,7 @@ public interface FireStationMapper extends BaseMapper<FireStation> {
+ "<if test='par.name!=null'> and a.name like CONCAT('%',#{par.name},'%') </if>" + "<if test='par.name!=null'> and a.name like CONCAT('%',#{par.name},'%') </if>"
+ "<if test='par.bizCompanyId!=null'> and a.biz_company_id = #{par.bizCompanyId} </if>" + "<if test='par.bizCompanyId!=null'> and a.biz_company_id = #{par.bizCompanyId} </if>"
+ "<if test='par.bizCompanyCode!=null'> and a.biz_company_code like CONCAT('',#{par.bizCompanyCode},'%') </if>" + "<if test='par.bizCompanyCode!=null'> and a.biz_company_code like CONCAT('',#{par.bizCompanyCode},'%') </if>"
+ "<if test='par.address!=null'> and a.address like CONCAT('',#{par.address},'%') </if>"
+" order by a.rec_date desc limit #{pageNum},#{pageSize}" +" order by a.rec_date desc limit #{pageNum},#{pageSize}"
+ "</script>") + "</script>")
List<FireStationDto>getFireStation(@Param("pageNum")int pageNum,@Param("pageSize")int pageSize,@Param("par")FireStationDto par); List<FireStationDto>getFireStation(@Param("pageNum")int pageNum,@Param("pageSize")int pageSize,@Param("par")FireStationDto par);
...@@ -35,6 +36,7 @@ public interface FireStationMapper extends BaseMapper<FireStation> { ...@@ -35,6 +36,7 @@ public interface FireStationMapper extends BaseMapper<FireStation> {
+ "<if test='par.name!=null'> and cb_fire_station.name like CONCAT('%',#{par.name},'%') </if>" + "<if test='par.name!=null'> and cb_fire_station.name like CONCAT('%',#{par.name},'%') </if>"
+ "<if test='par.bizCompanyId!=null'> and cb_fire_station.biz_company_id = #{par.bizCompanyId} </if>" + "<if test='par.bizCompanyId!=null'> and cb_fire_station.biz_company_id = #{par.bizCompanyId} </if>"
+ "<if test='par.bizCompanyCode!=null'> and cb_fire_station.biz_company_code like CONCAT('',#{par.bizCompanyCode},'%') </if>" + "<if test='par.bizCompanyCode!=null'> and cb_fire_station.biz_company_code like CONCAT('',#{par.bizCompanyCode},'%') </if>"
+ "<if test='par.address!=null'> and cb_fire_station.address like CONCAT('',#{par.address},'%') </if>"
+ "</script>") + "</script>")
Map<String, Long> getFireStationCount(@Param("par")FireStationDto par); Map<String, Long> getFireStationCount(@Param("par")FireStationDto par);
......
...@@ -3,6 +3,9 @@ package com.yeejoin.amos.boot.module.common.api.service; ...@@ -3,6 +3,9 @@ package com.yeejoin.amos.boot.module.common.api.service;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.common.api.dto.DutyCarDto; import com.yeejoin.amos.boot.module.common.api.dto.DutyCarDto;
import java.util.List;
import java.util.Map;
/** /**
* @author DELL * @author DELL
*/ */
...@@ -30,4 +33,5 @@ public interface IDutyCarService extends IDutyCommonService { ...@@ -30,4 +33,5 @@ public interface IDutyCarService extends IDutyCommonService {
*/ */
JSONObject isFireCarDriver(); JSONObject isFireCarDriver();
int getDutyCarCount(Long carId); int getDutyCarCount(Long carId);
List<Map<String, Object>> getDutyCaruser(Long carId);
} }
...@@ -144,6 +144,15 @@ select * from ( ...@@ -144,6 +144,15 @@ select * from (
cd.FIELD_VALUE cd.FIELD_VALUE
END END
) AS #{equipmentId}, ) AS #{equipmentId},
MAX(
CASE
WHEN cd.FIELD_CODE = 'userName' THEN
cd.FIELD_VALUE
END
) AS 'userName',
MAX( MAX(
CASE CASE
WHEN cd.FIELD_CODE = #{equipmentName} THEN WHEN cd.FIELD_CODE = #{equipmentName} THEN
......
...@@ -44,7 +44,9 @@ ...@@ -44,7 +44,9 @@
<if test='par.parent != null'>and a.parent = #{par.parent}</if> <if test='par.parent != null'>and a.parent = #{par.parent}</if>
<if test='par.typeCode != null'>and a.type_code = #{par.typeCode}</if> <if test='par.typeCode != null'>and a.type_code = #{par.typeCode}</if>
<if test='par.companyCode != null'>and a.company_code = #{par.companyCode}</if> <if test='par.companyCode != null'>and a.company_code = #{par.companyCode}</if>
<if test='par.company != null and par.company != -1'>and a.company = #{par.company}</if>
<if test='par.name != null'>and a.name like concat('%', #{par.name}, '%')</if> <if test='par.name != null'>and a.name like concat('%', #{par.name}, '%')</if>
<if test='par.address != null'>and a.address like concat('%', #{par.address}, '%')</if>
<if test='par.nodeType != null and par.nodeType == "1" and par.nodeIds != null'> <if test='par.nodeType != null and par.nodeType == "1" and par.nodeIds != null'>
and a.company in and a.company in
<foreach collection="par.nodeIds" separator="," open="(" item="nodeId" close=")"> <foreach collection="par.nodeIds" separator="," open="(" item="nodeId" close=")">
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
<if test='par.areasExpertise!=null'>and b.areas_expertise_code= #{par.areasExpertise}</if> <if test='par.areasExpertise!=null'>and b.areas_expertise_code= #{par.areasExpertise}</if>
<if test='par.name!=null'>and a.name like concat ('%',#{par.name},'%')</if> <if test='par.name!=null'>and a.name like concat ('%',#{par.name},'%')</if>
<if test='par.state!=null'>and a.state_code= #{par.state}</if> <if test='par.state!=null'>and a.state_code= #{par.state}</if>
<if test='par.company!=null and par.company!= -1'>and a.company= #{par.company}</if>
<if test='par.fireTeamId!=null'>and a.fire_team_id= #{par.fireTeamId}</if> <if test='par.fireTeamId!=null'>and a.fire_team_id= #{par.fireTeamId}</if>
<if test='par.jobTitle!=null'>and a.job_title_code =#{par.jobTitle}</if> <if test='par.jobTitle!=null'>and a.job_title_code =#{par.jobTitle}</if>
<if <if
...@@ -43,6 +44,7 @@ ...@@ -43,6 +44,7 @@
<if test='par.name!=null'>and a.name like concat ('%',#{par.name},'%')</if> <if test='par.name!=null'>and a.name like concat ('%',#{par.name},'%')</if>
<if test='par.state!=null'>and a.state_code= #{par.state}</if> <if test='par.state!=null'>and a.state_code= #{par.state}</if>
<if test='par.fireTeamId!=null'>and a.fire_team_id= #{par.fireTeamId}</if> <if test='par.fireTeamId!=null'>and a.fire_team_id= #{par.fireTeamId}</if>
<if test='par.company!=null and par.company!= -1'>and a.company= #{par.company}</if>
<if test='par.jobTitle!=null'>and a.job_title_code =#{par.jobTitle}</if> <if test='par.jobTitle!=null'>and a.job_title_code =#{par.jobTitle}</if>
<if <if
test='par.areasExpertiseCode!=null and par.areasExpertiseCode!="0"'>and b.areas_expertise_code test='par.areasExpertiseCode!=null and par.areasExpertiseCode!="0"'>and b.areas_expertise_code
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
u.sequence_nbr sequenceNbr, u.sequence_nbr sequenceNbr,
u.biz_org_name bizOrgName, u.biz_org_name bizOrgName,
u.biz_org_code bizOrgCode, u.biz_org_code bizOrgCode,
u.parent_id parent_id,
g.* g.*
FROM FROM
cb_org_usr u cb_org_usr u
...@@ -72,6 +73,9 @@ ...@@ -72,6 +73,9 @@
<if test="map.amosOrgId != null and map.amosOrgId != '-1'"> <if test="map.amosOrgId != null and map.amosOrgId != '-1'">
AND u.amos_org_id like concat(#{map.amosOrgId}, '%') AND u.amos_org_id like concat(#{map.amosOrgId}, '%')
</if> </if>
<if test="map.company != null and map.company != '-1'">
AND u.parent_id = #{map.company}
</if>
GROUP BY GROUP BY
u.sequence_nbr , u.sequence_nbr ,
u.biz_org_name , u.biz_org_name ,
...@@ -140,6 +144,9 @@ ...@@ -140,6 +144,9 @@
<if test="map.amosOrgCode != null and map.amosOrgCode != '-1'"> <if test="map.amosOrgCode != null and map.amosOrgCode != '-1'">
AND u.amos_org_code like concat('%',#{map.amosOrgCode}, '%') AND u.amos_org_code like concat('%',#{map.amosOrgCode}, '%')
</if> </if>
<if test="map.company != null and map.company != '-1'">
AND u.parent_id = #{map.company}
</if>
GROUP BY GROUP BY
u.sequence_nbr , u.sequence_nbr ,
u.biz_org_name , u.biz_org_name ,
......
...@@ -8,11 +8,19 @@ import lombok.Data; ...@@ -8,11 +8,19 @@ import lombok.Data;
@Data @Data
public class AlamVideoVO { public class AlamVideoVO {
private Long id; private Long id;
private String url; private String url;
private String token; private String token;
private String name; private String name;
private String code; private String code;
private String address;
private String img;
private String presetPosition; private String presetPosition;
} }
...@@ -2,6 +2,7 @@ package com.yeejoin.equipmanage.common.entity.vo; ...@@ -2,6 +2,7 @@ package com.yeejoin.equipmanage.common.entity.vo;
import lombok.Data; import lombok.Data;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -18,6 +19,6 @@ public class DetailPaneVO { ...@@ -18,6 +19,6 @@ public class DetailPaneVO {
//图片 //图片
private String pic; private String pic;
//参数 //参数
private List<Map<String,String>> items; private List<Map<String,String>> items = new ArrayList<Map<String,String>>();
} }
package com.yeejoin.equipmanage.common.enums;
/**
* 画布资源枚举
* @author DELL
*
*/
public enum BitmapEnum {
equipment("消防类设备", "equipment"),
video("视频类设备", "video");
BitmapEnum(String name, String key) {
this.name = name;
this.key = key;
}
private String name;
private String key;
public String getName() {
return name;
}
public String getKey() {
return key;
}
}
...@@ -147,10 +147,10 @@ ...@@ -147,10 +147,10 @@
<if test="alertStatus!= null "> <if test="alertStatus!= null ">
and a.alert_status = #{alertStatus} and a.alert_status = #{alertStatus}
</if> </if>
<if test="startTime!= null and endTime != null"> <if test="startTime!= null and endTime != null and startTime!= '' and endTime != ''">
and a.call_time between #{startTime} and #{endTime} and a.call_time between #{startTime} and #{endTime}
</if> </if>
<if test="alertTypeCode!= null "> <if test="alertTypeCode!= null and alertTypeCode!= '' ">
and a.alarm_type_code = #{alertTypeCode} and a.alarm_type_code = #{alertTypeCode}
</if> </if>
<if test="alertSourceCode!= null "> <if test="alertSourceCode!= null ">
...@@ -177,10 +177,10 @@ ...@@ -177,10 +177,10 @@
<select id="selectAllCount" resultType="int"> <select id="selectAllCount" resultType="int">
SELECT SELECT
sum(b.num) count(b.num)
FROM FROM
(SELECT (SELECT
count(distinct a.sequence_nbr) as num a.sequence_nbr as num
FROM FROM
jc_alert_called a jc_alert_called a
<if test="isFatherAlert!= null and isFatherAlert == 'true' "> <if test="isFatherAlert!= null and isFatherAlert == 'true' ">
...@@ -190,17 +190,17 @@ ...@@ -190,17 +190,17 @@
<if test="alertStatus!= null "> <if test="alertStatus!= null ">
and a.alert_status = #{alertStatus} and a.alert_status = #{alertStatus}
</if> </if>
<if test="startTime!= null and endTime != null"> <if test="startTime!= null and endTime != null and startTime!= '' and endTime != ''">
and a.call_time between #{startTime} and #{endTime} and a.call_time between #{startTime} and #{endTime}
</if> </if>
<if test="alertTypeCode!= null "> <if test="alertTypeCode!= null and alertTypeCode!= '' ">
and a.alarm_type_code = #{alertTypeCode} and a.alert_type_code = #{alertTypeCode}
</if> </if>
<if test="alertSourceCode!= null "> <if test="alertSourceCode!= null ">
and a.alert_source_code = #{alertSourceCode} and a.alert_source_code = #{alertSourceCode}
</if> </if>
<if test="systemSourceCode!= null "> <if test="systemSourceCode!= null ">
and a.system_source_code = #{systemSourceCode} and a.system_source_code in (${systemSourceCode})
</if> </if>
<if test="isFatherAlert!= null and isFatherAlert == 'true' "> <if test="isFatherAlert!= null and isFatherAlert == 'true' ">
and j.alert_called_id = a.sequence_nbr and j.alert_called_id = a.sequence_nbr
......
package com.yeejoin.amos.boot.module.tzs.flc.api.dto; package com.yeejoin.amos.boot.module.tzs.flc.api.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto; import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.util.Date; import java.util.Date;
import java.util.List;
import java.util.Map;
/** /**
* 告知申请-设备信息表 * 告知申请-设备信息表
...@@ -90,4 +95,17 @@ public class InformEquipmentDto extends BaseDto { ...@@ -90,4 +95,17 @@ public class InformEquipmentDto extends BaseDto {
@ApiModelProperty(value = "告知单id") @ApiModelProperty(value = "告知单id")
private Long informId; private Long informId;
@ApiModelProperty(value = "原设备id")
private Long sourceEquipmentId;
@ExcelIgnore
@ApiModelProperty(value = "附件")
@TableField(exist = false)
private Map<String, List<AttachmentDto>> attachments;
@ApiModelProperty(value = "设备参数")
private List<EquipmentIndexDto> equipmentIndex;
} }
...@@ -160,4 +160,9 @@ public class InformEquipment extends BaseEntity { ...@@ -160,4 +160,9 @@ public class InformEquipment extends BaseEntity {
@TableField("inform_id") @TableField("inform_id")
private Long informId; private Long informId;
/**
* 原设备id
*/
@TableField("source_equipment_id")
private Long sourceEquipmentId;
} }
...@@ -12,4 +12,5 @@ import com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentInformDto; ...@@ -12,4 +12,5 @@ import com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentInformDto;
public interface IEquipmentInformService { public interface IEquipmentInformService {
EquipmentInformDto createEquipmentInform(EquipmentInformDto model); EquipmentInformDto createEquipmentInform(EquipmentInformDto model);
} }
package com.yeejoin.amos.boot.module.tzs.flc.api.service; package com.yeejoin.amos.boot.module.tzs.flc.api.service;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.InformEquipmentDto;
import java.util.List;
/** /**
* 告知申请-设备信息表接口类 * 告知申请-设备信息表接口类
* *
...@@ -9,4 +13,11 @@ package com.yeejoin.amos.boot.module.tzs.flc.api.service; ...@@ -9,4 +13,11 @@ package com.yeejoin.amos.boot.module.tzs.flc.api.service;
*/ */
public interface IInformEquipmentService { public interface IInformEquipmentService {
InformEquipmentDto saveInformEquipment(InformEquipmentDto model);
InformEquipmentDto getEquipmentById(Long sequenceNbr);
List<InformEquipmentDto> getEquipListByInformId(Long sequenceNbr);
InformEquipmentDto updateEquipment(InformEquipmentDto model);
} }
...@@ -1104,6 +1104,7 @@ public class CommandController extends BaseController { ...@@ -1104,6 +1104,7 @@ public class CommandController extends BaseController {
if (e.get("carState").equals("在位")) { if (e.get("carState").equals("在位")) {
e.put("carState", FireCarStatusEnum.执勤.getName()); e.put("carState", FireCarStatusEnum.执勤.getName());
} }
String sequenceNbr = e.get("sequenceNbr").toString(); String sequenceNbr = e.get("sequenceNbr").toString();
//同步力量调派车辆任务状态 //同步力量调派车辆任务状态
alertFormValue.stream().forEach(v -> { alertFormValue.stream().forEach(v -> {
...@@ -1470,12 +1471,21 @@ public class CommandController extends BaseController { ...@@ -1470,12 +1471,21 @@ public class CommandController extends BaseController {
powerTransferCompanyResources = powerTransferCompanyResourcesService.getByAlertCalledIdCarId(alertCalledId, carid); powerTransferCompanyResources = powerTransferCompanyResourcesService.getByAlertCalledIdCarId(alertCalledId, carid);
// 随车人员 // 随车人员
List<PowerData> powerDataOne = powerTransferMapper.getPowerDataOne(carid); // List<PowerData> powerDataOne = powerTransferMapper.getPowerDataOne(carid);
if(!ValidationUtil.isEmpty(powerDataOne)) {
List<Map<String, Object>> equipmentList = iDutyCarService.getDutyCaruser(carid);
if(!ValidationUtil.isEmpty(equipmentList)) {
String str = ""; String str = "";
String newStr = ""; String newStr = "";
for(int i = 0; i < powerDataOne.size(); i++ ) { for(int i = 0; i < equipmentList.size(); i++ ) {
newStr = str.concat(powerDataOne.get(i).getPostTypeName()).concat(":").concat(powerDataOne.get(i).getUser()); if(i==equipmentList.size()-1){
newStr = str.concat(equipmentList.get(i).get("userName")+"");
}else{
newStr = str.concat(equipmentList.get(i).get("userName")+",");
}
} }
powerTransferCompanyResources.setPw(newStr); powerTransferCompanyResources.setPw(newStr);
} else { } else {
......
...@@ -125,8 +125,11 @@ public class FireStationController extends BaseController { ...@@ -125,8 +125,11 @@ public class FireStationController extends BaseController {
@GetMapping(value = "/list/page") @GetMapping(value = "/list/page")
@ApiOperation(httpMethod = "GET", value = "新微型消防站分页查询", notes = "新微型消防站分页查询") @ApiOperation(httpMethod = "GET", value = "新微型消防站分页查询", notes = "新微型消防站分页查询")
public ResponseModel<Page<FireStationDto>> getFireStation(@RequestParam(value = "pageNum") int pageNum, public ResponseModel<Page<FireStationDto>> getFireStation(@RequestParam(value = "pageNum") int pageNum,
@RequestParam(value = "pageSize") int pageSize, @RequestParam(value = "pageSize") int pageSize,@RequestParam(value = "company",required = false) Long company,
FireStationDto fireStationDto) { FireStationDto fireStationDto) {
if (company != null && company != -1){
fireStationDto.setBizCompanyId(company);
}
return ResponseHelper.buildResponse(fireStationServiceImpl.getFirefighters(pageNum, pageSize, fireStationDto)); return ResponseHelper.buildResponse(fireStationServiceImpl.getFirefighters(pageNum, pageSize, fireStationDto));
} }
......
...@@ -238,4 +238,16 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa ...@@ -238,4 +238,16 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
return count; return count;
} }
@Override
public List<Map<String, Object>> getDutyCaruser(Long carId) {
List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getEquipmentForSpecifyDate(DateUtils.getDateNowShortStr(),
this.getGroupCode(), "carId", "carName", "teamName","");
equipmentList = equipmentList.stream().filter((e) ->
e.containsKey("carId") && e.get("carId").equals(Long.toString(carId))
).collect(Collectors.toList());
return equipmentList;
}
} }
...@@ -392,10 +392,12 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -392,10 +392,12 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
if (!ObjectUtils.isEmpty(req.get("bizOrgName"))) { if (!ObjectUtils.isEmpty(req.get("bizOrgName"))) {
map.put("bizOrgName", req.get("bizOrgName")); map.put("bizOrgName", req.get("bizOrgName"));
} }
if (!ObjectUtils.isEmpty(req.get("personNumber"))) { if (!ObjectUtils.isEmpty(req.get("personNumber"))) {
map.put("personNumber", req.get("personNumber")); map.put("personNumber", req.get("personNumber"));
} }
if (req.containsKey("company") &&!ObjectUtils.isEmpty(req.get("company"))) {
req.put("parentId", req.get("company"));
}
/* BUG2680 查询部门人员错误 传递参数类型不正确 修改为string 2021-09-14 陈召 开始 */ /* BUG2680 查询部门人员错误 传递参数类型不正确 修改为string 2021-09-14 陈召 开始 */
if (req.get("parentId") != null && req.get("parentId") != "") { if (req.get("parentId") != null && req.get("parentId") != "") {
OrgUsr parent = this.getById(req.get("parentId").toString()); OrgUsr parent = this.getById(req.get("parentId").toString());
...@@ -405,13 +407,13 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -405,13 +407,13 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
if (req.containsKey("amosOrgId") && !ObjectUtils.isEmpty(req.get("amosOrgId"))) { if (req.containsKey("amosOrgId") && !ObjectUtils.isEmpty(req.get("amosOrgId"))) {
map.put("amosOrgCode", req.get("amosOrgId"));//当时给前端给的key名字错了,以为是传Id过来,现在传名字,那就将错就错吧 map.put("amosOrgCode", req.get("amosOrgId"));//当时给前端给的key名字错了,以为是传Id过来,现在传名字,那就将错就错吧
} }
req.remove("bizOrgName"); req.remove("bizOrgName");
req.remove("pageSize"); req.remove("pageSize");
req.remove("pageNum"); req.remove("pageNum");
req.remove("parentId"); req.remove("parentId");
req.remove("amosOrgId"); req.remove("amosOrgId");
req.remove("company");
map.put("fieldsValue", req); map.put("fieldsValue", req);
map.put("fields", alertFormServiceImpl.queryListByFormId(OrgPersonEnum.人员.getCode())); map.put("fields", alertFormServiceImpl.queryListByFormId(OrgPersonEnum.人员.getCode()));
pageBean.setTotal(this.baseMapper.selectPersonListCount(map)); pageBean.setTotal(this.baseMapper.selectPersonListCount(map));
......
...@@ -153,8 +153,8 @@ public class EquipmentSpecificController extends AbstractBaseController { ...@@ -153,8 +153,8 @@ public class EquipmentSpecificController extends AbstractBaseController {
@RequestMapping(value = "/getOneCard", method = RequestMethod.GET) @RequestMapping(value = "/getOneCard", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "根据id查询", notes = "组装组态使用装备卡片数据") @ApiOperation(httpMethod = "GET", value = "根据id查询", notes = "组装组态使用装备卡片数据")
public DetailPaneVO getOneCard(Long id) { public Object getOneCard(Long id , String type) {
return equipmentSpecificSerivce.getOneCard(id); return equipmentSpecificSerivce.getOneCard(id , type);
} }
/** /**
......
...@@ -272,7 +272,7 @@ public class VideoController extends AbstractBaseController { ...@@ -272,7 +272,7 @@ public class VideoController extends AbstractBaseController {
@ApiOperation(httpMethod = "GET", value = "通过视频id和预置位获取可播放的flv格式地址", notes = "通过视频id和预置位获取可播放的flv格式地址") @ApiOperation(httpMethod = "GET", value = "通过视频id和预置位获取可播放的flv格式地址", notes = "通过视频id和预置位获取可播放的flv格式地址")
public String getVideoFlvUrl(@RequestParam String videoId, public String getVideoFlvUrl(@RequestParam String videoId,
@RequestParam String presetIndex) { @RequestParam String presetIndex) {
String flvUrl = videoService.getVideoUrl(videoId, presetIndex, ""); String flvUrl = videoService.getVideoUrl(videoId, presetIndex, "", "");
return flvUrl; return flvUrl;
} }
......
package com.yeejoin.equipmanage.fegin;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.yeejoin.amos.boot.biz.common.feign.MultipartSupportConfig;
/**
* @description:
* @author: tw
* @createDate: 2021/10/20
*/
@FeignClient(name = "${video.fegin.name}", path = "video", configuration = {MultipartSupportConfig.class})
public interface VideoFeignClient {
@RequestMapping(value = "/video-original/url/video/{indexCode}", method = RequestMethod.GET)
ResponseModel<String> videoUrlByIndexCode(@PathVariable("indexCode") String indexCode);
}
...@@ -41,7 +41,8 @@ public interface VideoMapper extends BaseMapper<Video> { ...@@ -41,7 +41,8 @@ public interface VideoMapper extends BaseMapper<Video> {
* @return * @return
*/ */
List<AlamVideoVO> getVideoBySpeId(Long id); List<AlamVideoVO> getVideoBySpeId(Long id);
List<AlamVideoVO> getVideoById(Long id);
AlamVideoVO getVideoById(Long id);
/** /**
......
...@@ -80,7 +80,7 @@ public interface IEquipmentSpecificSerivce extends IService<EquipmentSpecific> { ...@@ -80,7 +80,7 @@ public interface IEquipmentSpecificSerivce extends IService<EquipmentSpecific> {
* @param id * @param id
* @return * @return
*/ */
DetailPaneVO getOneCard(Long id); Object getOneCard(Long id, String type);
/** /**
* 通过id获取设备区域建筑等信息 * 通过id获取设备区域建筑等信息
......
...@@ -75,5 +75,5 @@ public interface IVideoService extends IService<Video> { ...@@ -75,5 +75,5 @@ public interface IVideoService extends IService<Video> {
* @param defaultUrl * @param defaultUrl
* @return * @return
*/ */
String getVideoUrl(String videoId, String presetIndex, String defaultUrl); String getVideoUrl(String videoId, String presetIndex, String defaultUrl, String code);
} }
...@@ -763,7 +763,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i ...@@ -763,7 +763,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
x.setLocation(x.getAddress()); x.setLocation(x.getAddress());
} }
} }
x.setUrl(videoService.getVideoUrl(x.getName(), x.getPresetPosition(), x.getUrl())); x.setUrl(videoService.getVideoUrl(x.getName(), x.getPresetPosition(), x.getUrl(), x.getCode()));
}); });
} }
return pages; return pages;
......
...@@ -83,9 +83,9 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ ...@@ -83,9 +83,9 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
final String alarmType = "IOT_CORE_PARAM"; final String alarmType = "IOT_CORE_PARAM";
Map<String, Object> res = new HashMap<>(); Map<String, Object> res = new HashMap<>();
if (videoType.equals(type)) { if (videoType.equals(type)) {
List<AlamVideoVO> video = videoMapper.getVideoById(equipId); List<AlamVideoVO> video = videoMapper.getVideoBySpeId(equipId);
video.forEach(action -> { video.forEach(action -> {
action.setUrl(videoService.getVideoUrl(action.getName(), action.getPresetPosition(), action.getUrl())); action.setUrl(videoService.getVideoUrl(action.getName(), action.getPresetPosition(), action.getUrl(), action.getCode()));
}); });
res.put("video", video); res.put("video", video);
return res; return res;
...@@ -103,7 +103,7 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ ...@@ -103,7 +103,7 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
} }
videoBySpeId.forEach(action -> { videoBySpeId.forEach(action -> {
action.setUrl(videoService.getVideoUrl(action.getName(), action.getPresetPosition(), action.getUrl())); action.setUrl(videoService.getVideoUrl(action.getName(), action.getPresetPosition(), action.getUrl(), action.getCode()));
}); });
res.put("data", specificAlarm); res.put("data", specificAlarm);
res.put("video", videoBySpeId); res.put("video", videoBySpeId);
......
...@@ -237,7 +237,7 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec ...@@ -237,7 +237,7 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
video.setName(x.getName()); video.setName(x.getName());
video.setTokens(x.getToken()); video.setTokens(x.getToken());
video.setUrl(x.getUrl()); video.setUrl(x.getUrl());
video.setUrl(videoService.getVideoUrl(x.getName(), x.getPresetPosition(), x.getUrl())); video.setUrl(videoService.getVideoUrl(x.getName(), x.getPresetPosition(), x.getUrl(), x.getCode()));
video.setIp(x.getIp()); video.setIp(x.getIp());
video.setPort(x.getPort()); video.setPort(x.getPort());
video.setCode(x.getCode()); video.setCode(x.getCode());
......
...@@ -57,6 +57,7 @@ import com.yeejoin.equipmanage.common.entity.Video; ...@@ -57,6 +57,7 @@ import com.yeejoin.equipmanage.common.entity.Video;
import com.yeejoin.equipmanage.common.entity.Warehouse; import com.yeejoin.equipmanage.common.entity.Warehouse;
import com.yeejoin.equipmanage.common.entity.WarehouseStructure; import com.yeejoin.equipmanage.common.entity.WarehouseStructure;
import com.yeejoin.equipmanage.common.entity.dto.EquipmentSpecificDTO; import com.yeejoin.equipmanage.common.entity.dto.EquipmentSpecificDTO;
import com.yeejoin.equipmanage.common.entity.vo.AlamVideoVO;
import com.yeejoin.equipmanage.common.entity.vo.AlarmInfoVO; import com.yeejoin.equipmanage.common.entity.vo.AlarmInfoVO;
import com.yeejoin.equipmanage.common.entity.vo.AlarmVO; import com.yeejoin.equipmanage.common.entity.vo.AlarmVO;
import com.yeejoin.equipmanage.common.entity.vo.ComplementCodeVO; import com.yeejoin.equipmanage.common.entity.vo.ComplementCodeVO;
...@@ -76,6 +77,7 @@ import com.yeejoin.equipmanage.common.entity.vo.TechInfoListVO; ...@@ -76,6 +77,7 @@ import com.yeejoin.equipmanage.common.entity.vo.TechInfoListVO;
import com.yeejoin.equipmanage.common.entity.vo.TechInfoVO; import com.yeejoin.equipmanage.common.entity.vo.TechInfoVO;
import com.yeejoin.equipmanage.common.entity.vo.VideoVO; import com.yeejoin.equipmanage.common.entity.vo.VideoVO;
import com.yeejoin.equipmanage.common.enums.BillContentEnum; import com.yeejoin.equipmanage.common.enums.BillContentEnum;
import com.yeejoin.equipmanage.common.enums.BitmapEnum;
import com.yeejoin.equipmanage.common.enums.EquipmentRiskTypeEnum; import com.yeejoin.equipmanage.common.enums.EquipmentRiskTypeEnum;
import com.yeejoin.equipmanage.common.enums.FileTypeEnum; import com.yeejoin.equipmanage.common.enums.FileTypeEnum;
import com.yeejoin.equipmanage.common.enums.StockBillTypeEnum; import com.yeejoin.equipmanage.common.enums.StockBillTypeEnum;
...@@ -89,10 +91,12 @@ import com.yeejoin.equipmanage.common.vo.EquipmentDetailVo; ...@@ -89,10 +91,12 @@ import com.yeejoin.equipmanage.common.vo.EquipmentDetailVo;
import com.yeejoin.equipmanage.common.vo.EquipmentOnCarVo; import com.yeejoin.equipmanage.common.vo.EquipmentOnCarVo;
import com.yeejoin.equipmanage.common.vo.EquipmentSpecific3dVo; import com.yeejoin.equipmanage.common.vo.EquipmentSpecific3dVo;
import com.yeejoin.equipmanage.config.EquipmentIotMqttReceiveConfig; import com.yeejoin.equipmanage.config.EquipmentIotMqttReceiveConfig;
import com.yeejoin.equipmanage.fegin.VideoFeignClient;
import com.yeejoin.equipmanage.mapper.EquipmentIndexMapper; import com.yeejoin.equipmanage.mapper.EquipmentIndexMapper;
import com.yeejoin.equipmanage.mapper.EquipmentSpecificAlarmMapper; import com.yeejoin.equipmanage.mapper.EquipmentSpecificAlarmMapper;
import com.yeejoin.equipmanage.mapper.EquipmentSpecificMapper; import com.yeejoin.equipmanage.mapper.EquipmentSpecificMapper;
import com.yeejoin.equipmanage.mapper.UploadFileMapper; import com.yeejoin.equipmanage.mapper.UploadFileMapper;
import com.yeejoin.equipmanage.mapper.VideoMapper;
import com.yeejoin.equipmanage.service.IEquPropertyService; import com.yeejoin.equipmanage.service.IEquPropertyService;
import com.yeejoin.equipmanage.service.IEquipmentCategoryService; import com.yeejoin.equipmanage.service.IEquipmentCategoryService;
import com.yeejoin.equipmanage.service.IEquipmentDetailService; import com.yeejoin.equipmanage.service.IEquipmentDetailService;
...@@ -109,6 +113,7 @@ import com.yeejoin.equipmanage.service.IStockService; ...@@ -109,6 +113,7 @@ import com.yeejoin.equipmanage.service.IStockService;
import com.yeejoin.equipmanage.service.ISyncDataService; import com.yeejoin.equipmanage.service.ISyncDataService;
import com.yeejoin.equipmanage.service.ISystemDicService; import com.yeejoin.equipmanage.service.ISystemDicService;
import com.yeejoin.equipmanage.service.IUploadFileService; import com.yeejoin.equipmanage.service.IUploadFileService;
import com.yeejoin.equipmanage.service.IVideoService;
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 com.yeejoin.equipmanage.utils.RelationRedisUtil; import com.yeejoin.equipmanage.utils.RelationRedisUtil;
...@@ -175,6 +180,9 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -175,6 +180,9 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
@Autowired @Autowired
IEquipmentIndexService iEquipmentIndexService; IEquipmentIndexService iEquipmentIndexService;
@Autowired
private IVideoService videoService;
@Value("${systemctl.dict.iot-core-param}") @Value("${systemctl.dict.iot-core-param}")
private String iotCoreParam; private String iotCoreParam;
...@@ -196,10 +204,14 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -196,10 +204,14 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
@Autowired @Autowired
private RelationRedisUtil relationRedisUtil; private RelationRedisUtil relationRedisUtil;
@Autowired
private VideoMapper videoMapper;
@Value("${systemctl.sync.switch}") @Value("${systemctl.sync.switch}")
private Boolean syncSwitch; private Boolean syncSwitch;
private final String injection = "{\n" + private final String injection = "{\n" +
"\n" + "\n" +
" \"items\": [\n" + " \"items\": [\n" +
...@@ -1050,13 +1062,24 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -1050,13 +1062,24 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
} }
@Override @Override
public DetailPaneVO getOneCard(Long id) { public Object getOneCard(Long id, String type) {
DetailPaneVO detailPaneVO = new DetailPaneVO(); if(BitmapEnum.video.getKey().equals(type)){
Map<String, String> map = this.baseMapper.getQrCodeAndPic(id); AlamVideoVO video = videoMapper.getVideoById(id);
detailPaneVO.setQrCode(map.get("qrCode")); if(!ObjectUtils.isEmpty(video)){
detailPaneVO.setPic(map.get("pic")); video.setUrl(videoService.getVideoUrl(video.getName().toString(), video.getPresetPosition(), video.getUrl(), video.getCode()));
detailPaneVO.setItems(this.baseMapper.getOneCard(id)); }
return detailPaneVO; return video;
}else{
DetailPaneVO detailPaneVO = new DetailPaneVO();
Map<String, String> map = this.baseMapper.getQrCodeAndPic(id);
if(ObjectUtils.isEmpty(map)){
return detailPaneVO;
}
detailPaneVO.setQrCode(map.get("qrCode"));
detailPaneVO.setPic(map.get("pic"));
detailPaneVO.setItems(this.baseMapper.getOneCard(id));
return detailPaneVO;
}
} }
@Override @Override
......
package com.yeejoin.equipmanage.service.impl; package com.yeejoin.equipmanage.service.impl;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yeejoin.equipmanage.common.entity.*; import com.yeejoin.equipmanage.common.entity.EquipmentCategory;
import com.yeejoin.equipmanage.common.entity.EquipmentIndex;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecific;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex;
import com.yeejoin.equipmanage.common.entity.Video;
import com.yeejoin.equipmanage.common.entity.VideoEquipmentSpecific;
import com.yeejoin.equipmanage.common.entity.VideoImportantEquipment;
import com.yeejoin.equipmanage.common.entity.VideoSource;
import com.yeejoin.equipmanage.common.entity.WarehouseStructure;
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;
import com.yeejoin.equipmanage.common.entity.vo.*; import com.yeejoin.equipmanage.common.entity.vo.BuildingListVO;
import com.yeejoin.equipmanage.common.entity.vo.BuildingVideoListVO;
import com.yeejoin.equipmanage.common.entity.vo.BuildingVideoVO;
import com.yeejoin.equipmanage.common.entity.vo.EquipmentCategoryTypeTreeVO;
import com.yeejoin.equipmanage.common.entity.vo.EquipmentSpecificVo;
import com.yeejoin.equipmanage.common.entity.vo.PageSecurityVideoVO;
import com.yeejoin.equipmanage.common.entity.vo.PageVideoVO;
import com.yeejoin.equipmanage.common.entity.vo.VideoDownloadVO;
import com.yeejoin.equipmanage.common.entity.vo.VideoListVo;
import com.yeejoin.equipmanage.common.enums.EquipmentSpeIndexEnum; import com.yeejoin.equipmanage.common.enums.EquipmentSpeIndexEnum;
import com.yeejoin.equipmanage.common.enums.IndustryEnum; import com.yeejoin.equipmanage.common.enums.IndustryEnum;
import com.yeejoin.equipmanage.common.utils.HttpContentTypeUtil; import com.yeejoin.equipmanage.common.utils.HttpContentTypeUtil;
import com.yeejoin.equipmanage.common.utils.StringUtil; import com.yeejoin.equipmanage.common.utils.StringUtil;
import com.yeejoin.equipmanage.fegin.VideoFeignClient;
import com.yeejoin.equipmanage.mapper.VideoMapper; import com.yeejoin.equipmanage.mapper.VideoMapper;
import com.yeejoin.equipmanage.service.*; import com.yeejoin.equipmanage.service.IBuilldService;
import lombok.extern.slf4j.Slf4j; import com.yeejoin.equipmanage.service.IEquipmentCategoryService;
import org.apache.commons.lang3.StringUtils; import com.yeejoin.equipmanage.service.IEquipmentIndexService;
import org.springframework.beans.factory.annotation.Autowired; import com.yeejoin.equipmanage.service.IEquipmentSpecificIndexService;
import org.springframework.beans.factory.annotation.Value; import com.yeejoin.equipmanage.service.IEquipmentSpecificSerivce;
import org.springframework.context.annotation.Lazy; import com.yeejoin.equipmanage.service.IVideoEquipmentSpecificService;
import org.springframework.stereotype.Service; import com.yeejoin.equipmanage.service.IVideoImportantEquipmentService;
import org.springframework.transaction.annotation.Transactional; import com.yeejoin.equipmanage.service.IVideoService;
import org.springframework.util.ObjectUtils; import com.yeejoin.equipmanage.service.IVideoSourceService;
import org.typroject.tyboot.core.foundation.utils.Bean; import com.yeejoin.equipmanage.service.IWarehouseStructureService;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.util.*; import lombok.extern.slf4j.Slf4j;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
/** /**
* @author ZeHua Li * @author ZeHua Li
...@@ -67,6 +102,10 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements ...@@ -67,6 +102,10 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
@Autowired @Autowired
VideoMapper videoMapper; VideoMapper videoMapper;
@Autowired
VideoFeignClient videoFeignClient;
@Value("${param.htvideo.url}") @Value("${param.htvideo.url}")
...@@ -484,12 +523,26 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements ...@@ -484,12 +523,26 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
@Override @Override
public String getVideoUrl(String videoId, String presetIndex, String defaultUrl) { public String getVideoUrl(String videoId, String presetIndex, String defaultUrl, String code) {
if ("off".equals(isUseVideoTranscoding)) { if ("off".equals(isUseVideoTranscoding)) {
return defaultUrl; String url = getVideoUrl(code);
return ObjectUtils.isEmpty(url) ? defaultUrl : url;
} }
return getFlvUrlByVideoIdOrPresetIndex(videoId, presetIndex); return getFlvUrlByVideoIdOrPresetIndex(videoId, presetIndex);
} }
private String getVideoUrl(String code){
String url = "";
try{
ResponseModel<String> da = videoFeignClient.videoUrlByIndexCode(code);
if(!ObjectUtils.isEmpty(da)){
url = da.getResult().substring(da.getResult().indexOf("openUrl"));
}
}catch (Exception e) {
log.error("视频服务调用失败", e.getMessage());
}
return url;
}
public String getFlvUrlByVideoIdOrPresetIndex(String videoId, String presetIndex) { public String getFlvUrlByVideoIdOrPresetIndex(String videoId, String presetIndex) {
try { try {
...@@ -544,91 +597,4 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements ...@@ -544,91 +597,4 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
return "rtsp"; return "rtsp";
} }
// /**
// * 异步保存监控和建筑关联关系
// * @param buildingCodes
// * @param videoId
// */
// @Async
// void saveVideoSource(String[] buildingCodes,Long videoId){
// List<VideoSource> videoSources = new ArrayList<>();
//
// //转map,方便后面code转id
// List<WarehouseStructure> list = warehouseStructureService.list();
// Map<String,Long> map = new HashMap<>();
// list.stream().forEach(x->{
// map.put(x.getCode(),x.getId());
// });
//
// //拼接数据
// for (int i = 0; i < buildingCodes.length; i++) {
// VideoSource videoSource = new VideoSource();
// videoSource.setVideoId(videoId);
// //通过code取id
// videoSource.setSourceId(map.get(buildingCodes[i]));
// videoSources.add(videoSource);
// }
//
// videoSourceService.saveBatch(videoSources);
// }
//
// /**
// * 异步保存监控和单个装备关联关系
// * @param equipmentSpecificCodes
// * @param videoId
// */
// @Async
// void saveEquipmentSpecificCodes(String[] equipmentSpecificCodes,Long videoId){
//
// List<VideoEquipmentSpecific> videoSources = new ArrayList<>();
//
// //转map,方便后面code转id
// List<EquipmentSpecific> list = equipmentSpecificSerivce.list();
// Map<String,Long> map = new HashMap<>();
// list.stream().forEach(x->{
// map.put(x.getCode(),x.getId());
// });
// //拼接数据
// for (int i = 0; i < equipmentSpecificCodes.length; i++) {
// VideoEquipmentSpecific videoEquipmentSpecific = new VideoEquipmentSpecific();
// videoEquipmentSpecific.setVideoId(videoId);
// //通过code取id
// videoEquipmentSpecific.setEquipmentSpecificId(map.get(equipmentSpecificCodes[i]));
// videoSources.add(videoEquipmentSpecific);
// }
//
// videoEquipmentSpecificService.saveBatch(videoSources);
// }
//
//
// /**
// * 异步保存监控和重点设备关联关系
// * @param importantEquipmentCodes
// * @param videoId
// */
// @Async
// void saveImportantEquipmentCodes(String[] importantEquipmentCodes,Long videoId){
//
// List<VideoImportantEquipment> videoImportantEquipments = new ArrayList<>();
//
// //转map,方便后面code转id
// List<EquipmentSpecificVo> list = baseMapper.selectImportantEquipment();
// Map<String,Long> map = new HashMap<>();
// list.stream().forEach(x->{
// map.put(x.getCode(),x.getId());
// });
//
// //拼接数据
// for (int i = 0; i < importantEquipmentCodes.length; i++) {
// VideoImportantEquipment videoImportantEquipment = new VideoImportantEquipment();
// videoImportantEquipment.setVideoId(videoId);
// //通过code取id
// videoImportantEquipment.setImportantEquipmentId(map.get(importantEquipmentCodes[i]));
// videoImportantEquipments.add(videoImportantEquipment);
// }
// videoImportantEquipmentService.saveBatch(videoImportantEquipments);
// }
} }
package com.yeejoin.amos.fas.business.feign; //package com.yeejoin.amos.fas.business.feign;
//
import feign.codec.Encoder; //import feign.codec.Encoder;
import feign.form.spring.SpringFormEncoder; //import feign.form.spring.SpringFormEncoder;
import org.springframework.beans.factory.ObjectFactory; //import org.springframework.beans.factory.ObjectFactory;
import org.springframework.beans.factory.annotation.Autowired; //import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.http.HttpMessageConverters; //import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
import org.springframework.cloud.openfeign.support.SpringEncoder; //import org.springframework.cloud.openfeign.support.SpringEncoder;
import org.springframework.context.annotation.Bean; //import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; //import org.springframework.context.annotation.Configuration;
import org.springframework.web.context.request.RequestContextListener; //import org.springframework.web.context.request.RequestContextListener;
//
/** ///**
* @Author: xinglei // * @Author: xinglei
* @Description: // * @Description:
* @Date: 2020/3/30 16:26 // * @Date: 2020/3/30 16:26
*/ // */
@Configuration //@Configuration
public class MultipartSupportConfig { //public class MultipartSupportConfig {
//
@Autowired // @Autowired
private ObjectFactory<HttpMessageConverters> messageConverters; // private ObjectFactory<HttpMessageConverters> messageConverters;
//
@Bean // @Bean
public Encoder feignFormEncoder() { // public Encoder feignFormEncoder() {
return new SpringFormEncoder(new SpringEncoder(messageConverters)); // return new SpringFormEncoder(new SpringEncoder(messageConverters));
} // }
//
/** // /**
* 创建Feign请求拦截器,在发送请求前设置认证的token,各个微服务将token设置到环境变量中来达到通用 // * 创建Feign请求拦截器,在发送请求前设置认证的token,各个微服务将token设置到环境变量中来达到通用
* @return // * @return
*/ // */
@Bean // @Bean
public RequestContextListener requestInterceptor() { // public RequestContextListener requestInterceptor() {
return new RequestContextListener(); // return new RequestContextListener();
} // }
} //}
...@@ -6,6 +6,8 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -6,6 +6,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import com.yeejoin.amos.boot.biz.common.feign.MultipartSupportConfig;
@FeignClient(name = "${outSystem.fegin.name}", configuration = {MultipartSupportConfig.class}) @FeignClient(name = "${outSystem.fegin.name}", configuration = {MultipartSupportConfig.class})
public interface OutTokenLoginFeign { public interface OutTokenLoginFeign {
......
package com.yeejoin.amos.fas.business.feign; package com.yeejoin.amos.fas.business.feign;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import java.util.Map;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.Map; import com.yeejoin.amos.boot.biz.common.feign.MultipartSupportConfig;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
@FeignClient(name = "${privilege.fegin.name}", configuration = {MultipartSupportConfig.class}) @FeignClient(name = "${privilege.fegin.name}", configuration = {MultipartSupportConfig.class})
public interface PrivilegeFeign { public interface PrivilegeFeign {
......
package com.yeejoin.amos.fas.business.feign; package com.yeejoin.amos.fas.business.feign;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import com.yeejoin.amos.boot.biz.common.feign.MultipartSupportConfig;
import com.yeejoin.amos.fas.business.jpush.PushMsgParam; import com.yeejoin.amos.fas.business.jpush.PushMsgParam;
import com.yeejoin.amos.fas.core.util.CommonResponse; import com.yeejoin.amos.fas.core.util.CommonResponse;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
import org.springframework.cloud.openfeign.FeignClient;
/** /**
......
package com.yeejoin.amos.maintenance.feign; //package com.yeejoin.amos.maintenance.feign;
//
import feign.codec.Encoder; //import feign.codec.Encoder;
import feign.form.spring.SpringFormEncoder; //import feign.form.spring.SpringFormEncoder;
import org.springframework.beans.factory.ObjectFactory; //import org.springframework.beans.factory.ObjectFactory;
import org.springframework.beans.factory.annotation.Autowired; //import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.http.HttpMessageConverters; //import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
import org.springframework.cloud.openfeign.support.SpringEncoder; //import org.springframework.cloud.openfeign.support.SpringEncoder;
import org.springframework.context.annotation.Bean; //import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; //import org.springframework.context.annotation.Configuration;
import org.springframework.web.context.request.RequestContextListener; //import org.springframework.web.context.request.RequestContextListener;
//
/** ///**
* @Author: xinglei // * @Author: xinglei
* @Description: // * @Description:
* @Date: 2020/3/30 16:26 // * @Date: 2020/3/30 16:26
*/ // */
@Configuration //@Configuration
public class MultipartSupportConfig { //public class MultipartSupportConfig {
//
@Autowired // @Autowired
private ObjectFactory<HttpMessageConverters> messageConverters; // private ObjectFactory<HttpMessageConverters> messageConverters;
//
@Bean // @Bean
public Encoder feignFormEncoder() { // public Encoder feignFormEncoder() {
return new SpringFormEncoder(new SpringEncoder(messageConverters)); // return new SpringFormEncoder(new SpringEncoder(messageConverters));
} // }
//
/** // /**
* 创建Feign请求拦截器,在发送请求前设置认证的token,各个微服务将token设置到环境变量中来达到通用 // * 创建Feign请求拦截器,在发送请求前设置认证的token,各个微服务将token设置到环境变量中来达到通用
* @return // * @return
*/ // */
@Bean // @Bean
public RequestContextListener requestInterceptor() { // public RequestContextListener requestInterceptor() {
return new RequestContextListener(); // return new RequestContextListener();
} // }
} //}
package com.yeejoin.amos.maintenance.feign; package com.yeejoin.amos.maintenance.feign;
import com.yeejoin.amos.maintenance.business.util.CommonResponse; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import com.yeejoin.amos.boot.biz.common.feign.MultipartSupportConfig;
import com.yeejoin.amos.maintenance.business.param.PushMsgParam; import com.yeejoin.amos.maintenance.business.param.PushMsgParam;
import org.springframework.web.bind.annotation.RequestBody; import com.yeejoin.amos.maintenance.business.util.CommonResponse;
import org.springframework.cloud.openfeign.FeignClient;
......
...@@ -94,9 +94,9 @@ public class EquipmentController extends BaseController { ...@@ -94,9 +94,9 @@ public class EquipmentController extends BaseController {
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}") @PutMapping(value = "/updateEquipment")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新装备信息表", notes = "根据sequenceNbr更新装备信息表") @ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新装备信息表", notes = "根据sequenceNbr更新装备信息表")
public ResponseModel<EquipmentDto> updateBySequenceNbrEquipment(@RequestBody EquipmentDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) { public ResponseModel<EquipmentDto> updateBySequenceNbrEquipment(@RequestBody EquipmentDto model) {
if (ValidationUtil.isEmpty(model) if (ValidationUtil.isEmpty(model)
|| ValidationUtil.isEmpty(model.getSequenceNbr())) { || ValidationUtil.isEmpty(model.getSequenceNbr())) {
throw new BadRequest("参数校验失败."); throw new BadRequest("参数校验失败.");
......
...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.tzs.flc.biz.controller; ...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.tzs.flc.biz.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils; import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.InformEquipmentDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.EquipmentInform; import com.yeejoin.amos.boot.module.tzs.flc.api.entity.EquipmentInform;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -10,6 +11,8 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -10,6 +11,8 @@ import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.List; import java.util.List;
import com.yeejoin.amos.boot.module.tzs.flc.biz.service.impl.EquipmentInformServiceImpl; import com.yeejoin.amos.boot.module.tzs.flc.biz.service.impl.EquipmentInformServiceImpl;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
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;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -45,7 +48,7 @@ public class EquipmentInformController extends BaseController { ...@@ -45,7 +48,7 @@ public class EquipmentInformController extends BaseController {
public ResponseModel<String> getInformCode(@PathVariable String regionCode) { public ResponseModel<String> getInformCode(@PathVariable String regionCode) {
// 行政编码 + 年月 + 顺序号 // 行政编码 + 年月 + 顺序号
String code = regionCode +DateUtils.getDateNowShortNumber(); String code = regionCode +DateUtils.getDateNowShortNumber();
int number = equipmentInformServiceImpl.count(new LambdaQueryWrapper<EquipmentInform>().like(EquipmentInform::getProductCode,code)); int number = equipmentInformServiceImpl.count(new LambdaQueryWrapper<EquipmentInform>().like(EquipmentInform::getProductCode,regionCode));
String numberStr = String.format("%04d", number); String numberStr = String.format("%04d", number);
code += numberStr; code += numberStr;
return ResponseHelper.buildResponse(code); return ResponseHelper.buildResponse(code);
...@@ -133,4 +136,8 @@ public class EquipmentInformController extends BaseController { ...@@ -133,4 +136,8 @@ public class EquipmentInformController extends BaseController {
public ResponseModel<List<EquipmentInformDto>> selectForList() { public ResponseModel<List<EquipmentInformDto>> selectForList() {
return ResponseHelper.buildResponse(equipmentInformServiceImpl.queryForEquipmentInformList()); return ResponseHelper.buildResponse(equipmentInformServiceImpl.queryForEquipmentInformList());
} }
} }
package com.yeejoin.amos.boot.module.tzs.flc.biz.controller; package com.yeejoin.amos.boot.module.tzs.flc.biz.controller;
import org.springframework.web.bind.annotation.RequestMapping; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import io.swagger.annotations.ApiOperation; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.List; import com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.InformEquipmentDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.InformEquipment;
import com.yeejoin.amos.boot.module.tzs.flc.biz.service.impl.InformEquipmentServiceImpl; import com.yeejoin.amos.boot.module.tzs.flc.biz.service.impl.InformEquipmentServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
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;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*; import java.util.List;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.InformEquipmentDto;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
/** /**
* 告知申请-设备信息表 * 告知申请-设备信息表
...@@ -31,31 +43,65 @@ public class InformEquipmentController extends BaseController { ...@@ -31,31 +43,65 @@ public class InformEquipmentController extends BaseController {
@Autowired @Autowired
InformEquipmentServiceImpl informEquipmentServiceImpl; InformEquipmentServiceImpl informEquipmentServiceImpl;
/** /**
* 新增告知申请-设备信息表 * 新增告知书设备
* * @param model
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save") @PostMapping(value = "/saveInformEquipment")
@ApiOperation(httpMethod = "POST", value = "新增告知申请-设备信息表", notes = "新增告知申请-设备信息表") @ApiOperation(httpMethod = "POST", value = "新增告知书设备", notes = "新增告知书设备")
public ResponseModel<InformEquipmentDto> save(@RequestBody InformEquipmentDto model) { public ResponseModel<InformEquipmentDto> save(@RequestBody InformEquipmentDto model) {
model = informEquipmentServiceImpl.createWithModel(model); if (ValidationUtil.isEmpty(model.getSourceEquipmentId())
return ResponseHelper.buildResponse(model); || ValidationUtil.isEmpty(model.getInformId())) {
throw new BadRequest("参数校验失败.");
}
model = informEquipmentServiceImpl.saveInformEquipment(model);
return ResponseHelper.buildResponse(model);
} }
/** /**
* 根据sequenceNbr更新 * 根据sequenceNbr查询
* *
* @param sequenceNbr 主键 * @param sequenceNbr 主键
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询单个装备信息", notes = "根据sequenceNbr查询单个装备信息")
public ResponseModel<InformEquipmentDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(informEquipmentServiceImpl.getEquipmentById(sequenceNbr));
}
/**
* 根据告知书id 查询相关设备信息
* @param sequenceNbr
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}") @GetMapping(value = "/getEquipListByInformId/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新告知申请-设备信息表", notes = "根据sequenceNbr更新告知申请-设备信息表") @ApiOperation(httpMethod = "GET", value = "根据告知书id 查询相关设备信息", notes = "根据告知书id 查询相关设备信息")
public ResponseModel<InformEquipmentDto> updateBySequenceNbrInformEquipment(@RequestBody InformEquipmentDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) { public ResponseModel<List<InformEquipmentDto>> getEquipListByInformId(@PathVariable Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr); List<InformEquipmentDto> result = informEquipmentServiceImpl.getEquipListByInformId(sequenceNbr);
return ResponseHelper.buildResponse(informEquipmentServiceImpl.updateWithModel(model)); return ResponseHelper.buildResponse(result);
}
/**
* 根据sequenceNbr更新
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/updateEquipment")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新装备信息表", notes = "根据sequenceNbr更新装备信息表")
public ResponseModel<InformEquipmentDto> updateBySequenceNbrEquipment(@RequestBody InformEquipmentDto model) {
if (ValidationUtil.isEmpty(model)
|| ValidationUtil.isEmpty(model.getSequenceNbr())) {
throw new BadRequest("参数校验失败.");
}
model = informEquipmentServiceImpl.updateEquipment(model);
return ResponseHelper.buildResponse(model);
} }
/** /**
...@@ -68,49 +114,8 @@ public class InformEquipmentController extends BaseController { ...@@ -68,49 +114,8 @@ public class InformEquipmentController extends BaseController {
@DeleteMapping(value = "/{sequenceNbr}") @DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除告知申请-设备信息表", notes = "根据sequenceNbr删除告知申请-设备信息表") @ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除告知申请-设备信息表", notes = "根据sequenceNbr删除告知申请-设备信息表")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){ public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){
return ResponseHelper.buildResponse(informEquipmentServiceImpl.removeById(sequenceNbr)); return ResponseHelper.buildResponse(informEquipmentServiceImpl.update(new LambdaUpdateWrapper<InformEquipment>().eq(InformEquipment::getSequenceNbr,sequenceNbr).set(InformEquipment::getIsDelete,true)));
} }
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个告知申请-设备信息表", notes = "根据sequenceNbr查询单个告知申请-设备信息表")
public ResponseModel<InformEquipmentDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(informEquipmentServiceImpl.queryBySeq(sequenceNbr));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "告知申请-设备信息表分页查询", notes = "告知申请-设备信息表分页查询")
public ResponseModel<Page<InformEquipmentDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size) {
Page<InformEquipmentDto> page = new Page<InformEquipmentDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(informEquipmentServiceImpl.queryForInformEquipmentPage(page));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "告知申请-设备信息表列表全部数据查询", notes = "告知申请-设备信息表列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<InformEquipmentDto>> selectForList() {
return ResponseHelper.buildResponse(informEquipmentServiceImpl.queryForInformEquipmentList());
}
} }
package com.yeejoin.amos.boot.module.tzs.flc.biz.service.impl; package com.yeejoin.amos.boot.module.tzs.flc.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr; import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl; import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.SourceFileServiceImpl; import com.yeejoin.amos.boot.module.common.biz.service.impl.SourceFileServiceImpl;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentDto; import com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentIndexDto; import com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentIndexDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.InformEquipmentDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.Equipment;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.EquipmentIndex;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.EquipmentInform; import com.yeejoin.amos.boot.module.tzs.flc.api.entity.EquipmentInform;
import com.yeejoin.amos.boot.module.tzs.flc.api.enums.EquipmentInformStatusEnum; import com.yeejoin.amos.boot.module.tzs.flc.api.enums.EquipmentInformStatusEnum;
import com.yeejoin.amos.boot.module.tzs.flc.api.enums.EquipmentStatusEnum; import com.yeejoin.amos.boot.module.tzs.flc.api.enums.EquipmentStatusEnum;
import com.yeejoin.amos.boot.module.tzs.flc.api.mapper.EquipmentInformMapper; import com.yeejoin.amos.boot.module.tzs.flc.api.mapper.EquipmentInformMapper;
import com.yeejoin.amos.boot.module.tzs.flc.api.service.IEquipmentInformService; import com.yeejoin.amos.boot.module.tzs.flc.api.service.IEquipmentInformService;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentInformDto; import com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentInformDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.service.IInformEquipmentService;
import com.yeejoin.amos.feign.privilege.Privilege; import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.CompanyModel; import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
...@@ -23,6 +30,7 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest; ...@@ -23,6 +30,7 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 设备告知单服务实现类 * 设备告知单服务实现类
...@@ -37,10 +45,18 @@ public class EquipmentInformServiceImpl extends BaseService<EquipmentInformDto,E ...@@ -37,10 +45,18 @@ public class EquipmentInformServiceImpl extends BaseService<EquipmentInformDto,E
SourceFileServiceImpl sourceFileService; SourceFileServiceImpl sourceFileService;
@Autowired
EquipmentServiceImpl equipmentServiceImpl;
@Autowired @Autowired
OrgUsrServiceImpl iOrgUsrService; OrgUsrServiceImpl iOrgUsrService;
@Autowired
EquipmentIndexServiceImpl equipmentIndexServiceImpl;
@Autowired
InformEquipmentServiceImpl informEquipmentServiceImpl;
/** /**
* 分页查询 * 分页查询
*/ */
......
package com.yeejoin.amos.boot.module.tzs.flc.biz.service.impl; package com.yeejoin.amos.boot.module.tzs.flc.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.SourceFileServiceImpl;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentIndexDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.Equipment;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.EquipmentIndex;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.InformEquipment; import com.yeejoin.amos.boot.module.tzs.flc.api.entity.InformEquipment;
import com.yeejoin.amos.boot.module.tzs.flc.api.mapper.InformEquipmentMapper; import com.yeejoin.amos.boot.module.tzs.flc.api.mapper.InformEquipmentMapper;
import com.yeejoin.amos.boot.module.tzs.flc.api.service.IInformEquipmentService; import com.yeejoin.amos.boot.module.tzs.flc.api.service.IInformEquipmentService;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.InformEquipmentDto; import com.yeejoin.amos.boot.module.tzs.flc.api.dto.InformEquipmentDto;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 告知申请-设备信息表服务实现类 * 告知申请-设备信息表服务实现类
...@@ -17,6 +33,58 @@ import java.util.List; ...@@ -17,6 +33,58 @@ import java.util.List;
*/ */
@Service @Service
public class InformEquipmentServiceImpl extends BaseService<InformEquipmentDto,InformEquipment,InformEquipmentMapper> implements IInformEquipmentService { public class InformEquipmentServiceImpl extends BaseService<InformEquipmentDto,InformEquipment,InformEquipmentMapper> implements IInformEquipmentService {
@Autowired
SourceFileServiceImpl sourceFileService;
@Autowired
EquipmentIndexServiceImpl equipmentIndexServiceImpl;
@Autowired
EquipmentServiceImpl equipmentServiceImpl;
@Transactional
@Override
public InformEquipmentDto saveInformEquipment(InformEquipmentDto model) {
// 首先获取设备基本信息并复制
Equipment sourceEquip = equipmentServiceImpl.getById(model.getSourceEquipmentId());
BeanUtils.copyProperties(sourceEquip,model);
model.setSequenceNbr(null);
model.setRecDate(new Date());
model.setRecUserId(null);
model.setRecUserName(null);
this.createWithModel(model);
// 保存设备参数信息
List<EquipmentIndex> indexList = equipmentIndexServiceImpl.list(new LambdaQueryWrapper<EquipmentIndex>().eq(EquipmentIndex::getEquipmentId,model.getSourceEquipmentId()).eq(EquipmentIndex::getIsDelete,false));
if(indexList != null && indexList.size()>0) {
for(EquipmentIndex t : indexList) {
EquipmentIndexDto temp = new EquipmentIndexDto();
BeanUtils.copyProperties(t,temp);
temp.setSequenceNbr(null);
temp.setEquipmentId(model.getSequenceNbr());
temp.setEquipmentName(model.getName());
equipmentIndexServiceImpl.createWithModel(temp);
}
}
// 获取设备附件信息 保存附件信息
// 原附件信息
Map<String, List<AttachmentDto>> sourceAttach = sourceFileService.getAttachments(sourceEquip.getSequenceNbr());
for( Map.Entry<String, List<AttachmentDto>> m :sourceAttach.entrySet()) {
List<AttachmentDto> tempList = m.getValue();
tempList.stream().forEach(l -> {
l.setSequenceNbr(null);
});
}
if(sourceAttach != null) {
sourceFileService.saveAttachments(model.getSequenceNbr(), sourceAttach);
}
return model;
}
/** /**
* 分页查询 * 分页查询
*/ */
...@@ -30,4 +98,76 @@ public class InformEquipmentServiceImpl extends BaseService<InformEquipmentDto,I ...@@ -30,4 +98,76 @@ public class InformEquipmentServiceImpl extends BaseService<InformEquipmentDto,I
public List<InformEquipmentDto> queryForInformEquipmentList() { public List<InformEquipmentDto> queryForInformEquipmentList() {
return this.queryForList("" , false); return this.queryForList("" , false);
} }
@Override
public InformEquipmentDto getEquipmentById(Long sequenceNbr) {
// 获取基本信息
InformEquipment equipment = this.getById(sequenceNbr);
InformEquipmentDto result = new InformEquipmentDto();
BeanUtils.copyProperties(equipment,result);
// 封装附件
result.setAttachments(sourceFileService.getAttachments(equipment.getSequenceNbr()));
// 封装详细参数
List<EquipmentIndex> indexList = equipmentIndexServiceImpl.list(new LambdaQueryWrapper<EquipmentIndex>().eq(EquipmentIndex::getEquipmentId,equipment.getSequenceNbr()));
List<EquipmentIndexDto> dtoList = new ArrayList<>();
indexList.stream().forEach(t -> {
EquipmentIndexDto temp = new EquipmentIndexDto();
BeanUtils.copyProperties(t,temp);
dtoList.add(temp);
});
result.setEquipmentIndex(dtoList);
return result;
}
@Override
public InformEquipmentDto updateEquipment(InformEquipmentDto model) {
this.updateWithModel(model);
saveSourceFile(model);
// 先删除参数信息 再添加新的参数信息
equipmentIndexServiceImpl.remove(new LambdaQueryWrapper<EquipmentIndex>().eq(EquipmentIndex::getEquipmentId,model.getSequenceNbr()));
// 保存设备参数信息
List<EquipmentIndexDto> equipmentIndex = model.getEquipmentIndex();
if(equipmentIndex != null && equipmentIndex.size()>0) {
for(EquipmentIndexDto t : equipmentIndex) {
t.setEquipmentId(model.getSequenceNbr());
t.setEquipmentName(model.getName());
equipmentIndexServiceImpl.createWithModel(t);
}
}
Bean.copyExistPropertis(this.queryBySeq(model.getSequenceNbr()), model);
return model;
}
@Override
public List<InformEquipmentDto> getEquipListByInformId(Long sequenceNbr) {
List<InformEquipment> list = this.list(new LambdaQueryWrapper<InformEquipment>().eq(InformEquipment::getIsDelete,false).eq(InformEquipment::getInformId,sequenceNbr));
List<InformEquipmentDto> result = new ArrayList<>();
list.stream().forEach(t -> {
InformEquipmentDto tempDto = new InformEquipmentDto();
BeanUtils.copyProperties(t,tempDto);
// 封装附件
tempDto.setAttachments(sourceFileService.getAttachments(t.getSequenceNbr()));
// 封装详细参数
List<EquipmentIndex> indexList = equipmentIndexServiceImpl.list(new LambdaQueryWrapper<EquipmentIndex>().eq(EquipmentIndex::getEquipmentId,t.getSequenceNbr()));
List<EquipmentIndexDto> dtoList = new ArrayList<>();
indexList.stream().forEach(i -> {
EquipmentIndexDto temp = new EquipmentIndexDto();
BeanUtils.copyProperties(i,temp);
dtoList.add(temp);
});
tempDto.setEquipmentIndex(dtoList);
result.add(tempDto);
});
return result;
}
// 保存附件信息
public void saveSourceFile(InformEquipmentDto model) {
if (model.getAttachments() != null) {
sourceFileService.saveAttachments(model.getSequenceNbr(), model.getAttachments());
}
}
} }
\ No newline at end of file
...@@ -8,6 +8,7 @@ import org.slf4j.Logger; ...@@ -8,6 +8,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.ConfigurableApplicationContext;
...@@ -15,11 +16,14 @@ import org.springframework.context.annotation.ComponentScan; ...@@ -15,11 +16,14 @@ import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType; import org.springframework.context.annotation.FilterType;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.typroject.tyboot.core.restful.exception.GlobalExceptionHandler; import org.typroject.tyboot.core.restful.exception.GlobalExceptionHandler;
import com.yeejoin.amos.boot.biz.common.utils.oConvertUtils; import com.yeejoin.amos.boot.biz.common.utils.oConvertUtils;
@SpringBootApplication @SpringBootApplication
@EnableTransactionManagement
@EnableConfigurationProperties
@EnableDiscoveryClient @EnableDiscoveryClient
@MapperScan({ "org.typroject.tyboot.demo.face.orm.dao*", "org.typroject.tyboot.face.*.orm.dao*", @MapperScan({ "org.typroject.tyboot.demo.face.orm.dao*", "org.typroject.tyboot.face.*.orm.dao*",
"org.typroject.tyboot.core.auth.face.orm.dao*", "org.typroject.tyboot.component.*.face.orm.dao*", "org.typroject.tyboot.core.auth.face.orm.dao*", "org.typroject.tyboot.component.*.face.orm.dao*",
......
...@@ -50,6 +50,8 @@ iot.vehicle.track=AMOS-API-IOT ...@@ -50,6 +50,8 @@ iot.vehicle.track=AMOS-API-IOT
jcs.fegin.name=JCS jcs.fegin.name=JCS
video.fegin.name=VIDEO
#项目初始化画布id #项目初始化画布id
morphic.projectSeq=1390314016458514433 morphic.projectSeq=1390314016458514433
......
...@@ -219,34 +219,39 @@ ...@@ -219,34 +219,39 @@
</if> </if>
<if test="id == null"> <if test="id == null">
union all union all
select SELECT
'component' as template, 'component' AS template,
true as openStatus, TRUE AS openStatus,
if(sou.id is null,0,1) as isBinding, IF
if(vid.code is null,vid.name,concat(vid.name,'(',vid.code,')')) as displayName, (
'{\"width\": 42, \"height\": 42}'as initStyle, ( SELECT ss.id FROM wl_source_scene ss WHERE ss.video_in_scene LIKE CONCAT( '%', vid.id, '%' ) ) IS NULL,
'CommonEquip' as componentName, 0,
vid.id as sequenceNbr, 1
'equipment' as componentKey, ) AS isBinding,
'video' as `key`, IF
img as imgPath, ( vid.CODE IS NULL, vid.NAME, concat( vid.NAME, '(', vid.CODE, ')' ) ) AS displayName,
vid.code as equipCode, '{\"width\": 42, \"height\": 42}' AS initStyle,
vis.source_id as parentId, 'CommonEquip' AS componentName,
vid.id as equipId, vid.id AS sequenceNbr,
vid.code as categoryCode, 'equipment' AS componentKey,
vid.name as equipName, 'video' AS `key`,
'' as equipSyetemId, img AS imgPath,
'' as iotCode, vid.CODE AS equipCode,
'1000000000000000'as groupId, vis.source_id AS parentId,
'监控摄像' as groupName, vid.id AS equipId,
url as ip , vid.CODE AS categoryCode,
vid.NAME AS equipName,
'' AS equipSyetemId,
'' AS iotCode,
'1000000000000000' AS groupId,
'监控摄像' AS groupName,
url AS ip,
token, token,
stru.full_name as address stru.full_name AS address
from FROM
wl_video as vid wl_video AS vid
join wl_video_source as vis on vid.id = vis.video_id JOIN wl_video_source AS vis ON vid.id = vis.video_id
join wl_source_scene as sou on sou.video_in_scene like CONCAT('%',vid.id ,'%' ) JOIN wl_warehouse_structure AS stru ON stru.id = vis.source_id
join wl_warehouse_structure as stru on stru.id = sou.source_id
</if> </if>
</select> </select>
<select id="get3dPointData" resultType="com.yeejoin.equipmanage.common.entity.vo.PointTreeVo"> <select id="get3dPointData" resultType="com.yeejoin.equipmanage.common.entity.vo.PointTreeVo">
......
...@@ -140,17 +140,20 @@ ...@@ -140,17 +140,20 @@
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
vid.id, v.`name`,
vid.token, v.`code`,
vid.name, v.url,
vid.url, v.token,
vid.code, CONCAT_WS(' ', ws.full_name, v.address) AS address,
vid.preset_position as presetPosition v.img,
from v.preset_position as presetPosition
wl_video_equipment_specific as ves FROM
left join wl_video as vid on ves.video_id = vid.id wl_video v
where video_id = #{id} LEFT JOIN wl_video_source vs ON vs.video_id = v.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">
......
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