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;
import org.springframework.cloud.openfeign.support.SpringEncoder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.context.request.RequestContextListener;
import feign.codec.Encoder;
import feign.form.spring.SpringFormEncoder;
......@@ -25,4 +26,12 @@ public class MultipartSupportConfig {
public Encoder feignFormEncoder() {
return new SpringFormEncoder(new SpringEncoder(messageConverters));
}
/**
* 创建Feign请求拦截器,在发送请求前设置认证的token,各个微服务将token设置到环境变量中来达到通用
* @return
*/
@Bean
public RequestContextListener requestInterceptor() {
return new RequestContextListener();
}
}
......@@ -50,7 +50,7 @@ public class Swagger2Config {
.apiInfo(apiInfo())
.select()
//此包路径下的类,才生成接口文档
.apis(RequestHandlerSelectors.basePackage("com.yeejoin.amos"))
.apis(RequestHandlerSelectors.basePackage("com.yeejoin"))
//加了ApiOperation注解的类,才生成接口文档
.apis(RequestHandlerSelectors.withClassAnnotation(RestController.class))
.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
......
......@@ -115,4 +115,10 @@ public class FireEquipmentSignalLogDto extends BaseDto {
@ApiModelProperty(value = "负责人联系电话")
private String chargePersonPhone;
/**
* 3维页面访问地址
*/
@ApiModelProperty(value = "3维页面访问地址")
private String view3dUrl;
}
......@@ -80,4 +80,10 @@ public class FireStationInfoDto extends BaseDto {
@ApiModelProperty(value = "现存隐患")
private Long existDangerNumber;
/**
* 3维页面访问地址
*/
@ApiModelProperty(value = "3维页面访问地址")
private String view3dUrl;
}
......@@ -129,4 +129,10 @@ public class FireStationInfo extends BaseEntity {
*/
@TableField("fire_captain_phone")
private String fireCaptainPhone;
/**
* 3维页面访问地址
*/
@TableField("view3d_url")
private String view3dUrl;
}
......@@ -32,7 +32,8 @@
a.system_names,
s.station_charge_person,
s.charge_person_phone,
a.fire_building_mrid
a.fire_building_mrid,
s.view3d_url
from
asf_fire_equipment_signal_log a,
asf_fire_station_info s
......
......@@ -32,4 +32,11 @@ public class FireTeamListDto {
@ApiModelProperty(value = "树节点子节点id集合")
private List<String> nodeIds;
@ApiModelProperty(value = "地址")
private String address;
@ApiModelProperty(value = "所属单位")
private String company;
}
......@@ -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.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.address!=null'> and a.address like CONCAT('',#{par.address},'%') </if>"
+" order by a.rec_date desc limit #{pageNum},#{pageSize}"
+ "</script>")
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> {
+ "<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.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>")
Map<String, Long> getFireStationCount(@Param("par")FireStationDto par);
......
......@@ -3,6 +3,9 @@ package com.yeejoin.amos.boot.module.common.api.service;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.common.api.dto.DutyCarDto;
import java.util.List;
import java.util.Map;
/**
* @author DELL
*/
......@@ -30,4 +33,5 @@ public interface IDutyCarService extends IDutyCommonService {
*/
JSONObject isFireCarDriver();
int getDutyCarCount(Long carId);
List<Map<String, Object>> getDutyCaruser(Long carId);
}
......@@ -144,6 +144,15 @@ select * from (
cd.FIELD_VALUE
END
) AS #{equipmentId},
MAX(
CASE
WHEN cd.FIELD_CODE = 'userName' THEN
cd.FIELD_VALUE
END
) AS 'userName',
MAX(
CASE
WHEN cd.FIELD_CODE = #{equipmentName} THEN
......
......@@ -44,7 +44,9 @@
<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.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.address != null'>and a.address like concat('%', #{par.address}, '%')</if>
<if test='par.nodeType != null and par.nodeType == "1" and par.nodeIds != null'>
and a.company in
<foreach collection="par.nodeIds" separator="," open="(" item="nodeId" close=")">
......
......@@ -24,6 +24,7 @@
<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.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.jobTitle!=null'>and a.job_title_code =#{par.jobTitle}</if>
<if
......@@ -43,6 +44,7 @@
<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.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.areasExpertiseCode!=null and par.areasExpertiseCode!="0"'>and b.areas_expertise_code
......
......@@ -23,6 +23,7 @@
u.sequence_nbr sequenceNbr,
u.biz_org_name bizOrgName,
u.biz_org_code bizOrgCode,
u.parent_id parent_id,
g.*
FROM
cb_org_usr u
......@@ -72,6 +73,9 @@
<if test="map.amosOrgId != null and map.amosOrgId != '-1'">
AND u.amos_org_id like concat(#{map.amosOrgId}, '%')
</if>
<if test="map.company != null and map.company != '-1'">
AND u.parent_id = #{map.company}
</if>
GROUP BY
u.sequence_nbr ,
u.biz_org_name ,
......@@ -140,6 +144,9 @@
<if test="map.amosOrgCode != null and map.amosOrgCode != '-1'">
AND u.amos_org_code like concat('%',#{map.amosOrgCode}, '%')
</if>
<if test="map.company != null and map.company != '-1'">
AND u.parent_id = #{map.company}
</if>
GROUP BY
u.sequence_nbr ,
u.biz_org_name ,
......
......@@ -8,11 +8,19 @@ import lombok.Data;
@Data
public class AlamVideoVO {
private Long id;
private String url;
private String token;
private String name;
private String code;
private String address;
private String img;
private String presetPosition;
}
......@@ -2,6 +2,7 @@ package com.yeejoin.equipmanage.common.entity.vo;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
......@@ -18,6 +19,6 @@ public class DetailPaneVO {
//图片
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 @@
<if test="alertStatus!= null ">
and a.alert_status = #{alertStatus}
</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}
</if>
<if test="alertTypeCode!= null ">
<if test="alertTypeCode!= null and alertTypeCode!= '' ">
and a.alarm_type_code = #{alertTypeCode}
</if>
<if test="alertSourceCode!= null ">
......@@ -177,10 +177,10 @@
<select id="selectAllCount" resultType="int">
SELECT
sum(b.num)
count(b.num)
FROM
(SELECT
count(distinct a.sequence_nbr) as num
a.sequence_nbr as num
FROM
jc_alert_called a
<if test="isFatherAlert!= null and isFatherAlert == 'true' ">
......@@ -190,17 +190,17 @@
<if test="alertStatus!= null ">
and a.alert_status = #{alertStatus}
</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}
</if>
<if test="alertTypeCode!= null ">
and a.alarm_type_code = #{alertTypeCode}
<if test="alertTypeCode!= null and alertTypeCode!= '' ">
and a.alert_type_code = #{alertTypeCode}
</if>
<if test="alertSourceCode!= null ">
and a.alert_source_code = #{alertSourceCode}
</if>
<if test="systemSourceCode!= null ">
and a.system_source_code = #{systemSourceCode}
and a.system_source_code in (${systemSourceCode})
</if>
<if test="isFatherAlert!= null and isFatherAlert == 'true' ">
and j.alert_called_id = a.sequence_nbr
......
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.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* 告知申请-设备信息表
......@@ -90,4 +95,17 @@ public class InformEquipmentDto extends BaseDto {
@ApiModelProperty(value = "告知单id")
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 {
@TableField("inform_id")
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;
public interface IEquipmentInformService {
EquipmentInformDto createEquipmentInform(EquipmentInformDto model);
}
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;
*/
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 {
if (e.get("carState").equals("在位")) {
e.put("carState", FireCarStatusEnum.执勤.getName());
}
String sequenceNbr = e.get("sequenceNbr").toString();
//同步力量调派车辆任务状态
alertFormValue.stream().forEach(v -> {
......@@ -1470,12 +1471,21 @@ public class CommandController extends BaseController {
powerTransferCompanyResources = powerTransferCompanyResourcesService.getByAlertCalledIdCarId(alertCalledId, carid);
// 随车人员
List<PowerData> powerDataOne = powerTransferMapper.getPowerDataOne(carid);
if(!ValidationUtil.isEmpty(powerDataOne)) {
// List<PowerData> powerDataOne = powerTransferMapper.getPowerDataOne(carid);
List<Map<String, Object>> equipmentList = iDutyCarService.getDutyCaruser(carid);
if(!ValidationUtil.isEmpty(equipmentList)) {
String str = "";
String newStr = "";
for(int i = 0; i < powerDataOne.size(); i++ ) {
newStr = str.concat(powerDataOne.get(i).getPostTypeName()).concat(":").concat(powerDataOne.get(i).getUser());
for(int i = 0; i < equipmentList.size(); i++ ) {
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);
} else {
......
......@@ -125,8 +125,11 @@ public class FireStationController extends BaseController {
@GetMapping(value = "/list/page")
@ApiOperation(httpMethod = "GET", value = "新微型消防站分页查询", notes = "新微型消防站分页查询")
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) {
if (company != null && company != -1){
fireStationDto.setBizCompanyId(company);
}
return ResponseHelper.buildResponse(fireStationServiceImpl.getFirefighters(pageNum, pageSize, fireStationDto));
}
......
......@@ -238,4 +238,16 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
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
if (!ObjectUtils.isEmpty(req.get("bizOrgName"))) {
map.put("bizOrgName", req.get("bizOrgName"));
}
if (!ObjectUtils.isEmpty(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 陈召 开始 */
if (req.get("parentId") != null && req.get("parentId") != "") {
OrgUsr parent = this.getById(req.get("parentId").toString());
......@@ -411,7 +413,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
req.remove("pageNum");
req.remove("parentId");
req.remove("amosOrgId");
req.remove("company");
map.put("fieldsValue", req);
map.put("fields", alertFormServiceImpl.queryListByFormId(OrgPersonEnum.人员.getCode()));
pageBean.setTotal(this.baseMapper.selectPersonListCount(map));
......
......@@ -153,8 +153,8 @@ public class EquipmentSpecificController extends AbstractBaseController {
@RequestMapping(value = "/getOneCard", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "根据id查询", notes = "组装组态使用装备卡片数据")
public DetailPaneVO getOneCard(Long id) {
return equipmentSpecificSerivce.getOneCard(id);
public Object getOneCard(Long id , String type) {
return equipmentSpecificSerivce.getOneCard(id , type);
}
/**
......
......@@ -272,7 +272,7 @@ public class VideoController extends AbstractBaseController {
@ApiOperation(httpMethod = "GET", value = "通过视频id和预置位获取可播放的flv格式地址", notes = "通过视频id和预置位获取可播放的flv格式地址")
public String getVideoFlvUrl(@RequestParam String videoId,
@RequestParam String presetIndex) {
String flvUrl = videoService.getVideoUrl(videoId, presetIndex, "");
String flvUrl = videoService.getVideoUrl(videoId, presetIndex, "", "");
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> {
* @return
*/
List<AlamVideoVO> getVideoBySpeId(Long id);
List<AlamVideoVO> getVideoById(Long id);
AlamVideoVO getVideoById(Long id);
/**
......
......@@ -80,7 +80,7 @@ public interface IEquipmentSpecificSerivce extends IService<EquipmentSpecific> {
* @param id
* @return
*/
DetailPaneVO getOneCard(Long id);
Object getOneCard(Long id, String type);
/**
* 通过id获取设备区域建筑等信息
......
......@@ -75,5 +75,5 @@ public interface IVideoService extends IService<Video> {
* @param defaultUrl
* @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
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;
......
......@@ -83,9 +83,9 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
final String alarmType = "IOT_CORE_PARAM";
Map<String, Object> res = new HashMap<>();
if (videoType.equals(type)) {
List<AlamVideoVO> video = videoMapper.getVideoById(equipId);
List<AlamVideoVO> video = videoMapper.getVideoBySpeId(equipId);
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);
return res;
......@@ -103,7 +103,7 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
}
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("video", videoBySpeId);
......
......@@ -237,7 +237,7 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
video.setName(x.getName());
video.setTokens(x.getToken());
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.setPort(x.getPort());
video.setCode(x.getCode());
......
......@@ -57,6 +57,7 @@ import com.yeejoin.equipmanage.common.entity.Video;
import com.yeejoin.equipmanage.common.entity.Warehouse;
import com.yeejoin.equipmanage.common.entity.WarehouseStructure;
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.AlarmVO;
import com.yeejoin.equipmanage.common.entity.vo.ComplementCodeVO;
......@@ -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.VideoVO;
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.FileTypeEnum;
import com.yeejoin.equipmanage.common.enums.StockBillTypeEnum;
......@@ -89,10 +91,12 @@ import com.yeejoin.equipmanage.common.vo.EquipmentDetailVo;
import com.yeejoin.equipmanage.common.vo.EquipmentOnCarVo;
import com.yeejoin.equipmanage.common.vo.EquipmentSpecific3dVo;
import com.yeejoin.equipmanage.config.EquipmentIotMqttReceiveConfig;
import com.yeejoin.equipmanage.fegin.VideoFeignClient;
import com.yeejoin.equipmanage.mapper.EquipmentIndexMapper;
import com.yeejoin.equipmanage.mapper.EquipmentSpecificAlarmMapper;
import com.yeejoin.equipmanage.mapper.EquipmentSpecificMapper;
import com.yeejoin.equipmanage.mapper.UploadFileMapper;
import com.yeejoin.equipmanage.mapper.VideoMapper;
import com.yeejoin.equipmanage.service.IEquPropertyService;
import com.yeejoin.equipmanage.service.IEquipmentCategoryService;
import com.yeejoin.equipmanage.service.IEquipmentDetailService;
......@@ -109,6 +113,7 @@ import com.yeejoin.equipmanage.service.IStockService;
import com.yeejoin.equipmanage.service.ISyncDataService;
import com.yeejoin.equipmanage.service.ISystemDicService;
import com.yeejoin.equipmanage.service.IUploadFileService;
import com.yeejoin.equipmanage.service.IVideoService;
import com.yeejoin.equipmanage.service.IWarehouseService;
import com.yeejoin.equipmanage.service.IWarehouseStructureService;
import com.yeejoin.equipmanage.utils.RelationRedisUtil;
......@@ -176,6 +181,9 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
@Autowired
IEquipmentIndexService iEquipmentIndexService;
@Autowired
private IVideoService videoService;
@Value("${systemctl.dict.iot-core-param}")
private String iotCoreParam;
......@@ -197,9 +205,13 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
@Autowired
private RelationRedisUtil relationRedisUtil;
@Autowired
private VideoMapper videoMapper;
@Value("${systemctl.sync.switch}")
private Boolean syncSwitch;
private final String injection = "{\n" +
"\n" +
" \"items\": [\n" +
......@@ -1050,14 +1062,25 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
}
@Override
public DetailPaneVO getOneCard(Long id) {
public Object getOneCard(Long id, String type) {
if(BitmapEnum.video.getKey().equals(type)){
AlamVideoVO video = videoMapper.getVideoById(id);
if(!ObjectUtils.isEmpty(video)){
video.setUrl(videoService.getVideoUrl(video.getName().toString(), video.getPresetPosition(), video.getUrl(), video.getCode()));
}
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
public SourceNameByEquipSpeIdVO getSourceNameByEquipSpeId(Long id) {
......
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.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.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.IndustryEnum;
import com.yeejoin.equipmanage.common.utils.HttpContentTypeUtil;
import com.yeejoin.equipmanage.common.utils.StringUtil;
import com.yeejoin.equipmanage.fegin.VideoFeignClient;
import com.yeejoin.equipmanage.mapper.VideoMapper;
import com.yeejoin.equipmanage.service.*;
import lombok.extern.slf4j.Slf4j;
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 com.yeejoin.equipmanage.service.IBuilldService;
import com.yeejoin.equipmanage.service.IEquipmentCategoryService;
import com.yeejoin.equipmanage.service.IEquipmentIndexService;
import com.yeejoin.equipmanage.service.IEquipmentSpecificIndexService;
import com.yeejoin.equipmanage.service.IEquipmentSpecificSerivce;
import com.yeejoin.equipmanage.service.IVideoEquipmentSpecificService;
import com.yeejoin.equipmanage.service.IVideoImportantEquipmentService;
import com.yeejoin.equipmanage.service.IVideoService;
import com.yeejoin.equipmanage.service.IVideoSourceService;
import com.yeejoin.equipmanage.service.IWarehouseStructureService;
import java.util.*;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j;
/**
* @author ZeHua Li
......@@ -69,6 +104,10 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
VideoMapper videoMapper;
@Autowired
VideoFeignClient videoFeignClient;
@Value("${param.htvideo.url}")
private String htvideoUrl;
......@@ -484,13 +523,27 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
@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)) {
return defaultUrl;
String url = getVideoUrl(code);
return ObjectUtils.isEmpty(url) ? defaultUrl : url;
}
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) {
try {
String rtsp = getRtspUrlByVideoIdOrPresetIndex(videoId, presetIndex);
......@@ -544,91 +597,4 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
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;
import feign.codec.Encoder;
import feign.form.spring.SpringFormEncoder;
import org.springframework.beans.factory.ObjectFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
import org.springframework.cloud.openfeign.support.SpringEncoder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.context.request.RequestContextListener;
/**
* @Author: xinglei
* @Description:
* @Date: 2020/3/30 16:26
*/
@Configuration
public class MultipartSupportConfig {
@Autowired
private ObjectFactory<HttpMessageConverters> messageConverters;
@Bean
public Encoder feignFormEncoder() {
return new SpringFormEncoder(new SpringEncoder(messageConverters));
}
/**
* 创建Feign请求拦截器,在发送请求前设置认证的token,各个微服务将token设置到环境变量中来达到通用
* @return
*/
@Bean
public RequestContextListener requestInterceptor() {
return new RequestContextListener();
}
}
//package com.yeejoin.amos.fas.business.feign;
//
//import feign.codec.Encoder;
//import feign.form.spring.SpringFormEncoder;
//import org.springframework.beans.factory.ObjectFactory;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
//import org.springframework.cloud.openfeign.support.SpringEncoder;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.web.context.request.RequestContextListener;
//
///**
// * @Author: xinglei
// * @Description:
// * @Date: 2020/3/30 16:26
// */
//@Configuration
//public class MultipartSupportConfig {
//
// @Autowired
// private ObjectFactory<HttpMessageConverters> messageConverters;
//
// @Bean
// public Encoder feignFormEncoder() {
// return new SpringFormEncoder(new SpringEncoder(messageConverters));
// }
//
// /**
// * 创建Feign请求拦截器,在发送请求前设置认证的token,各个微服务将token设置到环境变量中来达到通用
// * @return
// */
// @Bean
// public RequestContextListener requestInterceptor() {
// return new RequestContextListener();
// }
//}
......@@ -6,6 +6,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import com.yeejoin.amos.boot.biz.common.feign.MultipartSupportConfig;
@FeignClient(name = "${outSystem.fegin.name}", configuration = {MultipartSupportConfig.class})
public interface OutTokenLoginFeign {
......
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.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
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})
public interface PrivilegeFeign {
......
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.RequestMethod;
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.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;
import feign.codec.Encoder;
import feign.form.spring.SpringFormEncoder;
import org.springframework.beans.factory.ObjectFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
import org.springframework.cloud.openfeign.support.SpringEncoder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.context.request.RequestContextListener;
/**
* @Author: xinglei
* @Description:
* @Date: 2020/3/30 16:26
*/
@Configuration
public class MultipartSupportConfig {
@Autowired
private ObjectFactory<HttpMessageConverters> messageConverters;
@Bean
public Encoder feignFormEncoder() {
return new SpringFormEncoder(new SpringEncoder(messageConverters));
}
/**
* 创建Feign请求拦截器,在发送请求前设置认证的token,各个微服务将token设置到环境变量中来达到通用
* @return
*/
@Bean
public RequestContextListener requestInterceptor() {
return new RequestContextListener();
}
}
//package com.yeejoin.amos.maintenance.feign;
//
//import feign.codec.Encoder;
//import feign.form.spring.SpringFormEncoder;
//import org.springframework.beans.factory.ObjectFactory;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
//import org.springframework.cloud.openfeign.support.SpringEncoder;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.web.context.request.RequestContextListener;
//
///**
// * @Author: xinglei
// * @Description:
// * @Date: 2020/3/30 16:26
// */
//@Configuration
//public class MultipartSupportConfig {
//
// @Autowired
// private ObjectFactory<HttpMessageConverters> messageConverters;
//
// @Bean
// public Encoder feignFormEncoder() {
// return new SpringFormEncoder(new SpringEncoder(messageConverters));
// }
//
// /**
// * 创建Feign请求拦截器,在发送请求前设置认证的token,各个微服务将token设置到环境变量中来达到通用
// * @return
// */
// @Bean
// public RequestContextListener requestInterceptor() {
// return new RequestContextListener();
// }
//}
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.RequestMethod;
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 org.springframework.web.bind.annotation.RequestBody;
import org.springframework.cloud.openfeign.FeignClient;
import com.yeejoin.amos.maintenance.business.util.CommonResponse;
......
......@@ -94,9 +94,9 @@ public class EquipmentController extends BaseController {
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}")
@PutMapping(value = "/updateEquipment")
@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)
|| ValidationUtil.isEmpty(model.getSequenceNbr())) {
throw new BadRequest("参数校验失败.");
......
......@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.tzs.flc.biz.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
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 org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
......@@ -10,6 +11,8 @@ import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.List;
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.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -45,7 +48,7 @@ public class EquipmentInformController extends BaseController {
public ResponseModel<String> getInformCode(@PathVariable String regionCode) {
// 行政编码 + 年月 + 顺序号
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);
code += numberStr;
return ResponseHelper.buildResponse(code);
......@@ -133,4 +136,8 @@ public class EquipmentInformController extends BaseController {
public ResponseModel<List<EquipmentInformDto>> selectForList() {
return ResponseHelper.buildResponse(equipmentInformServiceImpl.queryForEquipmentInformList());
}
}
package com.yeejoin.amos.boot.module.tzs.flc.biz.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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 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.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*;
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;
import java.util.List;
/**
* 告知申请-设备信息表
......@@ -32,85 +44,78 @@ public class InformEquipmentController extends BaseController {
InformEquipmentServiceImpl informEquipmentServiceImpl;
/**
* 新增告知申请-设备信息表
*
* 新增告知书设备
* @param model
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增告知申请-设备信息表", notes = "新增告知申请-设备信息表")
@PostMapping(value = "/saveInformEquipment")
@ApiOperation(httpMethod = "POST", value = "新增告知书设备", notes = "新增告知书设备")
public ResponseModel<InformEquipmentDto> save(@RequestBody InformEquipmentDto model) {
model = informEquipmentServiceImpl.createWithModel(model);
if (ValidationUtil.isEmpty(model.getSourceEquipmentId())
|| ValidationUtil.isEmpty(model.getInformId())) {
throw new BadRequest("参数校验失败.");
}
model = informEquipmentServiceImpl.saveInformEquipment(model);
return ResponseHelper.buildResponse(model);
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新告知申请-设备信息表", notes = "根据sequenceNbr更新告知申请-设备信息表")
public ResponseModel<InformEquipmentDto> updateBySequenceNbrInformEquipment(@RequestBody InformEquipmentDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(informEquipmentServiceImpl.updateWithModel(model));
}
/**
* 根据sequenceNbr删除
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除告知申请-设备信息表", notes = "根据sequenceNbr删除告知申请-设备信息表")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){
return ResponseHelper.buildResponse(informEquipmentServiceImpl.removeById(sequenceNbr));
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询单个装备信息", notes = "根据sequenceNbr查询单个装备信息")
public ResponseModel<InformEquipmentDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(informEquipmentServiceImpl.getEquipmentById(sequenceNbr));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* 根据告知书id 查询相关设备信息
* @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));
@GetMapping(value = "/getEquipListByInformId/{sequenceNbr}")
@ApiOperation(httpMethod = "GET", value = "根据告知书id 查询相关设备信息", notes = "根据告知书id 查询相关设备信息")
public ResponseModel<List<InformEquipmentDto>> getEquipListByInformId(@PathVariable Long sequenceNbr) {
List<InformEquipmentDto> result = informEquipmentServiceImpl.getEquipListByInformId(sequenceNbr);
return ResponseHelper.buildResponse(result);
}
/**
* 列表分页查询
* 根据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));
@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);
}
/**
* 列表全部数据查询
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "告知申请-设备信息表列表全部数据查询", notes = "告知申请-设备信息表列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<InformEquipmentDto>> selectForList() {
return ResponseHelper.buildResponse(informEquipmentServiceImpl.queryForInformEquipmentList());
@DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除告知申请-设备信息表", notes = "根据sequenceNbr删除告知申请-设备信息表")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){
return ResponseHelper.buildResponse(informEquipmentServiceImpl.update(new LambdaUpdateWrapper<InformEquipment>().eq(InformEquipment::getSequenceNbr,sequenceNbr).set(InformEquipment::getIsDelete,true)));
}
}
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.api.entity.OrgUsr;
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.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.enums.EquipmentInformStatusEnum;
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.service.IEquipmentInformService;
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.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -23,6 +30,7 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* 设备告知单服务实现类
......@@ -37,10 +45,18 @@ public class EquipmentInformServiceImpl extends BaseService<EquipmentInformDto,E
SourceFileServiceImpl sourceFileService;
@Autowired
EquipmentServiceImpl equipmentServiceImpl;
@Autowired
OrgUsrServiceImpl iOrgUsrService;
@Autowired
EquipmentIndexServiceImpl equipmentIndexServiceImpl;
@Autowired
InformEquipmentServiceImpl informEquipmentServiceImpl;
/**
* 分页查询
*/
......
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.mapper.InformEquipmentMapper;
import com.yeejoin.amos.boot.module.tzs.flc.api.service.IInformEquipmentService;
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.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* 告知申请-设备信息表服务实现类
......@@ -17,6 +33,58 @@ import java.util.List;
*/
@Service
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
public List<InformEquipmentDto> queryForInformEquipmentList() {
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;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ConfigurableApplicationContext;
......@@ -15,11 +16,14 @@ import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.typroject.tyboot.core.restful.exception.GlobalExceptionHandler;
import com.yeejoin.amos.boot.biz.common.utils.oConvertUtils;
@SpringBootApplication
@EnableTransactionManagement
@EnableConfigurationProperties
@EnableDiscoveryClient
@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*",
......
......@@ -50,6 +50,8 @@ iot.vehicle.track=AMOS-API-IOT
jcs.fegin.name=JCS
video.fegin.name=VIDEO
#项目初始化画布id
morphic.projectSeq=1390314016458514433
......
......@@ -219,34 +219,39 @@
</if>
<if test="id == null">
union all
select
'component' as template,
true as openStatus,
if(sou.id is null,0,1) as isBinding,
if(vid.code is null,vid.name,concat(vid.name,'(',vid.code,')')) as displayName,
'{\"width\": 42, \"height\": 42}'as initStyle,
'CommonEquip' as componentName,
vid.id as sequenceNbr,
'equipment' as componentKey,
'video' as `key`,
img as imgPath,
vid.code as equipCode,
vis.source_id as parentId,
vid.id as equipId,
vid.code as categoryCode,
vid.name as equipName,
'' as equipSyetemId,
'' as iotCode,
'1000000000000000'as groupId,
'监控摄像' as groupName,
url as ip ,
SELECT
'component' AS template,
TRUE AS openStatus,
IF
(
( SELECT ss.id FROM wl_source_scene ss WHERE ss.video_in_scene LIKE CONCAT( '%', vid.id, '%' ) ) IS NULL,
0,
1
) AS isBinding,
IF
( vid.CODE IS NULL, vid.NAME, concat( vid.NAME, '(', vid.CODE, ')' ) ) AS displayName,
'{\"width\": 42, \"height\": 42}' AS initStyle,
'CommonEquip' AS componentName,
vid.id AS sequenceNbr,
'equipment' AS componentKey,
'video' AS `key`,
img AS imgPath,
vid.CODE AS equipCode,
vis.source_id AS parentId,
vid.id AS equipId,
vid.CODE AS categoryCode,
vid.NAME AS equipName,
'' AS equipSyetemId,
'' AS iotCode,
'1000000000000000' AS groupId,
'监控摄像' AS groupName,
url AS ip,
token,
stru.full_name as address
from
wl_video as vid
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 = sou.source_id
stru.full_name AS address
FROM
wl_video AS vid
JOIN wl_video_source AS vis ON vid.id = vis.video_id
JOIN wl_warehouse_structure AS stru ON stru.id = vis.source_id
</if>
</select>
<select id="get3dPointData" resultType="com.yeejoin.equipmanage.common.entity.vo.PointTreeVo">
......
......@@ -140,17 +140,20 @@
where equipment_specific_id = #{id}
</select>
<select id="getVideoById" resultType="com.yeejoin.equipmanage.common.entity.vo.AlamVideoVO">
select
vid.id,
vid.token,
vid.name,
vid.url,
vid.code,
vid.preset_position as presetPosition
from
wl_video_equipment_specific as ves
left join wl_video as vid on ves.video_id = vid.id
where video_id = #{id}
SELECT
v.`name`,
v.`code`,
v.url,
v.token,
CONCAT_WS(' ', ws.full_name, v.address) AS address,
v.img,
v.preset_position as presetPosition
FROM
wl_video v
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 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