已重命名1个文件
已删除2个文件
已修改19个文件
已添加17个文件
| | |
| | | public static final String KEY_DEVICE_SER_LIST = "SER_LIST"; |
| | | |
| | | /** |
| | | * ç½å
³KEY |
| | | */ |
| | | public static final String KEY_GATEWAY_SER_LIST = "GATEWAY_LIST"; |
| | | |
| | | /** |
| | | * 设å¤å表 |
| | | */ |
| | | public static final String KEY_DEVICE_LIST = "DEVICE_LIST"; |
| ÎļþÃû´Ó fzzy-igdss-core/src/main/java/com/fzzy/igds/domain/SnapSer.java ÐÞ¸Ä |
| | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @Description æææå¡ |
| | | * @Description ç½å
³é
ç½® |
| | | * @Author CZT |
| | | * @Date 2025/11/25 19:43 |
| | | * @Date 2025/12/10 15:25 |
| | | */ |
| | | @Data |
| | | @Entity |
| | | @Table(name = "d_snap_ser") |
| | | @TableName("d_snap_ser") |
| | | @Table(name = "d_gateway_ser") |
| | | @TableName("d_gateway_ser") |
| | | @EqualsAndHashCode(callSuper = false) |
| | | public class SnapSer extends BizBaseEntity implements Serializable { |
| | | public class GatewaySer extends BizBaseEntity implements Serializable { |
| | | |
| | | /** |
| | | * |
| | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @Id |
| | | @Column(name = "id", columnDefinition = "varchar(40) COMMENT '主é®'") |
| | | @Column(name = "id", columnDefinition = "varchar(40) COMMENT 'ç½å
³ID'") |
| | | @TableField("id") |
| | | private String id; |
| | | |
| | |
| | | @TableField("dept_id") |
| | | private String deptId; |
| | | |
| | | @Column(name = "sort", columnDefinition = "varchar(2) COMMENT 'é
å¥åºå·'") |
| | | @TableField("sort") |
| | | private String sort = "1"; |
| | | |
| | | @Column(name = "sn", columnDefinition = "varchar(40) COMMENT 'åºåå·'") |
| | | @TableField("sn") |
| | | private String sn; |
| | | |
| | | @Column(name = "name", columnDefinition = "varchar(40) COMMENT '设å¤åç§°'") |
| | | @Column(name = "name", columnDefinition = "varchar(40) COMMENT 'ç½å
³åç§°'") |
| | | @TableField("name") |
| | | private String name; |
| | | |
| | | @Column(name = "ip", columnDefinition = "varchar(20) COMMENT '设å¤IP'") |
| | | @TableField("ip") |
| | | private String ip; |
| | | |
| | | @Column(name = "port", columnDefinition = "int(5) COMMENT '端å£'") |
| | | @TableField("port") |
| | | private Integer port; |
| | | |
| | | @Column(name = "status", columnDefinition = "varchar(2) COMMENT 'æ¯å¦å¨çº¿'") |
| | | @TableField("status") |
| | | private String status = Constant.YN_N; |
| | | |
| | | @Column(name = "ip", columnDefinition = "varchar(20) COMMENT 'ç½å
³IP'") |
| | | @TableField("ip") |
| | | private String ip; |
| | | |
| | | @Column(name = "port", columnDefinition = "int(5) COMMENT 'ç½å
³ç«¯å£'") |
| | | @TableField("port") |
| | | private Integer port; |
| | | |
| | | @Column(name = "snap_url", columnDefinition = "varchar(20) COMMENT 'ææè·¯å¾'") |
| | | @TableField("snap_url") |
| | | private String snapUrl; |
| | | |
| | | @Column(name = "ptz_url", columnDefinition = "varchar(20) COMMENT 'äºå°è·¯å¾'") |
| | | @TableField("ptz_url") |
| | | private String ptzUrl; |
| | | |
| | | @Column(name = "order_num", columnDefinition = "int(5) COMMENT '顺åºå·'") |
| | | @TableField("order_num") |
| | | private Integer orderNum = 1; |
| | | |
| | | @Column(name = "remark", columnDefinition = "varchar(100) COMMENT '夿³¨è¯´æ'") |
| | | @TableField("remark") |
| | | private String remark; |
| | |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import javax.persistence.Column; |
| | | import javax.persistence.Entity; |
| | | import javax.persistence.Id; |
| | | import javax.persistence.Table; |
| | | import javax.persistence.*; |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | |
| | | @Table(name = "d_patrol") |
| | | @TableName("d_patrol") |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @IdClass(PatrolKey.class) |
| | | public class Patrol extends BizBaseEntity implements Serializable { |
| | | |
| | | /** |
| | |
| | | @TableField("id") |
| | | private String id; |
| | | |
| | | @Column(name = "dept_id", columnDefinition = "varchar(40) COMMENT 'æå±åºåº'") |
| | | @TableField("dept_id") |
| | | private String deptId; |
| | | @Id |
| | | @Column(name = "user_id", columnDefinition = "varchar(40) COMMENT 'å·¡é»äººè´¦å·'") |
| | | @TableField("user_id") |
| | | private String userId; |
| | | |
| | | @Id |
| | | @Column(name = "batch_id", columnDefinition = "varchar(40) COMMENT 'çæ¬¡ç¼å·'") |
| | | @TableField("batch_id") |
| | | private String batchId; |
| | | |
| | | @Column(name = "dept_id", columnDefinition = "varchar(40) COMMENT 'æå±åºåº'") |
| | | @TableField("dept_id") |
| | | private String deptId; |
| | | |
| | | @Column(name = "user_name", columnDefinition = "varchar(40) COMMENT 'å·¡é»äºº'") |
| | | @TableField("user_name") |
| | | private String userName; |
| | | |
| | | } |
| | |
| | | import javax.persistence.Id; |
| | | import javax.persistence.Table; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @Entity |
| | |
| | | @TableField("batch_id") |
| | | private String batchId; |
| | | |
| | | @Column(name = "dept_id", columnDefinition = "varchar(40) COMMENT 'æå±åºåº'") |
| | | @TableField("dept_id") |
| | | private String deptId; |
| | | |
| | | @Column(name = "batch_name", columnDefinition = "varchar(40) COMMENT 'çæ¬¡åç§°'") |
| | | @TableField("batch_name") |
| | | private String batchName; |
| | |
| | | @TableField("user_name") |
| | | private String userName; |
| | | |
| | | @Column(name = "start", columnDefinition = "datetime COMMENT 'èµ·å§æ¶é´'") |
| | | @TableField("start") |
| | | private Date start; |
| | | |
| | | @Column(name = "end", columnDefinition = "datetime COMMENT 'æªæ¢æ¶é´'") |
| | | @TableField("end") |
| | | private Date end; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.domain; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @Description 主é®ID |
| | | * @Author CZT |
| | | * @Date 2025/11/26 10:18 |
| | | */ |
| | | @Data |
| | | @AllArgsConstructor |
| | | public class PatrolKey implements Serializable { |
| | | |
| | | private String id; |
| | | |
| | | private String userId; |
| | | |
| | | private String batchId; |
| | | |
| | | public PatrolKey(){ |
| | | super(); |
| | | } |
| | | } |
| | |
| | | @TableField("point_name") |
| | | private String pointName; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @Column(name = "create_time", columnDefinition = "datetime COMMENT '巡黿¶é´'") |
| | | @TableField("create_time") |
| | | private Date createTime; |
| | | |
| | | @Column(name = "longitude", columnDefinition = "decimal(20,6) COMMENT 'ç»åº¦'") |
| | | @TableField("longitude") |
| | | private String longitude; |
| | |
| | | |
| | | //å·¡æ´ç
§çå
¨è·¯å¾ |
| | | @Transient |
| | | @TableField(exist = false) |
| | | private String imgPath; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.fzzy.igds.domain.GatewaySer; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * @Description |
| | | * @Author CZT |
| | | * @Date 2025/12/10 16:48 |
| | | */ |
| | | @Mapper |
| | | public interface GatewaySerMapper extends BaseMapper<GatewaySer> { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.fzzy.igds.constant.Constant; |
| | | import com.fzzy.igds.constant.RedisConst; |
| | | import com.fzzy.igds.domain.GatewaySer; |
| | | import com.fzzy.igds.mapper.GatewaySerMapper; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import com.ruoyi.common.core.domain.entity.SysDept; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.service.ISysDeptService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @Description |
| | | * @Author CZT |
| | | * @Date 2025/12/10 16:48 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class GatewaySerService { |
| | | @Resource |
| | | private GatewaySerMapper gatewaySerMapper; |
| | | @Resource |
| | | private ISysDeptService iSysDeptService; |
| | | @Resource |
| | | private RedisCache redisCache; |
| | | |
| | | /** |
| | | * æ ¹æ®æ¡ä»¶æ¥è¯¢åæºä¿¡æ¯ |
| | | * |
| | | * @param companyId |
| | | * @param deptId |
| | | * @param parentId |
| | | * @return |
| | | */ |
| | | public List<GatewaySer> listDeviceSer(String companyId, String deptId, String parentId) { |
| | | |
| | | QueryWrapper<GatewaySer> queryWrapper = new QueryWrapper<>(); |
| | | |
| | | if (StringUtils.isNotBlank(companyId)) { |
| | | queryWrapper.eq("company_id", companyId); |
| | | } |
| | | if (StringUtils.isNotBlank(deptId)) { |
| | | queryWrapper.eq("dept_id", deptId); |
| | | } |
| | | if (StringUtils.isNotBlank(parentId)) { |
| | | queryWrapper.likeRight("dept_id", parentId); |
| | | } |
| | | |
| | | return gatewaySerMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢åæºå表 |
| | | * |
| | | * @return |
| | | */ |
| | | public List<GatewaySer> getAllSer() { |
| | | SysUser user = ContextUtil.getLoginUser(); |
| | | SysDept userDept = iSysDeptService.selectDeptById(user.getDeptId()); |
| | | if (Constant.DEPT_TYPE_20.equals(userDept.getType())) { |
| | | return this.listDeviceSer(null, user.getDeptId() + "", null); |
| | | } else { |
| | | return this.listDeviceSer(null, null, user.getDeptId() + ""); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®æ¡ä»¶æ¥è¯¢åæºä¿¡æ¯ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public GatewaySer getById(String id) { |
| | | if(StringUtils.isBlank( id)){ |
| | | return null; |
| | | } |
| | | return gatewaySerMapper.selectById(id); |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°ä¿ååæº |
| | | * |
| | | * @param ser |
| | | */ |
| | | public void saveSer(GatewaySer ser) { |
| | | if (null == ser.getSn()) { |
| | | ser.setSn(ser.getId()); |
| | | } |
| | | if(null == ser.getOrderNum()){ |
| | | ser.setOrderNum(1); |
| | | } |
| | | if (StringUtils.isEmpty(ser.getCompanyId())) { |
| | | ser.setCompanyId(ContextUtil.getCompanyId()); |
| | | } |
| | | if (StringUtils.isEmpty(ser.getDeptId())) { |
| | | ser.setDeptId(ContextUtil.subDeptId(null)); |
| | | } |
| | | if (StringUtils.isBlank(ser.getUpdateBy())) { |
| | | ser.setCreateBy(ContextUtil.getLoginUserName()); |
| | | ser.setCreateTime(new Date()); |
| | | ser.setUpdateBy(ContextUtil.getLoginUserName()); |
| | | ser.setUpdateTime(new Date()); |
| | | gatewaySerMapper.insert(ser); |
| | | } else { |
| | | ser.setUpdateBy(ContextUtil.getLoginUserName()); |
| | | ser.setUpdateTime(new Date()); |
| | | gatewaySerMapper.updateById(ser); |
| | | } |
| | | |
| | | refreshCache(ser.getCompanyId()); |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°ä¿ååæº |
| | | * |
| | | * @param ser |
| | | */ |
| | | public void delSer(GatewaySer ser) { |
| | | gatewaySerMapper.deleteById(ser); |
| | | |
| | | //å é¤ç¼å |
| | | delCache(ser); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®åæºIDè·ååæºä¿¡æ¯ |
| | | * |
| | | * @param companyId |
| | | * @param deptId |
| | | * @return |
| | | */ |
| | | public List<GatewaySer> getCacheSerByDeptId(String companyId, String deptId) { |
| | | if (StringUtils.isEmpty(deptId)) { |
| | | return null; |
| | | } |
| | | if (StringUtils.isEmpty(companyId)) { |
| | | companyId = ContextUtil.getCompanyId(); |
| | | } |
| | | String patten = RedisConst.buildKey(companyId, RedisConst.KEY_DEVICE_SER_LIST, deptId) + "*"; |
| | | Collection<String> keys = redisCache.keys(patten); |
| | | if (null == keys) { |
| | | return null; |
| | | } |
| | | |
| | | List<GatewaySer> list = new ArrayList<>(); |
| | | for (String key : keys) { |
| | | list.add((GatewaySer) redisCache.getCacheObject(key)); |
| | | } |
| | | |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®åæºIDè·ååæºä¿¡æ¯ |
| | | * |
| | | * @param companyId |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public GatewaySer getCacheSerById(String companyId, String id) { |
| | | if (StringUtils.isEmpty(id)) { |
| | | return null; |
| | | } |
| | | if (StringUtils.isEmpty(companyId)) { |
| | | companyId = ContextUtil.getCompanyId(); |
| | | } |
| | | String patten = RedisConst.buildKey(companyId, RedisConst.KEY_DEVICE_SER_LIST) + "*"; |
| | | Collection<String> keys = redisCache.keys(patten); |
| | | if (null == keys) { |
| | | return null; |
| | | } |
| | | |
| | | List<GatewaySer> list = new ArrayList<>(); |
| | | GatewaySer ser = null; |
| | | for (String key : keys) { |
| | | ser = (GatewaySer) redisCache.getCacheObject(key); |
| | | if(id.equals(ser.getId())){ |
| | | break; |
| | | } |
| | | } |
| | | |
| | | if(null == ser){ |
| | | ser = getById(id); |
| | | this.setCacheSer(ser); |
| | | } |
| | | |
| | | return ser; |
| | | } |
| | | |
| | | /** |
| | | * å·æ°ç¼å |
| | | * |
| | | * @param companyId |
| | | */ |
| | | public void refreshCache(String companyId) { |
| | | if (StringUtils.isEmpty(companyId)) { |
| | | companyId = ContextUtil.getCompanyId(); |
| | | } |
| | | List<GatewaySer> list = this.listDeviceSer(companyId, null, null); |
| | | this.setCacheSer(list); |
| | | } |
| | | |
| | | /** |
| | | * 设置ç¼å |
| | | * @param data |
| | | */ |
| | | public void setCacheSer(GatewaySer data) { |
| | | if (null == data) { |
| | | return; |
| | | } |
| | | String key = RedisConst.buildKey(data.getCompanyId(), RedisConst.KEY_GATEWAY_SER_LIST, data.getDeptId(), data.getId()); |
| | | redisCache.setCacheObject(key, data); |
| | | } |
| | | |
| | | /** |
| | | * 设置ç¼å |
| | | * @param data |
| | | */ |
| | | public void setCacheSer(List<GatewaySer> data) { |
| | | if (null == data) { |
| | | return; |
| | | } |
| | | for (GatewaySer ser : data) { |
| | | this.setCacheSer( ser); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å é¤ç¼åä¿¡æ¯ |
| | | * @param ser |
| | | */ |
| | | public void delCache(GatewaySer ser) { |
| | | if (null == ser) { |
| | | return; |
| | | } |
| | | String key = RedisConst.buildKey(ser.getCompanyId(), RedisConst.KEY_GATEWAY_SER_LIST, ser.getDeptId(), ser.getId()); |
| | | redisCache.deleteObject(key); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.fzzy.igds.data.BaseResp; |
| | | import com.fzzy.igds.data.IgdsBaseParam; |
| | | import com.fzzy.igds.domain.PatrolRecord; |
| | | import com.fzzy.igds.mapper.PatrolRecordMapper; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @Service |
| | | public class PatrolRecordService { |
| | | |
| | | @Resource |
| | | private PatrolRecordMapper patrolRecordMapper; |
| | | |
| | | /** |
| | | * å页æ¥è¯¢æ°æ® |
| | | * |
| | | * @param page |
| | | * @param param |
| | | */ |
| | | public void listPage(Page<PatrolRecord> page, IgdsBaseParam param) { |
| | | QueryWrapper<PatrolRecord> queryWrapper = getQueryWrapper(param); |
| | | patrolRecordMapper.selectPage(page, queryWrapper); |
| | | } |
| | | |
| | | public List<PatrolRecord> listAll(IgdsBaseParam param) { |
| | | QueryWrapper<PatrolRecord> queryWrapper = getQueryWrapper(param); |
| | | return patrolRecordMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | | /** |
| | | * å°è£
æ¥è¯¢æ¡ä»¶ |
| | | * |
| | | * @param param |
| | | */ |
| | | public QueryWrapper<PatrolRecord> getQueryWrapper(IgdsBaseParam param) { |
| | | QueryWrapper<PatrolRecord> queryWrapper = new QueryWrapper<>(); |
| | | |
| | | param.setCompanyId(ContextUtil.getCompanyId()); |
| | | queryWrapper.eq("company_id", param.getCompanyId()); |
| | | |
| | | if (StringUtils.isNotBlank(param.getName())) { |
| | | queryWrapper.eq("point_name", param.getName()); |
| | | } |
| | | if (StringUtils.isNotBlank(param.getKey())) { |
| | | queryWrapper.eq("patrol_id", param.getKey()); |
| | | } |
| | | queryWrapper.orderByDesc("id"); |
| | | |
| | | return queryWrapper; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ·»å æ°æ® |
| | | * |
| | | * @param patrolRecord |
| | | * @author sgj |
| | | * @date 2025/12/10 |
| | | */ |
| | | public BaseResp addData(PatrolRecord patrolRecord) { |
| | | patrolRecord.setId(ContextUtil.generateId()); |
| | | patrolRecord.setCompanyId(ContextUtil.getCompanyId()); |
| | | patrolRecord.setUpdateBy(ContextUtil.getLoginUserName()); |
| | | patrolRecord.setUpdateTime(new Date()); |
| | | patrolRecord.setCreateBy(ContextUtil.getLoginUserName()); |
| | | patrolRecord.setCreateTime(new Date()); |
| | | return patrolRecordMapper.insert(patrolRecord) > 0 ? BaseResp.success() : BaseResp.error("æ·»å 失败"); |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°æ°æ® |
| | | * |
| | | * @param patrolRecord |
| | | * @author sgj |
| | | * @date 2025/12/10 |
| | | */ |
| | | public BaseResp updateData(PatrolRecord patrolRecord) { |
| | | patrolRecord.setUpdateBy(ContextUtil.getLoginUserName()); |
| | | patrolRecord.setUpdateTime(new Date()); |
| | | return patrolRecordMapper.updateById(patrolRecord) > 0 ? BaseResp.success() : BaseResp.error("æ´æ°å¤±è´¥"); |
| | | } |
| | | |
| | | /** |
| | | * å 餿°æ® |
| | | * |
| | | * @param patrolRecord |
| | | * @author sgj |
| | | * @date 2025/12/10 |
| | | */ |
| | | public BaseResp deleteData(PatrolRecord patrolRecord) { |
| | | return patrolRecordMapper.deleteById(patrolRecord) > 0 ? BaseResp.success() : BaseResp.error("å é¤å¤±è´¥"); |
| | | } |
| | | } |
| | |
| | | return queryWrapper; |
| | | } |
| | | |
| | | /** |
| | | * éè¿idæ¥è¯¢åæ¡æ°æ® |
| | | * |
| | | * @param id |
| | | * @author sgj |
| | | * @date 2025/12/10 |
| | | */ |
| | | public Patrol selectById(String id) { |
| | | return patrolMapper.selectById(id); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢æ°æ® |
| | | * |
| | | * @param param |
| | | * @author sgj |
| | | * @date 2025/12/10 |
| | | */ |
| | | public int insertData(Patrol param) { |
| | | if (StringUtils.isEmpty(param.getId())) { |
| | | param.setId(ContextUtil.generateId()); |
| | |
| | | return patrolMapper.insert(param); |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°æ°æ® |
| | | * |
| | | * @param param |
| | | * @author sgj |
| | | * @date 2025/12/10 |
| | | */ |
| | | public int updateData(Patrol param) { |
| | | return patrolMapper.updateById(param); |
| | | } |
| | | |
| | | public void deleteDataById( String ids) { |
| | | /** |
| | | * éè¿idå é¤ä¸æ¡æ°æ® |
| | | * |
| | | * @param ids |
| | | * @author sgj |
| | | * @date 2025/12/10 |
| | | */ |
| | | public void deleteDataById(String ids) { |
| | | String[] recordIds = Convert.toStrArray(ids); |
| | | for (String recordId : recordIds) { |
| | | patrolMapper.deleteById(recordId); |
| | |
| | | import com.fzzy.igds.domain.SnapConf; |
| | | import com.fzzy.igds.mapper.SnapConfMapper; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import com.ruoyi.common.core.text.Convert; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | @Resource |
| | | private SnapConfMapper snapConfMapper; |
| | | |
| | | public List<SnapConf> listAll(IgdsBaseParam param) { |
| | | |
| | | if (null == param) |
| | | return snapConfMapper.selectList(null); |
| | | |
| | | QueryWrapper<SnapConf> queryWrapper = new QueryWrapper<>(); |
| | | if (StringUtils.isNotEmpty(param.getName())) { |
| | | queryWrapper.like("name", param.getName()); |
| | | } |
| | | /** |
| | | * æ¥è¯¢åè¡¨æ°æ® |
| | | * |
| | | * @param param æ¥è¯¢åæ° |
| | | * @return æ°æ®å表 |
| | | */ |
| | | public List<SnapConf> selectList(SnapConf param) { |
| | | QueryWrapper<SnapConf> queryWrapper = getQueryWrapper(param); |
| | | return snapConfMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | | public BaseResp addData(SnapConf snapConf) { |
| | | snapConf.setId(ContextUtil.generateId()); |
| | | snapConf.setCompanyId(ContextUtil.getCompanyId()); |
| | | snapConf.setUpdateBy(ContextUtil.getLoginUserName()); |
| | | snapConf.setUpdateTime(new Date()); |
| | | snapConf.setCreateBy(ContextUtil.getLoginUserName()); |
| | | snapConf.setCreateTime(new Date()); |
| | | return snapConfMapper.insert(snapConf) > 0 ? BaseResp.success() : BaseResp.error("æ·»å 失败"); |
| | | /** |
| | | * å°è£
æ¥è¯¢æ¡ä»¶ |
| | | * |
| | | * @param param æ¥è¯¢åæ° |
| | | * @return æ¥è¯¢æé å¨ |
| | | */ |
| | | public QueryWrapper<SnapConf> getQueryWrapper(SnapConf param) { |
| | | QueryWrapper<SnapConf> queryWrapper = new QueryWrapper<>(); |
| | | |
| | | // 设置å
¬å¸IDå¹¶ä½ä¸ºæ¥è¯¢æ¡ä»¶ |
| | | param.setCompanyId(ContextUtil.getCompanyId()); |
| | | queryWrapper.eq("company_id", param.getCompanyId()); |
| | | |
| | | // æå建æ¶é´ååºæåº |
| | | queryWrapper.orderByDesc("create_time"); |
| | | |
| | | return queryWrapper; |
| | | } |
| | | |
| | | public BaseResp updateData(SnapConf snapConf) { |
| | | snapConf.setUpdateBy(ContextUtil.getLoginUserName()); |
| | | snapConf.setUpdateTime(new Date()); |
| | | return snapConfMapper.updateById(snapConf) > 0 ? BaseResp.success() : BaseResp.error("æ´æ°å¤±è´¥"); |
| | | /** |
| | | * æ ¹æ®IDæ¥è¯¢è¯¦æ
|
| | | * |
| | | * @param id 主é®ID |
| | | * @return å®ä½å¯¹è±¡ |
| | | */ |
| | | public SnapConf selectById(String id) { |
| | | return snapConfMapper.selectById(id); |
| | | } |
| | | |
| | | public BaseResp deleteData(SnapConf snapConf) { |
| | | return snapConfMapper.deleteById(snapConf) > 0 ? BaseResp.success() : BaseResp.error("å é¤å¤±è´¥"); |
| | | /** |
| | | * æå
¥æ°æ°æ® |
| | | * |
| | | * @param param æ°æ®å®ä½ |
| | | * @return å½±åè¡æ° |
| | | */ |
| | | public int insertData(SnapConf param) { |
| | | param.setId(ContextUtil.generateId()); |
| | | param.setCompanyId(ContextUtil.getCompanyId()); |
| | | param.setUpdateBy(ContextUtil.getLoginUserName()); |
| | | param.setUpdateTime(new Date()); |
| | | param.setCreateBy(ContextUtil.getLoginUserName()); |
| | | param.setCreateTime(new Date()); |
| | | return snapConfMapper.insert(param); |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°å·²ææ°æ® |
| | | * |
| | | * @param param æ°æ®å®ä½ |
| | | * @return å½±åè¡æ° |
| | | */ |
| | | public int updateData(SnapConf param) { |
| | | param.setUpdateBy(ContextUtil.getLoginUserName()); |
| | | param.setUpdateTime(new Date()); |
| | | return snapConfMapper.updateById(param); |
| | | } |
| | | |
| | | /** |
| | | * å 餿å®IDçæ°æ® |
| | | * |
| | | * @param ids è¦å é¤çè®°å½IDéåï¼éå·åéï¼ |
| | | */ |
| | | public void deleteDataById(String ids) { |
| | | String[] recordIds = Convert.toStrArray(ids); |
| | | for (String recordId : recordIds) { |
| | | snapConfMapper.deleteById(recordId); |
| | | } |
| | | } |
| | | } |
| | |
| | | return queryWrapper; |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢æææ°æ® |
| | | * |
| | | * @param param |
| | | * @author sgj |
| | | * @date 2025/12/10 |
| | | */ |
| | | public List<SnapRecord> listAll(IgdsBaseParam param) { |
| | | |
| | | if (null == param) |
| | |
| | | return snapRecordMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢æ°æ® |
| | | * |
| | | * @param snapRecord |
| | | * @author sgj |
| | | * @date 2025/12/10 |
| | | */ |
| | | public BaseResp addData(SnapRecord snapRecord) { |
| | | snapRecord.setId(ContextUtil.generateId()); |
| | | snapRecord.setCompanyId(ContextUtil.getCompanyId()); |
| | |
| | | return snapRecordMapper.insert(snapRecord) > 0 ? BaseResp.success() : BaseResp.error("æ·»å 失败"); |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°æ°æ® |
| | | * |
| | | * @param snapRecord |
| | | * @author sgj |
| | | * @date 2025/12/10 |
| | | */ |
| | | public BaseResp updateData(SnapRecord snapRecord) { |
| | | snapRecord.setUpdateBy(ContextUtil.getLoginUserName()); |
| | | snapRecord.setUpdateTime(new Date()); |
| | | return snapRecordMapper.updateById(snapRecord) > 0 ? BaseResp.success() : BaseResp.error("æ´æ°å¤±è´¥"); |
| | | } |
| | | |
| | | /** |
| | | * å 餿°æ® |
| | | * |
| | | * @param snapRecord |
| | | * @author sgj |
| | | * @date 2025/12/10 |
| | | */ |
| | | public BaseResp deleteData(SnapRecord snapRecord) { |
| | | return snapRecordMapper.deleteById(snapRecord) > 0 ? BaseResp.success() : BaseResp.error("å é¤å¤±è´¥"); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ViewConfig> |
| | | <Arguments/> |
| | | <Context/> |
| | | <Model/> |
| | | <View layout="padding:10"> |
| | | <ClientEvent name="onReady">
 |
| | | addData = function(){
 |
| | | view.get("#dsGatewaySer").insert();
 |
| | | view.get("#dialog1").set("caption","ç½å
³ä¿¡æ¯");
 |
| | | 
 |
| | | view.get("#dialog1").show();
 |
| | | };
 |
| | | 
 |
| | | delData = function(){
 |
| | | var cur = view.get("#dsGatewaySer.data:#");
 |
| | | if(!cur) return;
 |
| | | cur.setState(dorado.Entity.STATE_DELETED);
 |
| | | $confirm("ç¡®å®è¦å é¤è¯¥æ°æ®ä¹ï¼",function(){
 |
| | | view.get("#uaSave").execute(function(){
 |
| | | cur.remove();
 |
| | | });
 |
| | | });
 |
| | | };
 |
| | | 
 |
| | | btnCancel = function(){
 |
| | | view.get("#dialog1").hide();
 |
| | | };
 |
| | | 
 |
| | | onDialogHide = function(){
 |
| | | var cur = view.get("#dsGatewaySer.data:#");
 |
| | | cur.cancel();
 |
| | | };</ClientEvent> |
| | | <Property name="packages">font-awesome,css-common</Property> |
| | | <Property name="cache"> |
| | | <Property name="mode">clientSide</Property> |
| | | </Property> |
| | | <DataSet id="dsGatewaySer"> |
| | | <Property name="parameter"></Property> |
| | | <Property name="dataProvider">gatewaySerPR#getAllSer</Property> |
| | | <Property name="dataType">[dtGatewaySer]</Property> |
| | | </DataSet> |
| | | <Container> |
| | | <Property name="className">c-param</Property> |
| | | <ToolBar> |
| | | <ToolBarButton> |
| | | <ClientEvent name="onClick">addData();</ClientEvent> |
| | | <Property name="caption">æ°å¢</Property> |
| | | <Property name="exClassName">btn1</Property> |
| | | <Property name="width">100</Property> |
| | | <Property name="iconClass">fa fa-plus</Property> |
| | | </ToolBarButton> |
| | | <ToolBarButton> |
| | | <ClientEvent name="onClick">
 |
| | | var select = view.get("#dataGridMain").get("selection");
 |
| | | if(select){
 |
| | | view.get("#dialog1").show();
 |
| | | }else{
 |
| | | $notify("è¯·éæ©éè¦ä¿®æ¹çæ°æ®â¦â¦");
 |
| | | }</ClientEvent> |
| | | <Property name="caption">ä¿®æ¹</Property> |
| | | <Property name="exClassName">btn2</Property> |
| | | <Property name="width">100</Property> |
| | | <Property name="iconClass">fa fa-pencil-square-o</Property> |
| | | </ToolBarButton> |
| | | <ToolBarButton> |
| | | <ClientEvent name="onClick"> |
| | | var select = view.get("#dataGridMain").get("selection");
 |
| | | if(select){
 |
| | | view.get("#ajaxActionDel").set("parameter",{
id: select.get("id")
 |
| | | }).execute(function(){
 |
| | | select.remove();
 |
| | | });
 |
| | | }else{
 |
| | | $notify("è¯·éæ©éè¦å é¤çæ°æ®â¦â¦");
 |
| | | }
</ClientEvent> |
| | | <Property name="caption">å é¤</Property> |
| | | <Property name="exClassName">btn3</Property> |
| | | <Property name="width">100</Property> |
| | | <Property name="iconClass">fa fa-times</Property> |
| | | <Property name="action">ajaxActionDel</Property> |
| | | </ToolBarButton> |
| | | <ToolBarButton> |
| | | <ClientEvent name="onClick">view.get("#dsGatewaySer").flushAsync();
 |
| | | </ClientEvent> |
| | | <Property name="caption">å·æ°æ°æ®</Property> |
| | | <Property name="exClassName">btn2</Property> |
| | | <Property name="iconClass">fa fa-refresh</Property> |
| | | </ToolBarButton> |
| | | <ToolBarButton> |
| | | <Property name="caption">å·æ°ç¼å</Property> |
| | | <Property name="exClassName">btn4</Property> |
| | | <Property name="iconClass">fa fa-refresh</Property> |
| | | <Property name="width">100</Property> |
| | | <Property name="action">ajaxRefreshCache</Property> |
| | | </ToolBarButton> |
| | | </ToolBar> |
| | | <DataGrid id="dataGridMain" layoutConstraint="padding:8"> |
| | | <ClientEvent name="onDataRowClick">view.get("#dataGridMain").set("selection",arg.data);</ClientEvent> |
| | | <Property name="dataSet">dsGatewaySer</Property> |
| | | <Property name="readOnly">true</Property> |
| | | <Property name="selectionMode">singleRow</Property> |
| | | <RowSelectorColumn/> |
| | | <RowNumColumn/> |
| | | <DataColumn name="id"> |
| | | <Property name="property">id</Property> |
| | | <Property name="align">center</Property> |
| | | </DataColumn> |
| | | <DataColumn name="name"> |
| | | <Property name="property">name</Property> |
| | | <Property name="align">center</Property> |
| | | </DataColumn> |
| | | <DataColumn name="deptId"> |
| | | <Property name="property">deptId</Property> |
| | | <Property name="align">center</Property> |
| | | </DataColumn> |
| | | <DataColumn name="ip"> |
| | | <Property name="property">ip</Property> |
| | | <Property name="align">center</Property> |
| | | </DataColumn> |
| | | <DataColumn name="port"> |
| | | <Property name="property">port</Property> |
| | | <Property name="align">center</Property> |
| | | </DataColumn> |
| | | <DataColumn name="status"> |
| | | <ClientEvent name="onRenderCell">arg.dom.style.background = arg.data.get("status")== 'Y' ?"":"#FF5722";
 |
| | | arg.processDefault = true;</ClientEvent> |
| | | <Property name="property">status</Property> |
| | | <Property name="align">center</Property> |
| | | <Property name="width">120</Property> |
| | | </DataColumn> |
| | | <DataColumn name="updateBy"> |
| | | <Property name="property">updateBy</Property> |
| | | <Property name="align">center</Property> |
| | | </DataColumn> |
| | | <DataColumn name="updateTime"> |
| | | <Property name="property">updateTime</Property> |
| | | <Property name="align">center</Property> |
| | | <Property name="width">180</Property> |
| | | </DataColumn> |
| | | </DataGrid> |
| | | </Container> |
| | | <Dialog id="dialog1" layout="regionPadding:8"> |
| | | <ClientEvent name="onHide">onDialogHide();</ClientEvent> |
| | | <Property name="iconClass">fa fa-tasks</Property> |
| | | <Property name="width">1200</Property> |
| | | <Property name="caption">ç½å
³ä¿¡æ¯</Property> |
| | | <Property name="closeable">false</Property> |
| | | <Buttons> |
| | | <Button> |
| | | <ClientEvent name="onClick">var cur = view.get("#dsGatewaySer.data:#");
 |
| | | if(cur.validate() == 'ok'){
 |
| | | view.get("#updateAction").execute(function(){
 |
| | | view.get("#dialog1").close();
 |
| | | });
 |
| | | }else{
 |
| | | $alert("æ°æ®æ ¡éªå¤±è´¥ï¼");
 |
| | | }</ClientEvent> |
| | | <Property name="caption">ä¿å</Property> |
| | | <Property name="iconClass">fa fa-check-circle</Property> |
| | | <Property name="exClassName">btn1</Property> |
| | | <Property name="width">120</Property> |
| | | </Button> |
| | | <Button> |
| | | <ClientEvent name="onClick">btnCancel();</ClientEvent> |
| | | <Property name="caption">åæ¶</Property> |
| | | <Property name="exClassName">btn3</Property> |
| | | <Property name="iconClass">fa fa-times-circle</Property> |
| | | <Property name="width">120</Property> |
| | | </Button> |
| | | </Buttons> |
| | | <Children> |
| | | <FieldSet layout="padding:5"> |
| | | <Property name="caption">åºæ¬ä¿¡æ¯</Property> |
| | | <Buttons/> |
| | | <Children> |
| | | <AutoForm> |
| | | <Property name="dataSet">dsGatewaySer</Property> |
| | | <Property name="cols">*,*,*</Property> |
| | | <Property name="labelSeparator">ï¼</Property> |
| | | <Property name="labelAlign">right</Property> |
| | | <Property name="labelWidth">100</Property> |
| | | <AutoFormElement> |
| | | <Property name="name">id</Property> |
| | | <Property name="property">id</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">name</Property> |
| | | <Property name="property">name</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">deptId</Property> |
| | | <Property name="property">deptId</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">sn</Property> |
| | | <Property name="property">sn</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">ip</Property> |
| | | <Property name="property">ip</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">port</Property> |
| | | <Property name="property">port</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement layoutConstraint="colSpan:2"> |
| | | <Property name="name">snapUrl</Property> |
| | | <Property name="property">snapUrl</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">status</Property> |
| | | <Property name="property">status</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement layoutConstraint="colSpan:2"> |
| | | <Property name="name">ptzUrl</Property> |
| | | <Property name="property">ptzUrl</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">orderNum</Property> |
| | | <Property name="property">orderNum</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement layoutConstraint="colSpan:2"> |
| | | <Property name="name">remark</Property> |
| | | <Property name="property">remark</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">createBy</Property> |
| | | <Property name="property">createBy</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">createTime</Property> |
| | | <Property name="property">createTime</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">updateBy</Property> |
| | | <Property name="property">updateBy</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">updateTime</Property> |
| | | <Property name="property">updateTime</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | </AutoForm> |
| | | </Children> |
| | | </FieldSet> |
| | | </Children> |
| | | <Tools/> |
| | | </Dialog> |
| | | <UpdateAction id="updateAction"> |
| | | <Property name="dataResolver">gatewaySerPR#updateSer</Property> |
| | | <UpdateItem> |
| | | <Property name="dataSet">dsGatewaySer</Property> |
| | | <Property name="dataPath">[#current]</Property> |
| | | </UpdateItem> |
| | | </UpdateAction> |
| | | <AjaxAction id="ajaxActionDel"> |
| | | <Property name="service">gatewaySerPR#delSerById</Property> |
| | | <Property name="confirmMessage">ç¡®å®è¦å é¤ä¹ï¼</Property> |
| | | <Property name="executingMessage">æ£å¨å é¤</Property> |
| | | <Property name="successMessage">å 餿å</Property> |
| | | </AjaxAction> |
| | | <AjaxAction id="ajaxRefreshCache"> |
| | | <Property name="service">gatewaySerPR#refreshCache</Property> |
| | | <Property name="successMessage">å·æ°æåï¼</Property> |
| | | <Property name="confirmMessage">ç¡®å®è¦å·æ°ç¼åä¹ï¼</Property> |
| | | </AjaxAction> |
| | | </View> |
| | | </ViewConfig> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds; |
| | | |
| | | import com.bstek.dorado.annotation.DataProvider; |
| | | import com.bstek.dorado.annotation.DataResolver; |
| | | import com.bstek.dorado.annotation.Expose; |
| | | import com.fzzy.igds.domain.GatewaySer; |
| | | import com.fzzy.igds.service.GatewaySerService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description |
| | | * @Author CZT |
| | | * @Date 2025/12/10 16:48 |
| | | */ |
| | | @Component |
| | | public class GatewaySerPR { |
| | | |
| | | @Resource |
| | | private GatewaySerService gatewaySerService; |
| | | |
| | | /** |
| | | * gatewaySerPR#getAllSer |
| | | * |
| | | * @return |
| | | */ |
| | | @DataProvider |
| | | public List<GatewaySer> getAllSer() { |
| | | return gatewaySerService.getAllSer(); |
| | | } |
| | | |
| | | /** |
| | | * deviceSerPR#updateSer |
| | | * |
| | | * @param data |
| | | */ |
| | | @DataResolver |
| | | public void updateSer(GatewaySer data) { |
| | | GatewaySer ser = new GatewaySer(); |
| | | BeanUtils.copyProperties(data, ser); |
| | | gatewaySerService.saveSer(ser); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®åæºidååç§°å é¤åæº |
| | | */ |
| | | @Expose |
| | | @Transactional |
| | | public void delSerById(String id) { |
| | | GatewaySer ser = gatewaySerService.getById(id); |
| | | gatewaySerService.delSer(ser); |
| | | } |
| | | |
| | | /** |
| | | * deviceSerPR#refreshCache |
| | | * |
| | | * @throws |
| | | * @Title: refreshCache |
| | | * @Description: å·æ°ç¼å void |
| | | */ |
| | | @Expose |
| | | public void refreshCache() { |
| | | gatewaySerService.refreshCache(null); |
| | | } |
| | | |
| | | } |
| | |
| | | <Property name="readOnly">true</Property> |
| | | </PropertyDef> |
| | | </DataType> |
| | | <DataType name="dtGatewaySer"> |
| | | <Property name="creationType">com.fzzy.igds.domain.GatewaySer</Property> |
| | | <PropertyDef name="id"> |
| | | <Property></Property> |
| | | <Property name="label">ç½å
³ID</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="deptId"> |
| | | <Property></Property> |
| | | <Property name="label">æå±åºåº</Property> |
| | | <Property name="mapping"> |
| | | <Property name="mapValues">${dorado.getDataProvider("deptPR#getAllData").getResult()}</Property> |
| | | <Property name="keyProperty">id</Property> |
| | | <Property name="valueProperty">kqmc</Property> |
| | | </Property> |
| | | <Property name="required">true</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="companyId"> |
| | | <Property></Property> |
| | | <Property name="label">ç»ç»ç¼ç </Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="sn"> |
| | | <Property></Property> |
| | | <Property name="label">åºåå·</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="name"> |
| | | <Property></Property> |
| | | <Property name="label">ç½å
³åç§°</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="ip"> |
| | | <Property></Property> |
| | | <Property name="label">ç½å
³IP</Property> |
| | | <Property name="required">true</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="port"> |
| | | <Property name="dataType">Integer</Property> |
| | | <Property name="label">ç½å
³ç«¯å£</Property> |
| | | <Property name="required">true</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="status"> |
| | | <Property></Property> |
| | | <Property name="label">æ¯å¦å¨çº¿</Property> |
| | | <Property name="mapping"> |
| | | <Property name="mapValues">${dorado.getDataProvider("dicPR#sysDictData").getResult("sys_yes_no")}</Property> |
| | | <Property name="keyProperty">dictValue</Property> |
| | | <Property name="valueProperty">dictLabel</Property> |
| | | </Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="orderNum"> |
| | | <Property name="dataType">Integer</Property> |
| | | <Property name="label">顺åºå·</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="snapUrl"> |
| | | <Property></Property> |
| | | <Property name="label">ææè·¯å¾</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="ptzUrl"> |
| | | <Property></Property> |
| | | <Property name="label">äºå°è·¯å¾</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="remark"> |
| | | <Property></Property> |
| | | <Property name="label">夿³¨</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="createTime"> |
| | | <Property name="dataType">DateTime</Property> |
| | | <Property name="label">å建æ¶é´</Property> |
| | | <Property name="readOnly">true</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="createBy"> |
| | | <Property></Property> |
| | | <Property name="label">å建人</Property> |
| | | <Property name="readOnly">true</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="updateTime"> |
| | | <Property name="dataType">DateTime</Property> |
| | | <Property name="label">æ´æ°æ¶é´</Property> |
| | | <Property name="readOnly">true</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="updateBy"> |
| | | <Property></Property> |
| | | <Property name="label">æ´æ°äºº</Property> |
| | | <Property name="readOnly">true</Property> |
| | | </PropertyDef> |
| | | </DataType> |
| | | </Model> |
| | |
| | | @Resource |
| | | private EventInfoManager eventInfoManager; |
| | | |
| | | /** |
| | | * AIäºä»¶ç®¡çé¡µé¢ |
| | | * |
| | | * @author sgj |
| | | * @date 2025/12/10 |
| | | * @param model |
| | | |
| | | */ |
| | | @GetMapping |
| | | public String getEventInfo( |
| | | Model model) { |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.sys.controller.security; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.fzzy.igds.constant.RespCodeEnum; |
| | | import com.fzzy.igds.data.IgdsBaseParam; |
| | | import com.fzzy.igds.data.PageResponse; |
| | | import com.fzzy.igds.domain.PatrolRecord; |
| | | import com.fzzy.sys.manager.security.PatrolRecordManager; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @Controller |
| | | @RequestMapping("/security/patrol/patrolRecord") |
| | | public class PatrolRecordController { |
| | | |
| | | private static final String prefix = "security/patrol/patrolRecord"; |
| | | |
| | | @Resource |
| | | private PatrolRecordManager patrolRecordManager; |
| | | |
| | | |
| | | /** |
| | | * è·åå·¡æ´è®°å½é¡µé¢ |
| | | * |
| | | * @param patrolId |
| | | * @param model |
| | | * @return |
| | | */ |
| | | @GetMapping("/{patrolId}") |
| | | public String getPatrolRecordById(@PathVariable("patrolId") String patrolId, Model model) { |
| | | IgdsBaseParam param = new IgdsBaseParam(); |
| | | param.setPage(1); |
| | | param.setLimit(6); |
| | | param.setKey(patrolId); |
| | | Page<PatrolRecord> records = patrolRecordManager.pageData(param); |
| | | model.addAttribute("patrolRecordList", records.getRecords()); |
| | | model.addAttribute("currentPage", records.getCurrent()); |
| | | model.addAttribute("totalItems", records.getTotal()); |
| | | model.addAttribute("pageSize", records.getSize()); |
| | | model.addAttribute("patrolId", patrolId); |
| | | return prefix + "/patrolRecord"; |
| | | } |
| | | |
| | | /** |
| | | * è·å轨迹å¾é¡µé¢ |
| | | */ |
| | | @GetMapping("trajectoryMap/{patrolId}") |
| | | public String showTrajectoryMap(@PathVariable("patrolId") String patrolId, Model model) { |
| | | |
| | | IgdsBaseParam param = new IgdsBaseParam(); |
| | | param.setKey(patrolId); |
| | | List<PatrolRecord> trackPoints = patrolRecordManager.listAll(param); |
| | | model.addAttribute("trackPoints", trackPoints); |
| | | |
| | | return prefix + "/trajectoryMap"; |
| | | } |
| | | |
| | | /** |
| | | * å页è·åæ°æ® |
| | | * |
| | | * @param param |
| | | * @return |
| | | */ |
| | | @RequestMapping("/pageData") |
| | | @ResponseBody |
| | | public PageResponse<Page<PatrolRecord>> pageData(@RequestBody IgdsBaseParam param) { |
| | | Page<PatrolRecord> patrolRecordPage = patrolRecordManager.pageData(param); |
| | | if (null == patrolRecordPage.getRecords() || patrolRecordPage.getRecords().isEmpty()) { |
| | | return new PageResponse<>(RespCodeEnum.CODE_2000.getCode(), "è·åå°æ°æ®ä¿¡æ¯ä¸ºç©º"); |
| | | } |
| | | return new PageResponse<>(RespCodeEnum.CODE_0000, patrolRecordPage); |
| | | } |
| | | } |
| | |
| | | |
| | | String viewUrl = prefix + "/video-webrtc"; |
| | | |
| | | //WEB-RTC大忿¾ |
| | | //WEB-RTCææ¾ |
| | | if (CameraPlayType.PLAY_TYPE_WEB_RTC.getCode().equals(playType)) { |
| | | viewUrl = prefix + "/video-webrtc"; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.sys.controller.security; |
| | | |
| | | import com.fzzy.igds.domain.SnapConf; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import com.fzzy.sys.manager.security.SnapConfManager; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.ShiroUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.ModelMap; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Controller |
| | | @RequestMapping("/security/snap/snapConf") |
| | | public class SnapConfController extends BaseController { |
| | | |
| | | private static final String prefix = "security/snap/snapConf"; |
| | | |
| | | @Resource |
| | | private SnapConfManager snapConfManager; |
| | | |
| | | /** |
| | | * ææé
ç½®é¡µé¢ |
| | | */ |
| | | @GetMapping() |
| | | public String snapConf() { |
| | | return prefix + "/snapConf"; |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ææé
ç½®å表 |
| | | */ |
| | | @PostMapping("/list") |
| | | @ResponseBody |
| | | public TableDataInfo list(SnapConf param) { |
| | | if (null == param.getCompanyId()) { |
| | | param.setCompanyId(ShiroUtils.getLoginUserCompanyId()); |
| | | } |
| | | startPage(); |
| | | List<SnapConf> list = snapConfManager.selectList(param); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * å¯¼åºææé
ç½®å表 |
| | | */ |
| | | @Log(title = "ææé
置管ç", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | @ResponseBody |
| | | public AjaxResult export(SnapConf param) { |
| | | if (null == param.getCompanyId()) { |
| | | param.setCompanyId(ShiroUtils.getLoginUserCompanyId()); |
| | | } |
| | | List<SnapConf> list = snapConfManager.selectList(param); |
| | | ExcelUtil<SnapConf> util = new ExcelUtil<>(SnapConf.class); |
| | | return util.exportExcel(list, "ææé
ç½®æ°æ®"); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ææé
ç½®é¡µé¢ |
| | | */ |
| | | @GetMapping("/add") |
| | | public String add(ModelMap mmap) { |
| | | return prefix + "/add"; |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ææé
ç½®æ°æ® |
| | | */ |
| | | @Log(title = "ææé
置管ç", businessType = BusinessType.INSERT) |
| | | @PostMapping("/add") |
| | | @ResponseBody |
| | | public AjaxResult addSave(@Validated SnapConf param) { |
| | | if (null == param.getCompanyId()) { |
| | | param.setCompanyId(ShiroUtils.getLoginUserCompanyId()); |
| | | } |
| | | param.setCreateBy(getLoginName()); |
| | | param.setCreateTime(new Date()); |
| | | if (StringUtils.isEmpty(param.getId())) { |
| | | param.setId(ContextUtil.generateId()); |
| | | } |
| | | return toAjax(snapConfManager.insertData(param)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ææé
ç½®é¡µé¢ |
| | | */ |
| | | @GetMapping("/edit/{id}") |
| | | public String edit(@PathVariable("id") String id, ModelMap mmap) { |
| | | SnapConf record = snapConfManager.selectById(id); |
| | | mmap.put("snapConf", record); |
| | | return prefix + "/edit"; |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ææé
ç½®æ°æ® |
| | | */ |
| | | @Log(title = "ææé
置管ç", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/edit") |
| | | @ResponseBody |
| | | public AjaxResult editSave(@Validated SnapConf param) { |
| | | if (null == param.getCompanyId()) { |
| | | param.setCompanyId(ShiroUtils.getLoginUserCompanyId()); |
| | | } |
| | | param.setUpdateBy(getLoginName()); |
| | | param.setUpdateTime(new Date()); |
| | | SnapConf snapConf = snapConfManager.selectById(param.getId()); |
| | | if (snapConf == null) { |
| | | param.setId(ContextUtil.generateId()); |
| | | return toAjax(snapConfManager.insertData(param)); |
| | | } |
| | | |
| | | return toAjax(snapConfManager.updateData(param)); |
| | | } |
| | | |
| | | /** |
| | | * å 餿æé
ç½®æ°æ® |
| | | */ |
| | | @Log(title = "ææé
置管ç", businessType = BusinessType.DELETE) |
| | | @PostMapping("/remove") |
| | | @ResponseBody |
| | | public AjaxResult remove(String ids) { |
| | | snapConfManager.deleteDataById(ids); |
| | | return success(); |
| | | } |
| | | } |
| | |
| | | @Resource |
| | | private SnapRecordManager snapRecordManager; |
| | | |
| | | /** |
| | | * è·åæºè½ææé¡µé¢ |
| | | */ |
| | | @GetMapping |
| | | public String getSnapRecord( |
| | | Model model) { |
| | |
| | | @Resource |
| | | private PatrolConfService patrolConfService; |
| | | |
| | | /** |
| | | * æ¥è¯¢æ°æ® |
| | | * |
| | | * @param param |
| | | * @return |
| | | */ |
| | | public List<PatrolConf> selectList(PatrolConf param) { |
| | | return patrolConfService.selectList(param); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®IDæ¥è¯¢æ°æ® |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public PatrolConf selectById(String id) { |
| | | return patrolConfService.selectById(id); |
| | | } |
| | | |
| | | /** |
| | | * æå
¥æ°æ® |
| | | * |
| | | * @param param |
| | | * @return |
| | | */ |
| | | public int insertData(PatrolConf param) { |
| | | return patrolConfService.insertData(param); |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°æ°æ® |
| | | * |
| | | * @param param |
| | | * @return |
| | | */ |
| | | public int updateData(PatrolConf param) { |
| | | return patrolConfService.updateData(param); |
| | | } |
| | | |
| | | /** |
| | | * å 餿°æ® |
| | | * |
| | | * @param ids |
| | | */ |
| | | public void deleteDataById( String ids) { |
| | | patrolConfService.deleteDataById( ids); |
| | | } |
| | |
| | | @Resource |
| | | private PatrolService patrolService; |
| | | |
| | | |
| | | /** |
| | | * æ¥è¯¢æ°æ® |
| | | * |
| | | * @param param |
| | | * @author sgj |
| | | * @date 2025/12/10 |
| | | */ |
| | | public List<Patrol> selectList(Patrol param) { |
| | | return patrolService.selectList(param); |
| | | } |
| | | |
| | | public Patrol selectById( String id) { |
| | | return patrolService.selectById( id); |
| | | /** |
| | | * æ ¹æ®idæ¥è¯¢æ°æ® |
| | | * |
| | | * @param id |
| | | * @author sgj |
| | | * @date 2025/12/10 |
| | | */ |
| | | public Patrol selectById(String id) { |
| | | return patrolService.selectById(id); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢æ°æ® |
| | | * |
| | | * @param param |
| | | * @author sgj |
| | | * @date 2025/12/10 |
| | | */ |
| | | public int insertData(Patrol param) { |
| | | return patrolService.insertData(param); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹æ°æ® |
| | | * |
| | | * @param param |
| | | * @author sgj |
| | | * @date 2025/12/10 |
| | | */ |
| | | public int updateData(Patrol param) { |
| | | return patrolService.updateData(param); |
| | | } |
| | | |
| | | public void deleteDataById( String ids) { |
| | | patrolService.deleteDataById(ids); |
| | | /** |
| | | * å 餿°æ® |
| | | * |
| | | * @param ids |
| | | * @author sgj |
| | | * @date 2025/12/10 |
| | | */ |
| | | public void deleteDataById(String ids) { |
| | | patrolService.deleteDataById(ids); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.sys.manager.security; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.fzzy.igds.data.IgdsBaseParam; |
| | | import com.fzzy.igds.domain.PatrolRecord; |
| | | import com.fzzy.igds.service.PatrolRecordService; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | public class PatrolRecordManager { |
| | | |
| | | @Resource |
| | | private PatrolRecordService patrolRecordService; |
| | | |
| | | /** |
| | | * å页æ¥è¯¢æ°æ® |
| | | * |
| | | * @param param |
| | | * @return |
| | | */ |
| | | public Page<PatrolRecord> pageData(IgdsBaseParam param) { |
| | | if (StringUtils.isEmpty(param.getCompanyId())) { |
| | | param.setCompanyId(ContextUtil.getCompanyId()); |
| | | } |
| | | |
| | | Page<PatrolRecord> corePage = new Page<>(param.getPage(), param.getLimit()); |
| | | patrolRecordService.listPage(corePage, param); |
| | | |
| | | if (null == corePage.getRecords() || corePage.getRecords().isEmpty()) { |
| | | return corePage.setRecords(new ArrayList<>()); |
| | | } |
| | | |
| | | return corePage; |
| | | } |
| | | |
| | | /** |
| | | * è·åæææ°æ® |
| | | * |
| | | * @param param |
| | | * @return |
| | | */ |
| | | public List<PatrolRecord> listAll(IgdsBaseParam param) { |
| | | if (StringUtils.isEmpty(param.getCompanyId())) { |
| | | param.setCompanyId(ContextUtil.getCompanyId()); |
| | | } |
| | | |
| | | return patrolRecordService.listAll(param); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.sys.manager.security; |
| | | |
| | | import com.fzzy.igds.domain.SnapConf; |
| | | import com.fzzy.igds.service.SnapConfService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | public class SnapConfManager { |
| | | |
| | | @Resource |
| | | private SnapConfService snapConfService; |
| | | |
| | | /** |
| | | * æ¥è¯¢æ°æ® |
| | | * |
| | | * @param param æ¥è¯¢åæ° |
| | | * @return æ°æ®å表 |
| | | */ |
| | | public List<SnapConf> selectList(SnapConf param) { |
| | | return snapConfService.selectList(param); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®IDæ¥è¯¢æ°æ® |
| | | * |
| | | * @param id 主é®ID |
| | | * @return SnapConfå®ä½å¯¹è±¡ |
| | | */ |
| | | public SnapConf selectById(String id) { |
| | | return snapConfService.selectById(id); |
| | | } |
| | | |
| | | /** |
| | | * æå
¥æ°æ® |
| | | * |
| | | * @param param æ°æ®å®ä½ |
| | | * @return å½±åè¡æ° |
| | | */ |
| | | public int insertData(SnapConf param) { |
| | | return snapConfService.insertData(param); |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°æ°æ® |
| | | * |
| | | * @param param æ°æ®å®ä½ |
| | | * @return å½±åè¡æ° |
| | | */ |
| | | public int updateData(SnapConf param) { |
| | | return snapConfService.updateData(param); |
| | | } |
| | | |
| | | /** |
| | | * å 餿°æ® |
| | | * |
| | | * @param ids è¦å é¤çè®°å½IDéåï¼éå·åéï¼ |
| | | */ |
| | | public void deleteDataById(String ids) { |
| | | snapConfService.deleteDataById(ids); |
| | | } |
| | | } |
| | |
| | | String(d.getMonth() + 1).padStart(2, '0') + '-' + |
| | | String(d.getDate()).padStart(2, '0') + ' ' + |
| | | String(d.getHours()).padStart(2, '0') + ':' + |
| | | String(d.getMinutes()).padStart(2, '0') + ':' + |
| | | String(d.getSeconds()).padStart(2, '0'); |
| | | String(d.getMinutes()).padStart(2, '0') ; |
| | | } |
| | | |
| | | /** |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /* å¾çé¢è§å±æ ·å¼ */ |
| | | .img-preview { |
| | | display: none; |
| | | position: fixed; |
| | | top: 0; |
| | | left: 0; |
| | | width: 100%; |
| | | height: 100%; |
| | | background-color: rgba(0, 0, 0, 0.9); |
| | | z-index: 1000; |
| | | justify-content: center; |
| | | align-items: center; |
| | | } |
| | | |
| | | .preview-content { |
| | | max-width: 90%; |
| | | max-height: 90%; |
| | | position: relative; |
| | | } |
| | | |
| | | .preview-img { |
| | | max-width: 100%; |
| | | max-height: 90vh; |
| | | border-radius: 4px; |
| | | box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3); |
| | | } |
| | | |
| | | .close-preview { |
| | | position: absolute; |
| | | top: -40px; |
| | | right: -10px; |
| | | color: white; |
| | | font-size: 2rem; |
| | | cursor: pointer; |
| | | background: rgba(0, 0, 0, 0.5); |
| | | width: 40px; |
| | | height: 40px; |
| | | border-radius: 50%; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | transition: all 0.3s ease; |
| | | } |
| | | |
| | | .close-preview:hover { |
| | | background: rgba(255, 255, 255, 0.2); |
| | | transform: scale(1.1); |
| | | } |
| | | |
| | | /* å¾çç½æ ¼æ ·å¼ */ |
| | | .gallery-grid { |
| | | display: grid; |
| | | grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); |
| | | gap: 20px; |
| | | margin-bottom: 5px; |
| | | } |
| | | |
| | | .gallery-item { |
| | | background: white; |
| | | border-radius: 8px; |
| | | overflow: hidden; |
| | | box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); |
| | | transition: all 0.3s ease; |
| | | } |
| | | |
| | | .gallery-item:hover { |
| | | transform: translateY(-5px); |
| | | box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12); |
| | | } |
| | | |
| | | .gallery-img { |
| | | width: 100%; |
| | | height: 240px; |
| | | object-fit: cover; |
| | | cursor: pointer; |
| | | transition: all 0.3s ease; |
| | | } |
| | | |
| | | .gallery-img:hover { |
| | | opacity: 0.95; |
| | | } |
| | | |
| | | .gallery-info { |
| | | padding: 15px; |
| | | } |
| | | |
| | | .gallery-header { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | margin-bottom: 10px; |
| | | } |
| | | |
| | | .gallery-title { |
| | | font-size: 1.5rem; |
| | | font-weight: 600; |
| | | color: #333; |
| | | margin: 0; |
| | | flex: 1; |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | } |
| | | |
| | | .gallery-meta { |
| | | display: flex; |
| | | flex-direction: column; |
| | | gap: 2px; |
| | | } |
| | | |
| | | .meta-item { |
| | | display: flex; |
| | | align-items: center; |
| | | font-size: 1.3rem; |
| | | color: #666; |
| | | } |
| | | |
| | | .meta-item i { |
| | | width: 16px; |
| | | margin-right: 6px; |
| | | color: #999; |
| | | font-size: 1.25rem; |
| | | } |
| | | |
| | | .gallery-filename i { |
| | | margin-right: 5px; |
| | | font-size: 0.7rem; |
| | | } |
| | | |
| | | /* æ ç¾æ ·å¼ */ |
| | | .gallery-tags { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | margin-left: auto; |
| | | gap: 3px; |
| | | /*margin: 12px 0;*/ |
| | | } |
| | | |
| | | |
| | | /* åé¡µæ ·å¼ */ |
| | | .pagination-container { |
| | | display: flex; |
| | | justify-content: flex-end; |
| | | width: 100%; |
| | | /*margin-top: 40px;*/ |
| | | } |
| | | |
| | | /* ç©ºç¶ææ ·å¼ */ |
| | | .empty-state { |
| | | grid-column: 1 / -1; |
| | | text-align: center; |
| | | padding: 60px 20px; |
| | | color: #999; |
| | | } |
| | | |
| | | .empty-state i { |
| | | font-size: 4rem; |
| | | margin-bottom: 20px; |
| | | color: #ddd; |
| | | } |
| | | |
| | | .empty-state h3 { |
| | | font-size: 1.5rem; |
| | | margin-bottom: 10px; |
| | | color: #666; |
| | | } |
| | | |
| | | /* ååºå¼è®¾è®¡ */ |
| | | @media (max-width: 992px) { |
| | | .gallery-grid { |
| | | grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); |
| | | gap: 25px; |
| | | } |
| | | } |
| | | |
| | | @media (max-width: 768px) { |
| | | |
| | | |
| | | .main-nav li { |
| | | margin: 0 10px; |
| | | } |
| | | |
| | | .gallery-grid { |
| | | grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); |
| | | gap: 20px; |
| | | } |
| | | |
| | | .gallery-img { |
| | | height: 180px; |
| | | } |
| | | |
| | | } |
| | | |
| | | @media (max-width: 576px) { |
| | | .gallery-grid { |
| | | grid-template-columns: 1fr; |
| | | } |
| | | |
| | | .gallery-img { |
| | | height: 200px; |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | var layer; |
| | | var laypage; |
| | | |
| | | $(function () { |
| | | // åå§åå页 |
| | | layui.use(['laypage', 'layer'], function () { |
| | | layer = layui.layer; |
| | | laypage = layui.laypage; |
| | | |
| | | // åå§åå页ç»ä»¶ |
| | | initPagination(); |
| | | }); |
| | | |
| | | // åå§åå¾çé¢è§åè½ |
| | | initImagePreview(); |
| | | }); |
| | | |
| | | /** |
| | | * åå§åå页ç»ä»¶ |
| | | */ |
| | | function initPagination() { |
| | | laypage.render({ |
| | | elem: 'pagination', |
| | | count: typeof totalItems !== 'undefined' ? totalItems : 0, |
| | | limit: typeof pageSize !== 'undefined' ? pageSize : 6, |
| | | curr: typeof currentPage !== 'undefined' ? currentPage : 1, |
| | | layout: ['prev', 'page', 'next', 'refresh', 'skip'], |
| | | jump: function (obj, first) { |
| | | if (!first) { |
| | | searchRecord(obj.curr, obj.limit) |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * éæ°åå§åå页ç»ä»¶ |
| | | * @param {number} totalCount - æ»è®°å½æ° |
| | | * @param {number} pageSize - æ¯é¡µå¤§å° |
| | | * @param {number} currentPage - å½å页ç |
| | | */ |
| | | function reinitPagination(totalCount, pageSize, currentPage) { |
| | | laypage.render({ |
| | | elem: 'pagination', |
| | | count: totalCount, |
| | | limit: pageSize, |
| | | curr: currentPage, |
| | | layout: ['prev', 'page', 'next', 'refresh', 'skip'], |
| | | jump: function (obj, first) { |
| | | if (!first) { |
| | | searchRecord(obj.curr, obj.limit) |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * è·åå·¡æ£è®°å½æ°æ® |
| | | * @param {Object} params - æ¥è¯¢åæ°å¯¹è±¡ |
| | | * @param {Function} callback - åè°å½æ° |
| | | */ |
| | | function fetchPatrolRecordData(params, callback) { |
| | | $.ajax({ |
| | | url: '../../patrol/patrolRecord/pageData', |
| | | type: 'POST', |
| | | dataType: "json", |
| | | contentType: "application/json;charset=UTF-8", |
| | | data: JSON.stringify(params), |
| | | success: function (response) { |
| | | if (response.code === '0000') { |
| | | callback(null, response.data); |
| | | } else { |
| | | callback(new Error(response.msg || 'æ°æ®å 载失败'), null); |
| | | } |
| | | }, |
| | | error: function (xhr, status, error) { |
| | | callback(new Error('请æ±å¤±è´¥ï¼è¯·ç¨åéè¯'), null); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * æå»ºæ¥è¯¢åæ° |
| | | * @param {number} page - 页ç |
| | | * @param {number} size - æ¯é¡µå¤§å° |
| | | * @returns {Object} æ¥è¯¢åæ°å¯¹è±¡ |
| | | */ |
| | | function buildQueryParams(page, size) { |
| | | var params = { |
| | | page: page, |
| | | limit: size, |
| | | key: patrolId //主表idæ¥è¯¢ |
| | | }; |
| | | // æ·»å è¡¨åæ¥è¯¢æ¡ä»¶ |
| | | var form = document.getElementById('patrolRecord-form'); |
| | | if (form) { |
| | | var inputs = form.querySelectorAll('input[name], select[name]'); |
| | | inputs.forEach(function(input) { |
| | | if (input.value) { // åªæ·»å éç©ºå¼ |
| | | params[input.name] = input.value; |
| | | } |
| | | }); |
| | | } |
| | | |
| | | return params; |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°å·¡æ£è®°å½ç»å»å
容 |
| | | * @param {Array} records - å·¡æ£è®°å½æ°æ® |
| | | */ |
| | | function updateGallery(records) { |
| | | var container = document.getElementById('gallery-container'); |
| | | if (!container) return; |
| | | |
| | | // æ¸
ç©ºç°æå
容 |
| | | container.innerHTML = ''; |
| | | |
| | | if (!records || records.length === 0) { |
| | | // æ¾ç¤ºç©ºç¶æ |
| | | container.innerHTML = ` |
| | | <div class="empty-state"> |
| | | <i class="fa-solid fa-clipboard-list"></i> |
| | | <h3>ææ å·¡æ£è®°å½</h3> |
| | | <p>å½å没æå¯å±ç¤ºçå·¡æ£è®°å½æ°æ®</p> |
| | | </div> |
| | | `; |
| | | // éèå页 |
| | | $('.pagination-container').hide(); |
| | | return; |
| | | } |
| | | |
| | | // æ¾ç¤ºå页 |
| | | $('.pagination-container').show(); |
| | | |
| | | // çæå·¡æ£è®°å½å¡ç |
| | | var html = ''; |
| | | records.forEach(function(record) { |
| | | html += ` |
| | | <div class="gallery-item"> |
| | | <img src="${record.imgName || '/logo-sm.png'}" alt="${record.id}" |
| | | data-url="${record.imgName || '/logo-sm.png'}" data-id="${record.id}" |
| | | class="gallery-img" onclick="showPatrolRecordPreview(this.getAttribute('data-url'))"> |
| | | <div class="gallery-info"> |
| | | <div class="gallery-header"> |
| | | <h3 class="gallery-title">${record.pointName || record.id}</h3> |
| | | <!-- |
| | | <div class="gallery-tags"> |
| | | <span class="tag-person"> |
| | | <i class="layui-icon layui-icon-user"></i> |
| | | <span>'æªç¥'</span> |
| | | </span> |
| | | </div> |
| | | --> |
| | | </div> |
| | | <div class="gallery-meta"> |
| | | <div style="display: flex; align-items: center; gap: 15px;width: 100%"> |
| | | <div class="meta-item" style="width: 50%"> |
| | | <i class="layui-icon layui-icon-location"></i> |
| | | <span>${record.longitude || ''}</span> |
| | | </div> |
| | | <div class="meta-item"> |
| | | <i class="layui-icon layui-icon-location"></i> |
| | | <span>${record.latitude || ''}</span> |
| | | </div> |
| | | </div> |
| | | <div class="meta-item" style="width: 50%"> |
| | | <i class="layui-icon layui-icon-date"></i> |
| | | <span>${formatDate(record.createTime)}</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | `; |
| | | }); |
| | | |
| | | container.innerHTML = html; |
| | | } |
| | | |
| | | /** |
| | | * æ ¼å¼åæ¥æ |
| | | * @param {string|number} date - æ¥æåç¬¦ä¸²ææ¶é´æ³ |
| | | */ |
| | | function formatDate(date) { |
| | | if (!date) return ''; |
| | | var d = new Date(date); |
| | | return d.getFullYear() + '-' + |
| | | String(d.getMonth() + 1).padStart(2, '0') + '-' + |
| | | String(d.getDate()).padStart(2, '0') + ' ' + |
| | | String(d.getHours()).padStart(2, '0') + ':' + |
| | | String(d.getMinutes()).padStart(2, '0') ; |
| | | } |
| | | |
| | | /** |
| | | * åå§åå¾çé¢è§åè½ |
| | | */ |
| | | function initImagePreview() { |
| | | var preview = document.getElementById('imgPreview'); |
| | | var previewImg = document.getElementById('previewImg'); |
| | | var closeBtn = document.getElementById('closePreview'); |
| | | |
| | | // 妿é¢è§å
ç´ ä¸åå¨ï¼åä¸åå§å |
| | | if (!preview || !previewImg) { |
| | | return; |
| | | } |
| | | |
| | | // å
³éæé®ç¹å»äºä»¶ |
| | | if (closeBtn) { |
| | | closeBtn.addEventListener('click', closePreview); |
| | | } |
| | | |
| | | // ç¹å»é¢è§åºåå¤å
³é |
| | | preview.addEventListener('click', function (e) { |
| | | if (e.target === preview) { |
| | | closePreview(); |
| | | } |
| | | }); |
| | | |
| | | // é®çäºä»¶çå¬ |
| | | document.addEventListener('keydown', function (e) { |
| | | if (e.key === 'Escape' && preview.style.display === 'flex') { |
| | | closePreview(); |
| | | } |
| | | }); |
| | | |
| | | // å
³éé¢è§å½æ° |
| | | function closePreview() { |
| | | preview.style.display = 'none'; |
| | | previewImg.src = ''; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ¾ç¤ºå¾çé¢è§ |
| | | * @param {string} imgUrl å¾çURL |
| | | */ |
| | | function showPatrolRecordPreview(imgUrl) { |
| | | var preview = document.getElementById('imgPreview'); |
| | | var previewImg = document.getElementById('previewImg'); |
| | | |
| | | if (preview && previewImg) { |
| | | previewImg.src = imgUrl; |
| | | preview.style.display = 'flex'; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 读åå·¡æ£è®°å½ |
| | | */ |
| | | function searchRecord(page , size) { |
| | | var pageNumber = 1; |
| | | var sizeNumber = 6; |
| | | if (pageSize && pageSize > 0){ |
| | | size = pageSize; |
| | | } |
| | | |
| | | if (size && size > 0){ |
| | | sizeNumber = size; |
| | | } |
| | | if (page && page > 0){ |
| | | pageNumber = page; |
| | | } |
| | | // æé æ¥è¯¢åæ°ï¼ä»ç¬¬ä¸é¡µå¼å§ |
| | | var queryParams = buildQueryParams(pageNumber, sizeNumber); |
| | | // æ¾ç¤ºloading |
| | | var loadingIndex = layer.load(1, {shade: [0.1, '#fff']}); |
| | | // è°ç¨æ°æ®è¯·æ±æ¹æ³ |
| | | fetchPatrolRecordData(queryParams, function(error, data) { |
| | | // å
³éloading |
| | | layer.close(loadingIndex); |
| | | if (error) { |
| | | layer.msg(error.message); |
| | | return; |
| | | } |
| | | |
| | | // æ´æ°é¡µé¢æ°æ® |
| | | updateGallery(data.records); |
| | | // éæ°åå§åå页ç»ä»¶ |
| | | reinitPagination(data.total, data.size, data.current); |
| | | }); |
| | | } |
| | |
| | | String(d.getMonth() + 1).padStart(2, '0') + '-' + |
| | | String(d.getDate()).padStart(2, '0') + ' ' + |
| | | String(d.getHours()).padStart(2, '0') + ':' + |
| | | String(d.getMinutes()).padStart(2, '0') + ':' + |
| | | String(d.getSeconds()).padStart(2, '0'); |
| | | String(d.getMinutes()).padStart(2, '0') |
| | | // + ':' + |
| | | // String(d.getSeconds()).padStart(2, '0'); |
| | | } |
| | | |
| | | /** |
| | |
| | | }); |
| | | } |
| | | function openConf() { |
| | | var url = ctx + "com.fzzy.igds.SnapConf.d"; |
| | | var url = ctx + "security/snap/snapConf"; |
| | | $.modal.openTab("ææé
ç½®", url); |
| | | } |
| | |
| | | </div> |
| | | <div class="meta-item" style="width: 50%"> |
| | | <i class="layui-icon layui-icon-date"></i> |
| | | <span th:text="${#dates.format(eventInfo.time, 'yyyy-MM-dd HH:mm:ss')}"></span> |
| | | <span th:text="${#dates.format(eventInfo.time, 'yyyy-MM-dd HH:mm')}"></span> |
| | | </div> |
| | | </div> |
| | | <div class="meta-item"> |
| | |
| | | var actions = []; |
| | | actions.push('<a class="btn btn-success btn-xs ' + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>ç¼è¾</a> '); |
| | | actions.push('<a class="btn btn-danger btn-xs ' + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>å é¤</a>'); |
| | | actions.push('<a class="btn btn-info btn-xs ' + '" href="javascript:void(0)" onclick="patrolDetail(\'' + row.id + '\')"><i class="fa fa-list-ul"></i>详æ
</a> '); |
| | | return actions.join(''); |
| | | } |
| | | }] |
| | |
| | | $.table.init(options); |
| | | }); |
| | | |
| | | /*详æ
*/ |
| | | function patrolDetail(patrolId) { |
| | | var url = prefix + '/patrolRecord/' + patrolId; |
| | | $.modal.openTab("å·¡æ´è¯¦æ
", url); |
| | | } |
| | | |
| | | function openPatrolConf() { |
| | | var url = ctx + "security/patrol/patrolConf"; |
| | | $.modal.openTab("å·¡æ´é
ç½®", url); |
| | |
| | | </div> |
| | | |
| | | <div class="btn-group-sm" id="toolbar" role="group"> |
| | | <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="web:security:patrol:patrolConf:add"> |
| | | <a class="btn btn-success" onclick="$.operate.add()" > |
| | | <i class="fa fa-plus"></i> æ°å¢ |
| | | </a> |
| | | <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="web:security:patrol:patrolConf:edit"> |
| | | <a class="btn btn-primary single disabled" onclick="$.operate.edit()" > |
| | | <i class="fa fa-edit"></i> ä¿®æ¹ |
| | | </a> |
| | | <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="web:security:patrol:patrolConf:remove"> |
| | | <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" > |
| | | <i class="fa fa-remove"></i> å é¤ |
| | | </a> |
| | | <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="web:security:patrol:patrolConf:export"> |
| | | <a class="btn btn-warning" onclick="$.table.exportExcel()" > |
| | | <i class="fa fa-download"></i> å¯¼åº |
| | | </a> |
| | | </div> |
| | |
| | | <th:block th:include="include :: footer" /> |
| | | <th:block th:include="include :: select2-js" /> |
| | | <script th:inline="javascript"> |
| | | var editFlag = [[${@permission.hasPermi('web:security:patrol:patrolConf:edit')}]]; |
| | | var removeFlag = [[${@permission.hasPermi('web:security:patrol:patrolConf:remove')}]]; |
| | | var prefix = ctx + "security/patrol/patrolConf"; |
| | | |
| | | $(function() { |
| | |
| | | align: 'center', |
| | | formatter: function(value, row, index) { |
| | | var actions = []; |
| | | actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.batchId + '\')"><i class="fa fa-edit"></i>ç¼è¾</a> '); |
| | | actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.batchId + '\')"><i class="fa fa-remove"></i>å é¤</a>'); |
| | | actions.push('<a class="btn btn-success btn-xs ' + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.batchId + '\')"><i class="fa fa-edit"></i>ç¼è¾</a> '); |
| | | actions.push('<a class="btn btn-danger btn-xs ' + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.batchId + '\')"><i class="fa fa-remove"></i>å é¤</a>'); |
| | | return actions.join(''); |
| | | } |
| | | }] |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> |
| | | <head> |
| | | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="renderer" content="webkit"> |
| | | <th:block th:include="include :: header('å·¡æ´è®°å½')"/> |
| | | <link rel="stylesheet" type="text/css" th:href="@{/ajax/libs/layui-ruoyi/css/layui.css}"/> |
| | | <link rel="stylesheet" th:href="@{/security/patrol/patrolRecord-style.css}"> |
| | | </head> |
| | | <body class="gray-bg"> |
| | | <div class="container-div"> |
| | | <div class="row"> |
| | | <div class="col-sm-12 search-collapse" |
| | | style="display: flex; justify-content: space-between; align-items: center;"> |
| | | <form id="patrolRecord-form"> |
| | | <div class="select-list"> |
| | | <ul> |
| | | <li> |
| | | å·¡æ´ç¹ï¼<input type="text" name="name"/> |
| | | </li> |
| | | <li> |
| | | <a class="btn btn-primary btn-rounded btn-sm" onclick="searchRecord()"><i |
| | | class="fa fa-search"></i> æç´¢</a> |
| | | <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i |
| | | class="fa fa-refresh"></i> éç½®</a> |
| | | </li> |
| | | </ul> |
| | | </div> |
| | | </form> |
| | | <div class="btn-group-sm" role="group"> |
| | | <!-- 妿éè¦æ·»å æé®å¯ä»¥æ¾å¨è¿é --> |
| | | <a class="btn btn-success" onclick="openTrajectoryMap()" > |
| | | <i class="fa fa-search"></i> è½¨è¿¹å¾æ¥ç |
| | | </a> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <div class="col-sm-12 " style="padding-top: 10px;"> |
| | | <!-- å·¡æ£è®°å½ç½æ ¼ --> |
| | | <div class="gallery-grid" id="gallery-container"> |
| | | <!-- è®°å½ä¸ºç©ºæ¶æ¾ç¤º --> |
| | | <div th:if="${#lists.isEmpty(patrolRecordList)}" class="empty-state"> |
| | | <i class="fa-solid fa-clipboard-list"></i> |
| | | <h3>ææ å·¡æ£è®°å½</h3> |
| | | <p>å½å没æå¯å±ç¤ºçå·¡æ£è®°å½æ°æ®</p> |
| | | </div> |
| | | <!-- è®°å½å¡ç --> |
| | | <div th:each="patrolRecord : ${patrolRecordList}" class="gallery-item"> |
| | | <img th:src="${patrolRecord.imgName ?: '/logo-sm.png'}" th:alt="${patrolRecord.id}" |
| | | th:data-url="${patrolRecord.imgName ?: '/logo-sm.png'}" th:data-id="${patrolRecord.id}" |
| | | class="gallery-img" onclick="showPatrolRecordPreview(this.getAttribute('data-url'))"> |
| | | <div class="gallery-info"> |
| | | <div class="gallery-header"> |
| | | <h3 class="gallery-title" th:text="${patrolRecord.pointName ?: patrolRecord.id}"></h3> |
| | | <!-- æ ç¾å表 --> |
| | | <!-- <div class="gallery-tags">--> |
| | | <!-- <span class="tag-person">--> |
| | | <!-- <i class="layui-icon layui-icon-user"></i>--> |
| | | <!-- <span th:text="'æªç¥'"></span>--> |
| | | <!-- </span>--> |
| | | <!-- </div>--> |
| | | </div> |
| | | |
| | | <div class="gallery-meta"> |
| | | <div style="display: flex; align-items: center; gap: 15px;width: 100%"> |
| | | <div class="meta-item" style="width: 50%"> |
| | | <i class="layui-icon layui-icon-location"></i> |
| | | <span th:text="${patrolRecord.longitude ?: ''}"></span> |
| | | </div> |
| | | <div class="meta-item" style="width: 50%"> |
| | | <i class="layui-icon layui-icon-location"></i> |
| | | <span th:text="${patrolRecord.latitude ?: ''}"></span> |
| | | </div> |
| | | </div> |
| | | <div class="meta-item" > |
| | | <i class="layui-icon layui-icon-date"></i> |
| | | <span th:text="${#dates.format(patrolRecord.createTime, 'yyyy-MM-dd HH:mm')}"></span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- å页æ§ä»¶ --> |
| | | <div class="pagination-container" th:if="${not #lists.isEmpty(patrolRecordList)}"> |
| | | <div id="pagination"></div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <!-- å¾çé¢è§å± --> |
| | | <div class="img-preview" id="imgPreview"> |
| | | <div class="preview-content"> |
| | | <img src="" alt="é¢è§å¾ç" class="preview-img" id="previewImg"> |
| | | <div class="close-preview" id="closePreview"> |
| | | <i class="layui-icon layui-icon-clear"></i> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <th:block th:include="include :: footer"/> |
| | | <script th:src="@{/ajax/libs/layui-ruoyi/layui.js}"></script> |
| | | <script th:src="@{/security/patrol/patrolRecord.js}"></script> |
| | | <script th:inline="javascript"> |
| | | var prefix = ctx + "security/patrol/patrolRecord"; |
| | | |
| | | var currentPage = [[${currentPage}]]; |
| | | var totalItems = [[${totalItems}]]; |
| | | var pageSize = [[${pageSize}]]; |
| | | var patrolId = [[${patrolId}]]; |
| | | |
| | | function openTrajectoryMap() { |
| | | var url = prefix + '/trajectoryMap/'+patrolId ; |
| | | var options = { |
| | | title: "轨迹å¾", |
| | | width: 500, |
| | | height: 500, |
| | | url: url, |
| | | btn: 0, |
| | | yes: function (index, layero) { |
| | | $.modal.close(index); |
| | | } |
| | | }; |
| | | $.modal.openOptions(options); |
| | | } |
| | | </script> |
| | | |
| | | </body> |
| | | </html> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="zh-CN" xmlns:th="http://www.thymeleaf.org"> |
| | | <head> |
| | | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="renderer" content="webkit"> |
| | | <th:block th:include="include :: header('轨迹å¾å±ç¤º')"/> |
| | | <!-- ç¾åº¦å°å¾API --> |
| | | <script type="text/javascript" src="https://api.map.baidu.com/api?v=1.0&type=webgl&ak=R3FfyIEbBAWNckTqRSopHQktdkgp924F"></script> |
| | | </head> |
| | | <body> |
| | | <!-- å°å¾å®¹å¨ --> |
| | | <div class="container-div" id="map-container"> |
| | | </div> |
| | | <th:block th:include="include :: footer"/> |
| | | <script th:inline="javascript"> |
| | | // 1. è·ååç«¯ä¼ éçè½¨è¿¹æ°æ® |
| | | const trackPoints = [[${trackPoints}]]; |
| | | // 转æ¢ä¸ºç¾åº¦å°å¾åæ æ°ç» |
| | | const path = trackPoints.map(point => new BMapGL.Point(point.longitude, point.latitude)); |
| | | |
| | | // 2. åå§åå°å¾ |
| | | function initMap() { |
| | | // å建å°å¾å®ä¾ï¼ä¸å¿ç¹è®¾ä¸ºç¬¬ä¸ä¸ªè½¨è¿¹ç¹ |
| | | const map = new BMapGL.Map("map-container"); |
| | | const centerPoint = path[0] || new BMapGL.Point(116.404, 39.915); |
| | | map.centerAndZoom(centerPoint, 14); // 14为å°å¾ç¼©æ¾çº§å« |
| | | map.enableScrollWheelZoom(true); // å¼å¯é¼ æ æ»è½®ç¼©æ¾ |
| | | |
| | | // 3. æ·»å 轨迹线 |
| | | const polyline = new BMapGL.Polyline(path, { |
| | | strokeColor: "#3388ff", // 线é¢è² |
| | | strokeWeight: 5, // 线宽度 |
| | | strokeOpacity: 0.8 // 线éæåº¦ |
| | | }); |
| | | map.addOverlay(polyline); |
| | | |
| | | // 4. 为æ¯ä¸ªè½¨è¿¹ç¹æ·»å æ è®°åä¿¡æ¯çªå£ |
| | | trackPoints.forEach((point, index) => { |
| | | const markerPoint = new BMapGL.Point(point.longitude, point.latitude); |
| | | // å建æ è®° |
| | | const marker = new BMapGL.Marker(markerPoint); |
| | | map.addOverlay(marker); |
| | | |
| | | // å建信æ¯çªå£å
容 |
| | | const infoWindow = new BMapGL.InfoWindow(` |
| | | <div style="font-size:14px;"> |
| | | <p>åºå·ï¼${index + 1}</p> |
| | | <p>ç»åº¦ï¼${point.longitude}</p> |
| | | <p>纬度ï¼${point.latitude}</p> |
| | | <p>æ¶é´ï¼${point.createTime}</p> |
| | | </div> |
| | | `); |
| | | |
| | | // ç¹å»æ è®°æ¾ç¤ºä¿¡æ¯çªå£ |
| | | marker.addEventListener("click", () => { |
| | | map.openInfoWindow(infoWindow, markerPoint); |
| | | }); |
| | | }); |
| | | |
| | | // 5. è°æ´å°å¾è§é以æ¾ç¤ºæ´ä¸ªè½¨è¿¹ |
| | | if (path.length > 1) { |
| | | map.setViewport(path); // èªå¨éé
轨迹èå´ |
| | | } |
| | | } |
| | | |
| | | // 页é¢å è½½å®æååå§åå°å¾ |
| | | window.onload = initMap; |
| | | </script> |
| | | </body> |
| | | </html> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="zh" xmlns:th="http://www.thymeleaf.org"> |
| | | <head> |
| | | <th:block th:include="include :: header('æ°å¢ææé
ç½®')"/> |
| | | <th:block th:include="include :: select2-css"/> |
| | | </head> |
| | | <body> |
| | | <div class="main-content"> |
| | | <form id="form-snap-add" class="form-horizontal"> |
| | | <input name="deptId" type="hidden" id="treeId"/> |
| | | |
| | | <div class="row"> |
| | | <div class="col-sm-6"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-4 control-label">æå±åºåºï¼</label> |
| | | <div class="col-sm-8"> |
| | | <input name="deptId" id="deptId" placeholder="请è¾å
¥æå±åºåº" class="form-control" type="text" |
| | | maxlength="40"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-6"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-4 control-label">ææçæ§ï¼</label> |
| | | <div class="col-sm-8"> |
| | | <input name="cameraId" id="cameraId" placeholder="请è¾å
¥ææçæ§ID" class="form-control" type="text" |
| | | maxlength="40"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="row"> |
| | | <div class="col-sm-6"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-4 control-label">æ§è¡æ¶é´1ï¼å°æ¶ï¼ï¼</label> |
| | | <div class="col-sm-8"> |
| | | <input name="actHour1" id="actHour1" placeholder="请è¾å
¥æ§è¡æ¶é´1" class="form-control" type="number" |
| | | min="0" max="23"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-6"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-4 control-label">æ§è¡æ¶é´2ï¼å°æ¶ï¼ï¼</label> |
| | | <div class="col-sm-8"> |
| | | <input name="actHour2" id="actHour2" placeholder="请è¾å
¥æ§è¡æ¶é´2" class="form-control" type="number" |
| | | min="0" max="23"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="row"> |
| | | <div class="col-sm-6"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-4 control-label">æ§è¡æ¶é´3ï¼å°æ¶ï¼ï¼</label> |
| | | <div class="col-sm-8"> |
| | | <input name="actHour3" id="actHour3" placeholder="请è¾å
¥æ§è¡æ¶é´3" class="form-control" type="number" |
| | | min="0" max="23"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </form> |
| | | </div> |
| | | <th:block th:include="include :: footer"/> |
| | | <th:block th:include="include :: select2-js"/> |
| | | <script> |
| | | var prefix = ctx + "security/snap/snapConf"; |
| | | |
| | | $("#form-snap-add").validate({ |
| | | onkeyup: false, |
| | | rules: {}, |
| | | messages: {}, |
| | | focusCleanup: true |
| | | }); |
| | | |
| | | // ç¡®å®æé® æäº¤æ°æ® |
| | | function submitHandler() { |
| | | if ($.validate.form()) { |
| | | $.operate.save(prefix + "/add", $('#form-snap-add').serialize()); |
| | | } |
| | | } |
| | | </script> |
| | | </body> |
| | | </html> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="zh" xmlns:th="http://www.thymeleaf.org"> |
| | | <head> |
| | | <th:block th:include="include :: header('ä¿®æ¹ææé
ç½®')"/> |
| | | <th:block th:include="include :: select2-css"/> |
| | | </head> |
| | | <body class="white-bg"> |
| | | <div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
| | | <form class="form-horizontal m" id="form-snap-edit" th:object="${snapConf}"> |
| | | <input id="id" name="id" th:field="*{id}" type="hidden"> |
| | | <div class="row"> |
| | | <div class="col-sm-6"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-4 control-label">æå±åºåºï¼</label> |
| | | <div class="col-sm-8"> |
| | | <input name="deptId" id="deptId" th:field="*{deptId}" placeholder="请è¾å
¥æå±åºåº" class="form-control" |
| | | type="text" maxlength="40"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-6"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-4 control-label">ææçæ§ï¼</label> |
| | | <div class="col-sm-8"> |
| | | <input name="cameraId" id="cameraId" th:field="*{cameraId}" placeholder="请è¾å
¥ææçæ§ID" class="form-control" |
| | | type="text" maxlength="40"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="row"> |
| | | <div class="col-sm-6"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-4 control-label">æ§è¡æ¶é´1ï¼å°æ¶ï¼ï¼</label> |
| | | <div class="col-sm-8"> |
| | | <input name="actHour1" id="actHour1" th:field="*{actHour1}" placeholder="请è¾å
¥æ§è¡æ¶é´1" class="form-control" |
| | | type="number" min="0" max="23"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-6"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-4 control-label">æ§è¡æ¶é´2ï¼å°æ¶ï¼ï¼</label> |
| | | <div class="col-sm-8"> |
| | | <input name="actHour2" id="actHour2" th:field="*{actHour2}" placeholder="请è¾å
¥æ§è¡æ¶é´2" class="form-control" |
| | | type="number" min="0" max="23"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="row"> |
| | | <div class="col-sm-6"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-4 control-label">æ§è¡æ¶é´3ï¼å°æ¶ï¼ï¼</label> |
| | | <div class="col-sm-8"> |
| | | <input name="actHour3" id="actHour3" th:field="*{actHour3}" placeholder="请è¾å
¥æ§è¡æ¶é´3" class="form-control" |
| | | type="number" min="0" max="23"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </form> |
| | | </div> |
| | | <th:block th:include="include :: footer"/> |
| | | <th:block th:include="include :: select2-js"/> |
| | | <script type="text/javascript"> |
| | | var prefix = ctx + "security/snap/snapConf"; |
| | | |
| | | $("#form-snap-edit").validate({ |
| | | onkeyup: false, |
| | | rules: {}, |
| | | messages: {}, |
| | | focusCleanup: true |
| | | }); |
| | | |
| | | function submitHandler() { |
| | | if ($.validate.form()) { |
| | | $.operate.save(prefix + "/edit", $('#form-snap-edit').serialize()); |
| | | } |
| | | } |
| | | </script> |
| | | </body> |
| | | </html> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> |
| | | <head> |
| | | <th:block th:include="include :: header('å¿«æé
ç½®å表')" /> |
| | | <th:block th:include="include :: select2-css" /> |
| | | </head> |
| | | <body class="gray-bg"> |
| | | <div class="container-div"> |
| | | <div class="row"> |
| | | <div class="col-sm-12 search-collapse"> |
| | | <form id="property-form"> |
| | | <div class="select-list"> |
| | | <ul> |
| | | <li> |
| | | åç§°ï¼<input type="text" name="name"/> |
| | | </li> |
| | | <li> |
| | | <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> æç´¢</a> |
| | | <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> éç½®</a> |
| | | </li> |
| | | </ul> |
| | | </div> |
| | | </form> |
| | | </div> |
| | | |
| | | <div class="btn-group-sm" id="toolbar" role="group"> |
| | | <a class="btn btn-success" onclick="$.operate.add()" > |
| | | <i class="fa fa-plus"></i> æ°å¢ |
| | | </a> |
| | | <a class="btn btn-primary single disabled" onclick="$.operate.edit()" > |
| | | <i class="fa fa-edit"></i> ä¿®æ¹ |
| | | </a> |
| | | <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" > |
| | | <i class="fa fa-remove"></i> å é¤ |
| | | </a> |
| | | <a class="btn btn-warning" onclick="$.table.exportExcel()" > |
| | | <i class="fa fa-download"></i> å¯¼åº |
| | | </a> |
| | | </div> |
| | | <div class="col-sm-12 select-table table-striped"> |
| | | <table id="bootstrap-table"></table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <th:block th:include="include :: footer" /> |
| | | <th:block th:include="include :: select2-js" /> |
| | | <script th:inline="javascript"> |
| | | var prefix = ctx + "security/snap/snapConf"; |
| | | |
| | | $(function() { |
| | | var options = { |
| | | url: prefix + "/list", |
| | | createUrl: prefix + "/add", |
| | | updateUrl: prefix + "/edit/{id}", |
| | | removeUrl: prefix + "/remove", |
| | | exportUrl: prefix + "/export", |
| | | sortName: "id", |
| | | sortOrder: "asc", |
| | | modalName: "ææé
ç½®", |
| | | columns: [{ |
| | | checkbox: true |
| | | }, |
| | | { |
| | | field: 'id', |
| | | title: '主é®', |
| | | visible: false, |
| | | }, |
| | | { |
| | | field: 'deptId', |
| | | title: 'æå±åºåº', |
| | | align: 'left', |
| | | }, |
| | | { |
| | | field: 'cameraId', |
| | | title: 'ææçæ§', |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | align: 'center', |
| | | formatter: function(value, row, index) { |
| | | var actions = []; |
| | | actions.push('<a class="btn btn-success btn-xs ' + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>ç¼è¾</a> '); |
| | | actions.push('<a class="btn btn-danger btn-xs ' + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>å é¤</a>'); |
| | | return actions.join(''); |
| | | } |
| | | }] |
| | | }; |
| | | $.table.init(options); |
| | | }); |
| | | </script> |
| | | </body> |
| | | </html> |
| | |
| | | </div> |
| | | </form> |
| | | <div class="btn-group-sm" role="group"> |
| | | <a class="btn btn-success" onclick="openConf()" shiro:hasPermission="web:security:snap:snapRecord:view"> |
| | | <a class="btn btn-success" onclick="openConf()"> |
| | | <i class="fa fa-plus"></i> ææé
ç½® |
| | | </a> |
| | | </div> |
| | |
| | | </div> |
| | | <div class="meta-item" style="width: 50%"> |
| | | <i class="layui-icon layui-icon-date"></i> |
| | | <span th:text="${#dates.format(snapRecord.snapTime, 'yyyy-MM-dd HH:mm:ss')}"></span> |
| | | <span th:text="${#dates.format(snapRecord.snapTime, 'yyyy-MM-dd HH:mm')}"></span> |
| | | </div> |
| | | </div> |
| | | <div class="meta-item"> |