41 changed files with 2266 additions and 3 deletions
@ -0,0 +1,29 @@ |
|||
/** |
|||
* Copyright (c) 2018 人人开源 All rights reserved. |
|||
* <p> |
|||
* https://www.renren.io
|
|||
* <p> |
|||
* 版权所有,侵权必究! |
|||
*/ |
|||
|
|||
package com.epmet.plugin.commons.redis; |
|||
|
|||
/** |
|||
* @author Mark sunlightcs@gmail.com |
|||
* @since 1.0.0 |
|||
*/ |
|||
public class RedisKeys { |
|||
|
|||
/** |
|||
* redis前缀 |
|||
*/ |
|||
private static String rootPrefix = "epmet:"; |
|||
|
|||
/** |
|||
* 海康accessToken |
|||
*/ |
|||
public static String getHikTokenKey() { |
|||
return "hik:token"; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,94 @@ |
|||
package com.epmet.plugin.power.dto.hik; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* 海康社区信息 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-05-20 |
|||
*/ |
|||
@Data |
|||
public class HikCommunityInfoDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 删除标记 0:未删除,1:已删除 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 社区ID |
|||
*/ |
|||
private String communityId; |
|||
|
|||
/** |
|||
* 社区名称 |
|||
*/ |
|||
private String communityName; |
|||
|
|||
/** |
|||
* 省代号 |
|||
*/ |
|||
private String provinceCode; |
|||
|
|||
/** |
|||
* 市代号 |
|||
*/ |
|||
private String cityCode; |
|||
|
|||
/** |
|||
* 区代号 |
|||
*/ |
|||
private String countyCode; |
|||
|
|||
/** |
|||
* 经度坐标值 |
|||
*/ |
|||
private String longitude; |
|||
|
|||
/** |
|||
* 维度坐标值 |
|||
*/ |
|||
private String latitude; |
|||
|
|||
} |
@ -0,0 +1,94 @@ |
|||
package com.epmet.plugin.power.dto.hik; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* 海康设备信息 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-05-20 |
|||
*/ |
|||
@Data |
|||
public class HikDeviceInfoDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 删除标记 0:未删除,1:已删除 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 社区ID |
|||
*/ |
|||
private String communityId; |
|||
|
|||
/** |
|||
* 设备ID |
|||
*/ |
|||
private String deviceId; |
|||
|
|||
/** |
|||
* 设备名称 |
|||
*/ |
|||
private String deviceName; |
|||
|
|||
/** |
|||
* 设备型号 |
|||
*/ |
|||
private String deviceModel; |
|||
|
|||
/** |
|||
* 设备序列号 |
|||
*/ |
|||
private String deviceSerial; |
|||
|
|||
/** |
|||
* 设备状态,0:离线,1:在线 |
|||
*/ |
|||
private String deviceStatus; |
|||
|
|||
/** |
|||
* 设备路径 |
|||
*/ |
|||
private String devicePath; |
|||
|
|||
} |
@ -0,0 +1,79 @@ |
|||
package com.epmet.plugin.power.dto.hik; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* 海康设备推送失败信息 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-05-23 |
|||
*/ |
|||
@Data |
|||
public class HikErrorInfoDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 删除标记 0:未删除,1:已删除 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 身份证号 |
|||
*/ |
|||
private String idCard; |
|||
|
|||
/** |
|||
* 错误类型 0:token,1:人员,2权限 |
|||
*/ |
|||
private String errorType; |
|||
|
|||
/** |
|||
* 错误详情 |
|||
*/ |
|||
private String errorInfo; |
|||
|
|||
/** |
|||
* 引用ID |
|||
*/ |
|||
private String referenceId; |
|||
|
|||
} |
@ -0,0 +1,27 @@ |
|||
package com.epmet.plugin.power.dto.hik.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
|
|||
/** |
|||
* 海康社区人员权限信息下放 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-05-20 |
|||
*/ |
|||
@Data |
|||
public class HikAuthorityFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
private String communityId; |
|||
|
|||
private String personId; |
|||
|
|||
private Integer personType; |
|||
|
|||
private String deviceId; |
|||
|
|||
} |
@ -0,0 +1,33 @@ |
|||
package com.epmet.plugin.power.dto.hik.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
|
|||
/** |
|||
* 海康社区人员信息下放 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-05-20 |
|||
*/ |
|||
@Data |
|||
public class HikPersonFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
private String unionId; |
|||
|
|||
private String personName; |
|||
|
|||
private Integer gender; |
|||
|
|||
private Integer credentialType; |
|||
|
|||
private String credentialNumber; |
|||
|
|||
private String mobile; |
|||
|
|||
private String faceUrl; |
|||
|
|||
} |
@ -0,0 +1,54 @@ |
|||
package com.epmet.plugin.power.config; |
|||
|
|||
import org.springframework.boot.context.properties.ConfigurationProperties; |
|||
import org.springframework.context.annotation.Configuration; |
|||
|
|||
/** |
|||
* 海康设备参数 |
|||
* |
|||
* @author zhy |
|||
* @date 2022/5/20 14:59 |
|||
*/ |
|||
@Configuration |
|||
@ConfigurationProperties(prefix = "hik.cloud") |
|||
public class HikCloudProperties { |
|||
|
|||
/** |
|||
* 应用ID |
|||
*/ |
|||
private String url; |
|||
|
|||
/** |
|||
* 应用KEY |
|||
*/ |
|||
private String client; |
|||
|
|||
/** |
|||
* 生成AccessToken密钥 |
|||
*/ |
|||
private String secret; |
|||
|
|||
public String getUrl() { |
|||
return url; |
|||
} |
|||
|
|||
public void setUrl(String url) { |
|||
this.url = url; |
|||
} |
|||
|
|||
public String getClient() { |
|||
return client; |
|||
} |
|||
|
|||
public void setClient(String client) { |
|||
this.client = client; |
|||
} |
|||
|
|||
public String getSecret() { |
|||
return secret; |
|||
} |
|||
|
|||
public void setSecret(String secret) { |
|||
this.secret = secret; |
|||
} |
|||
} |
@ -0,0 +1,94 @@ |
|||
package com.epmet.plugin.power.modules.hik.controller; |
|||
|
|||
import com.epmet.commons.tools.aop.NoRepeatSubmit; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.utils.ExcelUtils; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.commons.tools.validator.AssertUtils; |
|||
import com.epmet.commons.tools.validator.ValidatorUtils; |
|||
import com.epmet.commons.tools.validator.group.AddGroup; |
|||
import com.epmet.commons.tools.validator.group.UpdateGroup; |
|||
import com.epmet.commons.tools.validator.group.DefaultGroup; |
|||
import com.epmet.plugin.power.dto.hik.HikCommunityInfoDTO; |
|||
import com.epmet.plugin.power.modules.hik.excel.HikCommunityInfoExcel; |
|||
import com.epmet.plugin.power.modules.hik.service.HikCommunityInfoService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
|
|||
/** |
|||
* 海康社区信息 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-05-20 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("hikCommunityInfo") |
|||
public class HikCommunityInfoController { |
|||
|
|||
@Autowired |
|||
private HikCommunityInfoService hikCommunityInfoService; |
|||
|
|||
@RequestMapping("page") |
|||
public Result<PageData<HikCommunityInfoDTO>> page(@RequestParam Map<String, Object> params){ |
|||
PageData<HikCommunityInfoDTO> page = hikCommunityInfoService.page(params); |
|||
return new Result<PageData<HikCommunityInfoDTO>>().ok(page); |
|||
} |
|||
|
|||
@RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) |
|||
public Result<HikCommunityInfoDTO> get(@PathVariable("id") String id){ |
|||
HikCommunityInfoDTO data = hikCommunityInfoService.get(id); |
|||
return new Result<HikCommunityInfoDTO>().ok(data); |
|||
} |
|||
|
|||
@NoRepeatSubmit |
|||
@PostMapping("save") |
|||
public Result save(@RequestBody HikCommunityInfoDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
hikCommunityInfoService.save(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@NoRepeatSubmit |
|||
@PostMapping("update") |
|||
public Result update(@RequestBody HikCommunityInfoDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
hikCommunityInfoService.update(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@RequestMapping(value = "delete", method = {RequestMethod.POST, RequestMethod.DELETE}) |
|||
public Result delete(@RequestBody String[] ids){ |
|||
//效验数据
|
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
hikCommunityInfoService.delete(ids); |
|||
return new Result(); |
|||
} |
|||
|
|||
@GetMapping("export") |
|||
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
|||
List<HikCommunityInfoDTO> list = hikCommunityInfoService.list(params); |
|||
ExcelUtils.exportExcelToTarget(response, null, list, HikCommunityInfoExcel.class); |
|||
} |
|||
|
|||
/** |
|||
* @Description: 同步社区列表信息 |
|||
* @Param: [formDto] |
|||
* @return: com.elink.esua.epdc.commons.tools.utils.Result<> |
|||
* @Author: wgf |
|||
* @Date: 2022-05-23 |
|||
*/ |
|||
@GetMapping("getCommunityList") |
|||
public Result getCommunityList() { |
|||
return hikCommunityInfoService.getCommunityList(); |
|||
} |
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,94 @@ |
|||
package com.epmet.plugin.power.modules.hik.controller; |
|||
|
|||
import com.epmet.commons.tools.aop.NoRepeatSubmit; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.utils.ExcelUtils; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.commons.tools.validator.AssertUtils; |
|||
import com.epmet.commons.tools.validator.ValidatorUtils; |
|||
import com.epmet.commons.tools.validator.group.AddGroup; |
|||
import com.epmet.commons.tools.validator.group.UpdateGroup; |
|||
import com.epmet.commons.tools.validator.group.DefaultGroup; |
|||
import com.epmet.plugin.power.dto.hik.HikDeviceInfoDTO; |
|||
import com.epmet.plugin.power.modules.hik.excel.HikDeviceInfoExcel; |
|||
import com.epmet.plugin.power.modules.hik.service.HikDeviceInfoService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
|
|||
/** |
|||
* 海康设备信息 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-05-20 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("hikDeviceInfo") |
|||
public class HikDeviceInfoController { |
|||
|
|||
@Autowired |
|||
private HikDeviceInfoService hikDeviceInfoService; |
|||
|
|||
@RequestMapping("page") |
|||
public Result<PageData<HikDeviceInfoDTO>> page(@RequestParam Map<String, Object> params){ |
|||
PageData<HikDeviceInfoDTO> page = hikDeviceInfoService.page(params); |
|||
return new Result<PageData<HikDeviceInfoDTO>>().ok(page); |
|||
} |
|||
|
|||
@RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) |
|||
public Result<HikDeviceInfoDTO> get(@PathVariable("id") String id){ |
|||
HikDeviceInfoDTO data = hikDeviceInfoService.get(id); |
|||
return new Result<HikDeviceInfoDTO>().ok(data); |
|||
} |
|||
|
|||
@NoRepeatSubmit |
|||
@PostMapping("save") |
|||
public Result save(@RequestBody HikDeviceInfoDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
hikDeviceInfoService.save(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@NoRepeatSubmit |
|||
@PostMapping("update") |
|||
public Result update(@RequestBody HikDeviceInfoDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
hikDeviceInfoService.update(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@RequestMapping(value = "delete", method = {RequestMethod.POST, RequestMethod.DELETE}) |
|||
public Result delete(@RequestBody String[] ids){ |
|||
//效验数据
|
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
hikDeviceInfoService.delete(ids); |
|||
return new Result(); |
|||
} |
|||
|
|||
@GetMapping("export") |
|||
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
|||
List<HikDeviceInfoDTO> list = hikDeviceInfoService.list(params); |
|||
ExcelUtils.exportExcelToTarget(response, null, list, HikDeviceInfoExcel.class); |
|||
} |
|||
|
|||
/** |
|||
* @Description: 同步设备列表信息 |
|||
* @Param: [formDto] |
|||
* @return: com.elink.esua.epdc.commons.tools.utils.Result<> |
|||
* @Author: wgf |
|||
* @Date: 2022-05-23 |
|||
*/ |
|||
@GetMapping("getDeviceList") |
|||
public Result getDeviceList() { |
|||
return hikDeviceInfoService.getDeviceList(); |
|||
} |
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,82 @@ |
|||
package com.epmet.plugin.power.modules.hik.controller; |
|||
|
|||
import com.epmet.commons.tools.aop.NoRepeatSubmit; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.utils.ExcelUtils; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.commons.tools.validator.AssertUtils; |
|||
import com.epmet.commons.tools.validator.ValidatorUtils; |
|||
import com.epmet.commons.tools.validator.group.AddGroup; |
|||
import com.epmet.commons.tools.validator.group.UpdateGroup; |
|||
import com.epmet.commons.tools.validator.group.DefaultGroup; |
|||
import com.epmet.plugin.power.dto.hik.HikErrorInfoDTO; |
|||
import com.epmet.plugin.power.modules.hik.excel.HikErrorInfoExcel; |
|||
import com.epmet.plugin.power.modules.hik.service.HikErrorInfoService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
|
|||
/** |
|||
* 海康设备推送失败信息 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-05-23 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("hikErrorInfo") |
|||
public class HikErrorInfoController { |
|||
|
|||
@Autowired |
|||
private HikErrorInfoService hikErrorInfoService; |
|||
|
|||
@RequestMapping("page") |
|||
public Result<PageData<HikErrorInfoDTO>> page(@RequestParam Map<String, Object> params){ |
|||
PageData<HikErrorInfoDTO> page = hikErrorInfoService.page(params); |
|||
return new Result<PageData<HikErrorInfoDTO>>().ok(page); |
|||
} |
|||
|
|||
@RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) |
|||
public Result<HikErrorInfoDTO> get(@PathVariable("id") String id){ |
|||
HikErrorInfoDTO data = hikErrorInfoService.get(id); |
|||
return new Result<HikErrorInfoDTO>().ok(data); |
|||
} |
|||
|
|||
@NoRepeatSubmit |
|||
@PostMapping("save") |
|||
public Result save(@RequestBody HikErrorInfoDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
hikErrorInfoService.save(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@NoRepeatSubmit |
|||
@PostMapping("update") |
|||
public Result update(@RequestBody HikErrorInfoDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
hikErrorInfoService.update(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@RequestMapping(value = "delete", method = {RequestMethod.POST, RequestMethod.DELETE}) |
|||
public Result delete(@RequestBody String[] ids){ |
|||
//效验数据
|
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
hikErrorInfoService.delete(ids); |
|||
return new Result(); |
|||
} |
|||
|
|||
@GetMapping("export") |
|||
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
|||
List<HikErrorInfoDTO> list = hikErrorInfoService.list(params); |
|||
ExcelUtils.exportExcelToTarget(response, null, list, HikErrorInfoExcel.class); |
|||
} |
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,21 @@ |
|||
package com.epmet.plugin.power.modules.hik.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.plugin.power.dto.hik.HikCommunityInfoDTO; |
|||
import com.epmet.plugin.power.modules.hik.entity.HikCommunityInfoEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 海康社区信息 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-05-20 |
|||
*/ |
|||
@Mapper |
|||
public interface HikCommunityInfoDao extends BaseDao<HikCommunityInfoEntity> { |
|||
|
|||
List<HikCommunityInfoDTO> getCommunityInfoAll(); |
|||
|
|||
} |
@ -0,0 +1,16 @@ |
|||
package com.epmet.plugin.power.modules.hik.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.plugin.power.modules.hik.entity.HikDeviceInfoEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 海康设备信息 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-05-20 |
|||
*/ |
|||
@Mapper |
|||
public interface HikDeviceInfoDao extends BaseDao<HikDeviceInfoEntity> { |
|||
|
|||
} |
@ -0,0 +1,27 @@ |
|||
package com.epmet.plugin.power.modules.hik.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.plugin.power.modules.hik.entity.HikErrorInfoEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 海康设备推送失败信息 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-05-23 |
|||
*/ |
|||
@Mapper |
|||
public interface HikErrorInfoDao extends BaseDao<HikErrorInfoEntity> { |
|||
|
|||
/** |
|||
* 物理删除 |
|||
* |
|||
* @param params |
|||
* @return void |
|||
* @author zhy |
|||
* @date 2022/4/24 14:08 |
|||
*/ |
|||
void deletePhysical(Map<String, Object> params); |
|||
} |
@ -0,0 +1,64 @@ |
|||
package com.epmet.plugin.power.modules.hik.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 海康社区信息 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-05-20 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("pli_hik_community_info") |
|||
public class HikCommunityInfoEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 社区ID |
|||
*/ |
|||
private String communityId; |
|||
|
|||
/** |
|||
* 社区名称 |
|||
*/ |
|||
private String communityName; |
|||
|
|||
/** |
|||
* 省代号 |
|||
*/ |
|||
private String provinceCode; |
|||
|
|||
/** |
|||
* 市代号 |
|||
*/ |
|||
private String cityCode; |
|||
|
|||
/** |
|||
* 区代号 |
|||
*/ |
|||
private String countyCode; |
|||
|
|||
/** |
|||
* 经度坐标值 |
|||
*/ |
|||
private String longitude; |
|||
|
|||
/** |
|||
* 维度坐标值 |
|||
*/ |
|||
private String latitude; |
|||
|
|||
} |
@ -0,0 +1,64 @@ |
|||
package com.epmet.plugin.power.modules.hik.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 海康设备信息 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-05-20 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("pli_hik_device_info") |
|||
public class HikDeviceInfoEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 社区ID |
|||
*/ |
|||
private String communityId; |
|||
|
|||
/** |
|||
* 设备ID |
|||
*/ |
|||
private String deviceId; |
|||
|
|||
/** |
|||
* 设备名称 |
|||
*/ |
|||
private String deviceName; |
|||
|
|||
/** |
|||
* 设备型号 |
|||
*/ |
|||
private String deviceModel; |
|||
|
|||
/** |
|||
* 设备序列号 |
|||
*/ |
|||
private String deviceSerial; |
|||
|
|||
/** |
|||
* 设备状态,0:离线,1:在线 |
|||
*/ |
|||
private String deviceStatus; |
|||
|
|||
/** |
|||
* 设备路径 |
|||
*/ |
|||
private String devicePath; |
|||
|
|||
} |
@ -0,0 +1,48 @@ |
|||
package com.epmet.plugin.power.modules.hik.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 海康设备推送失败信息 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-05-23 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("pli_hik_error_info") |
|||
public class HikErrorInfoEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 身份证号 |
|||
*/ |
|||
private String idCard; |
|||
|
|||
/** |
|||
* 错误类型 0:token,1:人员,2权限 |
|||
*/ |
|||
private String errorType; |
|||
|
|||
/** |
|||
* 错误详情 |
|||
*/ |
|||
private String errorInfo; |
|||
|
|||
/** |
|||
* 引用ID |
|||
*/ |
|||
private String referenceId; |
|||
} |
@ -0,0 +1,63 @@ |
|||
package com.epmet.plugin.power.modules.hik.excel; |
|||
|
|||
import cn.afterturn.easypoi.excel.annotation.Excel; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 海康社区信息 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-05-20 |
|||
*/ |
|||
@Data |
|||
public class HikCommunityInfoExcel { |
|||
|
|||
@Excel(name = "主键") |
|||
private String id; |
|||
|
|||
@Excel(name = "删除标记 0:未删除,1:已删除") |
|||
private String delFlag; |
|||
|
|||
@Excel(name = "乐观锁") |
|||
private Integer revision; |
|||
|
|||
@Excel(name = "创建人") |
|||
private String createdBy; |
|||
|
|||
@Excel(name = "创建时间") |
|||
private Date createdTime; |
|||
|
|||
@Excel(name = "更新人") |
|||
private String updatedBy; |
|||
|
|||
@Excel(name = "更新时间") |
|||
private Date updatedTime; |
|||
|
|||
@Excel(name = "客户ID") |
|||
private String customerId; |
|||
|
|||
@Excel(name = "社区ID") |
|||
private String communityId; |
|||
|
|||
@Excel(name = "社区名称") |
|||
private String communityName; |
|||
|
|||
@Excel(name = "省代号") |
|||
private String provinceCode; |
|||
|
|||
@Excel(name = "市代号") |
|||
private String cityCode; |
|||
|
|||
@Excel(name = "区代号") |
|||
private String countyCode; |
|||
|
|||
@Excel(name = "经度坐标值") |
|||
private String longitude; |
|||
|
|||
@Excel(name = "维度坐标值") |
|||
private String latitude; |
|||
|
|||
|
|||
} |
@ -0,0 +1,63 @@ |
|||
package com.epmet.plugin.power.modules.hik.excel; |
|||
|
|||
import cn.afterturn.easypoi.excel.annotation.Excel; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 海康设备信息 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-05-20 |
|||
*/ |
|||
@Data |
|||
public class HikDeviceInfoExcel { |
|||
|
|||
@Excel(name = "主键") |
|||
private String id; |
|||
|
|||
@Excel(name = "删除标记 0:未删除,1:已删除") |
|||
private String delFlag; |
|||
|
|||
@Excel(name = "乐观锁") |
|||
private Integer revision; |
|||
|
|||
@Excel(name = "创建人") |
|||
private String createdBy; |
|||
|
|||
@Excel(name = "创建时间") |
|||
private Date createdTime; |
|||
|
|||
@Excel(name = "更新人") |
|||
private String updatedBy; |
|||
|
|||
@Excel(name = "更新时间") |
|||
private Date updatedTime; |
|||
|
|||
@Excel(name = "客户ID") |
|||
private String customerId; |
|||
|
|||
@Excel(name = "社区ID") |
|||
private String communityId; |
|||
|
|||
@Excel(name = "设备ID") |
|||
private String deviceId; |
|||
|
|||
@Excel(name = "设备名称") |
|||
private String deviceName; |
|||
|
|||
@Excel(name = "设备型号") |
|||
private String deviceModel; |
|||
|
|||
@Excel(name = "设备序列号") |
|||
private String deviceSerial; |
|||
|
|||
@Excel(name = "设备状态,0:离线,1:在线") |
|||
private String deviceStatus; |
|||
|
|||
@Excel(name = "设备路径") |
|||
private String devicePath; |
|||
|
|||
|
|||
} |
@ -0,0 +1,51 @@ |
|||
package com.epmet.plugin.power.modules.hik.excel; |
|||
|
|||
import cn.afterturn.easypoi.excel.annotation.Excel; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 海康设备推送失败信息 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-05-23 |
|||
*/ |
|||
@Data |
|||
public class HikErrorInfoExcel { |
|||
|
|||
@Excel(name = "主键") |
|||
private String id; |
|||
|
|||
@Excel(name = "删除标记 0:未删除,1:已删除") |
|||
private String delFlag; |
|||
|
|||
@Excel(name = "乐观锁") |
|||
private Integer revision; |
|||
|
|||
@Excel(name = "创建人") |
|||
private String createdBy; |
|||
|
|||
@Excel(name = "创建时间") |
|||
private Date createdTime; |
|||
|
|||
@Excel(name = "更新人") |
|||
private String updatedBy; |
|||
|
|||
@Excel(name = "更新时间") |
|||
private Date updatedTime; |
|||
|
|||
@Excel(name = "客户ID") |
|||
private String customerId; |
|||
|
|||
@Excel(name = "身份证号") |
|||
private String idCard; |
|||
|
|||
@Excel(name = "错误类型 0:token,1:人员,2权限") |
|||
private String errorType; |
|||
|
|||
@Excel(name = "错误详情") |
|||
private String errorInfo; |
|||
|
|||
|
|||
} |
@ -0,0 +1,30 @@ |
|||
package com.epmet.plugin.power.modules.hik.redis; |
|||
|
|||
import com.epmet.commons.tools.redis.RedisUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* 海康社区信息 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-05-20 |
|||
*/ |
|||
@Component |
|||
public class HikCommunityInfoRedis { |
|||
@Autowired |
|||
private RedisUtils redisUtils; |
|||
|
|||
public void delete(Object[] ids) { |
|||
|
|||
} |
|||
|
|||
public void set(){ |
|||
|
|||
} |
|||
|
|||
public String get(String id){ |
|||
return null; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,30 @@ |
|||
package com.epmet.plugin.power.modules.hik.redis; |
|||
|
|||
import com.epmet.commons.tools.redis.RedisUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* 海康设备信息 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-05-20 |
|||
*/ |
|||
@Component |
|||
public class HikDeviceInfoRedis { |
|||
@Autowired |
|||
private RedisUtils redisUtils; |
|||
|
|||
public void delete(Object[] ids) { |
|||
|
|||
} |
|||
|
|||
public void set(){ |
|||
|
|||
} |
|||
|
|||
public String get(String id){ |
|||
return null; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,30 @@ |
|||
package com.epmet.plugin.power.modules.hik.redis; |
|||
|
|||
import com.epmet.commons.tools.redis.RedisUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* 海康设备推送失败信息 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-05-23 |
|||
*/ |
|||
@Component |
|||
public class HikErrorInfoRedis { |
|||
@Autowired |
|||
private RedisUtils redisUtils; |
|||
|
|||
public void delete(Object[] ids) { |
|||
|
|||
} |
|||
|
|||
public void set(){ |
|||
|
|||
} |
|||
|
|||
public String get(String id){ |
|||
return null; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,87 @@ |
|||
package com.epmet.plugin.power.modules.hik.service; |
|||
|
|||
import com.epmet.commons.mybatis.service.BaseService; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.plugin.power.dto.hik.HikCommunityInfoDTO; |
|||
import com.epmet.plugin.power.modules.hik.entity.HikCommunityInfoEntity; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 海康社区信息 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-05-20 |
|||
*/ |
|||
public interface HikCommunityInfoService extends BaseService<HikCommunityInfoEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param params |
|||
* @return PageData<HikCommunityInfoDTO> |
|||
* @author generator |
|||
* @date 2022-05-20 |
|||
*/ |
|||
PageData<HikCommunityInfoDTO> page(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<HikCommunityInfoDTO> |
|||
* @author generator |
|||
* @date 2022-05-20 |
|||
*/ |
|||
List<HikCommunityInfoDTO> list(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 单条查询 |
|||
* |
|||
* @param id |
|||
* @return HikCommunityInfoDTO |
|||
* @author generator |
|||
* @date 2022-05-20 |
|||
*/ |
|||
HikCommunityInfoDTO get(String id); |
|||
|
|||
/** |
|||
* 默认保存 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2022-05-20 |
|||
*/ |
|||
void save(HikCommunityInfoDTO dto); |
|||
|
|||
/** |
|||
* 默认更新 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2022-05-20 |
|||
*/ |
|||
void update(HikCommunityInfoDTO dto); |
|||
|
|||
/** |
|||
* 批量删除 |
|||
* |
|||
* @param ids |
|||
* @return void |
|||
* @author generator |
|||
* @date 2022-05-20 |
|||
*/ |
|||
void delete(String[] ids); |
|||
|
|||
|
|||
/** |
|||
* 同步社区信息 |
|||
* @param |
|||
* @return |
|||
*/ |
|||
Result getCommunityList(); |
|||
} |
@ -0,0 +1,86 @@ |
|||
package com.epmet.plugin.power.modules.hik.service; |
|||
|
|||
import com.epmet.commons.mybatis.service.BaseService; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.plugin.power.dto.hik.HikDeviceInfoDTO; |
|||
import com.epmet.plugin.power.modules.hik.entity.HikDeviceInfoEntity; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 海康设备信息 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-05-20 |
|||
*/ |
|||
public interface HikDeviceInfoService extends BaseService<HikDeviceInfoEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param params |
|||
* @return PageData<HikDeviceInfoDTO> |
|||
* @author generator |
|||
* @date 2022-05-20 |
|||
*/ |
|||
PageData<HikDeviceInfoDTO> page(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<HikDeviceInfoDTO> |
|||
* @author generator |
|||
* @date 2022-05-20 |
|||
*/ |
|||
List<HikDeviceInfoDTO> list(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 单条查询 |
|||
* |
|||
* @param id |
|||
* @return HikDeviceInfoDTO |
|||
* @author generator |
|||
* @date 2022-05-20 |
|||
*/ |
|||
HikDeviceInfoDTO get(String id); |
|||
|
|||
/** |
|||
* 默认保存 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2022-05-20 |
|||
*/ |
|||
void save(HikDeviceInfoDTO dto); |
|||
|
|||
/** |
|||
* 默认更新 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2022-05-20 |
|||
*/ |
|||
void update(HikDeviceInfoDTO dto); |
|||
|
|||
/** |
|||
* 批量删除 |
|||
* |
|||
* @param ids |
|||
* @return void |
|||
* @author generator |
|||
* @date 2022-05-20 |
|||
*/ |
|||
void delete(String[] ids); |
|||
|
|||
/** |
|||
* 同步设备信息 |
|||
* @param |
|||
* @return |
|||
*/ |
|||
Result getDeviceList(); |
|||
} |
@ -0,0 +1,88 @@ |
|||
package com.epmet.plugin.power.modules.hik.service; |
|||
|
|||
import com.epmet.commons.mybatis.service.BaseService; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.plugin.power.dto.hik.HikErrorInfoDTO; |
|||
import com.epmet.plugin.power.modules.hik.entity.HikErrorInfoEntity; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 海康设备推送失败信息 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-05-23 |
|||
*/ |
|||
public interface HikErrorInfoService extends BaseService<HikErrorInfoEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param params |
|||
* @return PageData<HikErrorInfoDTO> |
|||
* @author generator |
|||
* @date 2022-05-23 |
|||
*/ |
|||
PageData<HikErrorInfoDTO> page(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<HikErrorInfoDTO> |
|||
* @author generator |
|||
* @date 2022-05-23 |
|||
*/ |
|||
List<HikErrorInfoDTO> list(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 单条查询 |
|||
* |
|||
* @param id |
|||
* @return HikErrorInfoDTO |
|||
* @author generator |
|||
* @date 2022-05-23 |
|||
*/ |
|||
HikErrorInfoDTO get(String id); |
|||
|
|||
/** |
|||
* 默认保存 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2022-05-23 |
|||
*/ |
|||
void save(HikErrorInfoDTO dto); |
|||
|
|||
/** |
|||
* 默认更新 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2022-05-23 |
|||
*/ |
|||
void update(HikErrorInfoDTO dto); |
|||
|
|||
/** |
|||
* 批量删除 |
|||
* |
|||
* @param ids |
|||
* @return void |
|||
* @author generator |
|||
* @date 2022-05-23 |
|||
*/ |
|||
void delete(String[] ids); |
|||
|
|||
/** |
|||
* 物理删除 |
|||
* |
|||
* @param params |
|||
* @return void |
|||
* @author zhy |
|||
* @date 2022/4/24 14:08 |
|||
*/ |
|||
void deletePhysical(Map<String, Object> params); |
|||
} |
@ -0,0 +1,167 @@ |
|||
package com.epmet.plugin.power.modules.hik.service.impl; |
|||
|
|||
import com.alibaba.fastjson.JSON; |
|||
import com.alibaba.fastjson.JSONArray; |
|||
import com.alibaba.fastjson.JSONObject; |
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|||
import com.epmet.commons.tools.exception.EpmetException; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.security.user.LoginUserUtil; |
|||
import com.epmet.commons.tools.utils.ConvertUtils; |
|||
import com.epmet.commons.tools.constant.FieldConstant; |
|||
import com.epmet.commons.tools.utils.HttpClientManager; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.plugin.power.modules.hik.dao.HikCommunityInfoDao; |
|||
import com.epmet.plugin.power.dto.hik.HikCommunityInfoDTO; |
|||
import com.epmet.plugin.power.modules.hik.entity.HikCommunityInfoEntity; |
|||
import com.epmet.plugin.power.modules.hik.redis.HikCommunityInfoRedis; |
|||
import com.epmet.plugin.power.modules.hik.service.HikCommunityInfoService; |
|||
import com.epmet.plugin.power.modules.utils.HkDeviceUtil; |
|||
import com.fasterxml.jackson.databind.ObjectMapper; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.*; |
|||
|
|||
/** |
|||
* 海康社区信息 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-05-20 |
|||
*/ |
|||
@Service |
|||
public class HikCommunityInfoServiceImpl extends BaseServiceImpl<HikCommunityInfoDao, HikCommunityInfoEntity> implements HikCommunityInfoService { |
|||
|
|||
@Autowired |
|||
private HikCommunityInfoRedis hikCommunityInfoRedis; |
|||
|
|||
@Autowired |
|||
private HkDeviceUtil hkDeviceUtil; |
|||
|
|||
@Autowired |
|||
private LoginUserUtil loginUserUtil; |
|||
|
|||
// 参数
|
|||
private Integer pageNo = 1; |
|||
private Integer pageSize = 10; |
|||
|
|||
@Override |
|||
public PageData<HikCommunityInfoDTO> page(Map<String, Object> params) { |
|||
IPage<HikCommunityInfoEntity> page = baseDao.selectPage( |
|||
getPage(params, FieldConstant.CREATED_TIME, false), |
|||
getWrapper(params) |
|||
); |
|||
return getPageData(page, HikCommunityInfoDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public List<HikCommunityInfoDTO> list(Map<String, Object> params) { |
|||
List<HikCommunityInfoEntity> entityList = baseDao.selectList(getWrapper(params)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, HikCommunityInfoDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<HikCommunityInfoEntity> getWrapper(Map<String, Object> params){ |
|||
String id = (String)params.get(FieldConstant.ID_HUMP); |
|||
String communityName = (String)params.get("communityName"); |
|||
|
|||
QueryWrapper<HikCommunityInfoEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|||
wrapper.like(StringUtils.isNotBlank(communityName), "COMMUNITY_NAME", communityName); |
|||
|
|||
return wrapper; |
|||
} |
|||
|
|||
@Override |
|||
public HikCommunityInfoDTO get(String id) { |
|||
HikCommunityInfoEntity entity = baseDao.selectById(id); |
|||
return ConvertUtils.sourceToTarget(entity, HikCommunityInfoDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(HikCommunityInfoDTO dto) { |
|||
HikCommunityInfoEntity entity = ConvertUtils.sourceToTarget(dto, HikCommunityInfoEntity.class); |
|||
insert(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void update(HikCommunityInfoDTO dto) { |
|||
HikCommunityInfoEntity entity = ConvertUtils.sourceToTarget(dto, HikCommunityInfoEntity.class); |
|||
updateById(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void delete(String[] ids) { |
|||
// 逻辑删除(@TableLogic 注解)
|
|||
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|||
} |
|||
|
|||
@Override |
|||
public Result getCommunityList() { |
|||
// 请求路径
|
|||
String url = "https://api2.hik-cloud.com/api/v1/estate/system/communities/actions/list"; |
|||
|
|||
// token
|
|||
String token =hkDeviceUtil.getAccessToken(); |
|||
token = "Bearer ".concat(token); |
|||
|
|||
Map<String, Object> headerMap = new HashMap<>(4); |
|||
headerMap.put("Authorization",token); |
|||
|
|||
Map<String, Object> paramsMap = new HashMap<>(4); |
|||
paramsMap.put("pageNo", pageNo); |
|||
paramsMap.put("pageSize", pageSize); |
|||
|
|||
JSONArray jsonArray = getJSONArrayListGET(url,false,paramsMap,headerMap,"请求社区列表信息失败"); |
|||
|
|||
List<HikCommunityInfoEntity> entityList = new ArrayList<HikCommunityInfoEntity>(); |
|||
for (int i = 0; i < jsonArray.size(); i++) { |
|||
JSONObject jsonObj = jsonArray.getJSONObject(i); |
|||
// 转成对象实体
|
|||
HikCommunityInfoEntity entity = JSONObject.toJavaObject(jsonObj ,HikCommunityInfoEntity.class); |
|||
entity.setCustomerId(loginUserUtil.getLoginUserCustomerId() == null ? "0001" : loginUserUtil.getLoginUserCustomerId()); |
|||
entityList.add(entity); |
|||
} |
|||
insertBatch(entityList); |
|||
|
|||
if(jsonArray != null && jsonArray.size() == 10){ |
|||
pageNo++; |
|||
getCommunityList(); |
|||
} |
|||
|
|||
return new Result(); |
|||
} |
|||
|
|||
/** |
|||
* sendGet请求 |
|||
* @param url |
|||
* @param isHttps |
|||
* @param paramsMap |
|||
* @param headerMap |
|||
* @param msg |
|||
* @return |
|||
*/ |
|||
public JSONArray getJSONArrayListGET(String url,Boolean isHttps,Map<String, Object> paramsMap,Map<String, Object> headerMap,String msg){ |
|||
// 请求接口
|
|||
String data = HttpClientManager.getInstance().sendGet(url,false,paramsMap, headerMap).getData(); |
|||
if (null == data) { |
|||
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), msg); |
|||
} |
|||
JSONObject toResult = JSON.parseObject(data); |
|||
|
|||
JSONObject dataList = JSON.parseObject(toResult.get("data").toString()); |
|||
|
|||
JSONArray rows = JSONArray.parseArray(dataList.get("rows").toString()); |
|||
|
|||
return rows; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,170 @@ |
|||
package com.epmet.plugin.power.modules.hik.service.impl; |
|||
|
|||
import com.alibaba.fastjson.JSON; |
|||
import com.alibaba.fastjson.JSONArray; |
|||
import com.alibaba.fastjson.JSONObject; |
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|||
import com.epmet.commons.tools.exception.EpmetException; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.security.user.LoginUserUtil; |
|||
import com.epmet.commons.tools.utils.ConvertUtils; |
|||
import com.epmet.commons.tools.constant.FieldConstant; |
|||
import com.epmet.commons.tools.utils.HttpClientManager; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.plugin.power.dto.hik.HikCommunityInfoDTO; |
|||
import com.epmet.plugin.power.modules.hik.dao.HikCommunityInfoDao; |
|||
import com.epmet.plugin.power.modules.hik.dao.HikDeviceInfoDao; |
|||
import com.epmet.plugin.power.dto.hik.HikDeviceInfoDTO; |
|||
import com.epmet.plugin.power.modules.hik.entity.HikCommunityInfoEntity; |
|||
import com.epmet.plugin.power.modules.hik.entity.HikDeviceInfoEntity; |
|||
import com.epmet.plugin.power.modules.hik.redis.HikDeviceInfoRedis; |
|||
import com.epmet.plugin.power.modules.hik.service.HikDeviceInfoService; |
|||
import com.epmet.plugin.power.modules.utils.HkDeviceUtil; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.*; |
|||
|
|||
/** |
|||
* 海康设备信息 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-05-20 |
|||
*/ |
|||
@Service |
|||
public class HikDeviceInfoServiceImpl extends BaseServiceImpl<HikDeviceInfoDao, HikDeviceInfoEntity> implements HikDeviceInfoService { |
|||
|
|||
@Autowired |
|||
private HikDeviceInfoRedis hikDeviceInfoRedis; |
|||
|
|||
@Autowired |
|||
private HkDeviceUtil hkDeviceUtil; |
|||
|
|||
@Autowired |
|||
private LoginUserUtil loginUserUtil; |
|||
|
|||
@Autowired |
|||
private HikCommunityInfoDao hikCommunityInfoDao; |
|||
|
|||
@Override |
|||
public PageData<HikDeviceInfoDTO> page(Map<String, Object> params) { |
|||
IPage<HikDeviceInfoEntity> page = baseDao.selectPage( |
|||
getPage(params, FieldConstant.CREATED_TIME, false), |
|||
getWrapper(params) |
|||
); |
|||
return getPageData(page, HikDeviceInfoDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public List<HikDeviceInfoDTO> list(Map<String, Object> params) { |
|||
List<HikDeviceInfoEntity> entityList = baseDao.selectList(getWrapper(params)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, HikDeviceInfoDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<HikDeviceInfoEntity> getWrapper(Map<String, Object> params){ |
|||
String id = (String)params.get(FieldConstant.ID_HUMP); |
|||
String communityId = (String)params.get("communityId"); |
|||
|
|||
QueryWrapper<HikDeviceInfoEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|||
wrapper.eq(StringUtils.isNotBlank(communityId), "COMMUNITY_ID", communityId); |
|||
|
|||
return wrapper; |
|||
} |
|||
|
|||
@Override |
|||
public HikDeviceInfoDTO get(String id) { |
|||
HikDeviceInfoEntity entity = baseDao.selectById(id); |
|||
return ConvertUtils.sourceToTarget(entity, HikDeviceInfoDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(HikDeviceInfoDTO dto) { |
|||
HikDeviceInfoEntity entity = ConvertUtils.sourceToTarget(dto, HikDeviceInfoEntity.class); |
|||
insert(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void update(HikDeviceInfoDTO dto) { |
|||
HikDeviceInfoEntity entity = ConvertUtils.sourceToTarget(dto, HikDeviceInfoEntity.class); |
|||
updateById(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void delete(String[] ids) { |
|||
// 逻辑删除(@TableLogic 注解)
|
|||
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|||
} |
|||
|
|||
@Override |
|||
public Result getDeviceList() { |
|||
// 请求路径
|
|||
String url = "https://api2.hik-cloud.com/api/v1/estate/devices/actions/listByCommunityId"; |
|||
|
|||
// token
|
|||
String token =hkDeviceUtil.getAccessToken(); |
|||
token = "Bearer ".concat(token); |
|||
|
|||
Map<String, String> headerMap = new HashMap<>(4); |
|||
headerMap.put("Authorization",token); |
|||
|
|||
// 获取社区列表
|
|||
List<HikCommunityInfoDTO> communityList = hikCommunityInfoDao.getCommunityInfoAll(); |
|||
|
|||
for(HikCommunityInfoDTO hikCommunityInfoDTO : communityList){ |
|||
// 参数
|
|||
Integer pageNo = 1; |
|||
Integer pageSize = 1000; |
|||
Map<String, Object> paramsMap = new HashMap<>(4); |
|||
paramsMap.put("pageNo", pageNo); |
|||
paramsMap.put("pageSize", pageSize); |
|||
paramsMap.put("communityId",hikCommunityInfoDTO.getCommunityId()); |
|||
JSONArray jsonArray = getJSONArrayListPOST(url,JSON.toJSONString(paramsMap),headerMap,"请求设备列表信息失败"); |
|||
|
|||
List<HikDeviceInfoEntity> entityList = new ArrayList<HikDeviceInfoEntity>(); |
|||
for (int i = 0; i < jsonArray.size(); i++) { |
|||
JSONObject jsonObj = jsonArray.getJSONObject(i); |
|||
// 转成对象实体
|
|||
HikDeviceInfoEntity entity = JSONObject.toJavaObject(jsonObj ,HikDeviceInfoEntity.class); |
|||
entity.setCustomerId(loginUserUtil.getLoginUserCustomerId() == null ? "0001" : loginUserUtil.getLoginUserCustomerId()); |
|||
entityList.add(entity); |
|||
} |
|||
insertBatch(entityList); |
|||
} |
|||
|
|||
return new Result(); |
|||
} |
|||
|
|||
/** |
|||
* sendGet请求 |
|||
* @param url |
|||
* @param jsonStrParam |
|||
* @param headerMap |
|||
* @param msg |
|||
* @return |
|||
*/ |
|||
public JSONArray getJSONArrayListPOST(String url,String jsonStrParam,Map<String, String> headerMap,String msg){ |
|||
// 请求接口
|
|||
String data = HttpClientManager.getInstance().sendPostByJSONAndHeader(url,jsonStrParam, headerMap).getData(); |
|||
if (null == data) { |
|||
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), msg); |
|||
} |
|||
JSONObject toResult = JSON.parseObject(data); |
|||
|
|||
JSONObject dataList = JSON.parseObject(toResult.get("data").toString()); |
|||
|
|||
JSONArray rows = JSONArray.parseArray(dataList.get("rows").toString()); |
|||
|
|||
return rows; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,95 @@ |
|||
package com.epmet.plugin.power.modules.hik.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.utils.ConvertUtils; |
|||
import com.epmet.commons.tools.constant.FieldConstant; |
|||
import com.epmet.plugin.power.modules.hik.dao.HikErrorInfoDao; |
|||
import com.epmet.plugin.power.dto.hik.HikErrorInfoDTO; |
|||
import com.epmet.plugin.power.modules.hik.entity.HikErrorInfoEntity; |
|||
import com.epmet.plugin.power.modules.hik.redis.HikErrorInfoRedis; |
|||
import com.epmet.plugin.power.modules.hik.service.HikErrorInfoService; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 海康设备推送失败信息 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-05-23 |
|||
*/ |
|||
@Service |
|||
public class HikErrorInfoServiceImpl extends BaseServiceImpl<HikErrorInfoDao, HikErrorInfoEntity> implements HikErrorInfoService { |
|||
|
|||
@Autowired |
|||
private HikErrorInfoRedis hikErrorInfoRedis; |
|||
|
|||
@Override |
|||
public PageData<HikErrorInfoDTO> page(Map<String, Object> params) { |
|||
IPage<HikErrorInfoEntity> page = baseDao.selectPage( |
|||
getPage(params, FieldConstant.CREATED_TIME, false), |
|||
getWrapper(params) |
|||
); |
|||
return getPageData(page, HikErrorInfoDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public List<HikErrorInfoDTO> list(Map<String, Object> params) { |
|||
List<HikErrorInfoEntity> entityList = baseDao.selectList(getWrapper(params)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, HikErrorInfoDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<HikErrorInfoEntity> getWrapper(Map<String, Object> params){ |
|||
String id = (String)params.get(FieldConstant.ID_HUMP); |
|||
|
|||
QueryWrapper<HikErrorInfoEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|||
|
|||
return wrapper; |
|||
} |
|||
|
|||
@Override |
|||
public HikErrorInfoDTO get(String id) { |
|||
HikErrorInfoEntity entity = baseDao.selectById(id); |
|||
return ConvertUtils.sourceToTarget(entity, HikErrorInfoDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(HikErrorInfoDTO dto) { |
|||
HikErrorInfoEntity entity = ConvertUtils.sourceToTarget(dto, HikErrorInfoEntity.class); |
|||
insert(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void update(HikErrorInfoDTO dto) { |
|||
HikErrorInfoEntity entity = ConvertUtils.sourceToTarget(dto, HikErrorInfoEntity.class); |
|||
updateById(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void delete(String[] ids) { |
|||
// 逻辑删除(@TableLogic 注解)
|
|||
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void deletePhysical(Map<String, Object> params) { |
|||
if (!params.isEmpty()) { |
|||
baseDao.deletePhysical(params); |
|||
} |
|||
} |
|||
|
|||
} |
@ -0,0 +1,148 @@ |
|||
package com.epmet.plugin.power.modules.utils; |
|||
|
|||
import com.alibaba.fastjson.JSON; |
|||
import com.alibaba.fastjson.JSONObject; |
|||
import com.epmet.commons.tools.constant.NumConstant; |
|||
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|||
import com.epmet.commons.tools.exception.EpmetException; |
|||
import com.epmet.commons.tools.redis.RedisUtils; |
|||
import com.epmet.commons.tools.utils.ConvertUtils; |
|||
import com.epmet.commons.tools.utils.HttpClientManager; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.plugin.commons.redis.RedisKeys; |
|||
import com.epmet.plugin.power.config.HikCloudProperties; |
|||
import com.epmet.plugin.power.dto.hik.form.HikAuthorityFormDTO; |
|||
import com.epmet.plugin.power.dto.hik.form.HikPersonFormDTO; |
|||
import org.slf4j.Logger; |
|||
import org.slf4j.LoggerFactory; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
import java.util.HashMap; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 海康设备下放命令 |
|||
* |
|||
* @author zhy |
|||
* @date 2022/5/20 9:36 |
|||
*/ |
|||
@Component |
|||
public class HkDeviceUtil { |
|||
private static Logger logger = LoggerFactory.getLogger(HkDeviceUtil.class); |
|||
|
|||
@Autowired |
|||
private HikCloudProperties hikCloudProperties; |
|||
|
|||
@Autowired |
|||
private RedisUtils redisUtils; |
|||
|
|||
private final String GET_ACCESS_TOKEN = "/oauth/token"; |
|||
private final String GET_DEVICES = "/api/v1/estate/devices"; |
|||
private final String SEND_PERSON = "/api/v1/estate/system/person"; |
|||
private final String ISSUE_AUTHORITY = "/api/v1/estate/entranceGuard/permissions/actions/authorityIssued"; |
|||
|
|||
private final String GRANT_TYPE = "client_credentials"; |
|||
|
|||
/** |
|||
* 获取accessToken |
|||
* |
|||
* @param |
|||
* @return void |
|||
* @author zhy |
|||
* @date 2022/5/20 16:40 |
|||
*/ |
|||
public String getAccessToken() { |
|||
String key = RedisKeys.getHikTokenKey(); |
|||
Object obj = redisUtils.get(key); |
|||
if (null != obj) { |
|||
return (String) obj; |
|||
} |
|||
|
|||
String url = hikCloudProperties.getUrl().concat(GET_ACCESS_TOKEN); |
|||
Map<String, Object> paramsMap = new HashMap<>(8); |
|||
paramsMap.put("client_id", hikCloudProperties.getClient()); |
|||
paramsMap.put("client_secret", hikCloudProperties.getSecret()); |
|||
paramsMap.put("grant_type", GRANT_TYPE); |
|||
// paramsMap.put("scope", "app");
|
|||
|
|||
String data = HttpClientManager.getInstance().sendPost(url, paramsMap).getData(); |
|||
if (null == data) { |
|||
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "AccessToken获取失败"); |
|||
} |
|||
|
|||
JSONObject toResult = JSON.parseObject(data); |
|||
if (!toResult.containsKey("access_token")) { |
|||
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "AccessToken获取失败"); |
|||
} |
|||
String accessToken = "Bearer ".concat(toResult.get("access_token").toString()); |
|||
|
|||
redisUtils.set(key, accessToken, RedisUtils.HOUR_ONE_EXPIRE); |
|||
return accessToken; |
|||
} |
|||
|
|||
/** |
|||
* 下发人员 |
|||
* |
|||
* @param dto |
|||
* @return java.lang.String 人员ID |
|||
* @author zhy |
|||
* @date 2022/5/23 10:08 |
|||
*/ |
|||
public String sendPerson(HikPersonFormDTO dto) { |
|||
String url = hikCloudProperties.getUrl().concat(SEND_PERSON); |
|||
|
|||
Map<String, String> paramsMap = new HashMap<>(4); |
|||
paramsMap.put("Authorization", getAccessToken()); |
|||
|
|||
String data = HttpClientManager.getInstance().sendPostByJSONAndHeader(url, JSON.toJSONString(dto), paramsMap).getData(); |
|||
|
|||
if (null == data) { |
|||
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "人员信息下发失败"); |
|||
} |
|||
JSONObject toResult = JSON.parseObject(data); |
|||
Result result = ConvertUtils.mapToEntity(toResult, Result.class); |
|||
if (null != toResult.get("code")) { |
|||
result.setCode(((Integer) toResult.get("code")).intValue()); |
|||
} |
|||
if (NumConstant.TWO_HUNDRED != result.getCode()) { |
|||
logger.info(result.getMsg()); |
|||
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "人员信息下发失败"); |
|||
} |
|||
Object RegisterResult = result.getData(); |
|||
JSONObject jsonObject = JSON.parseObject(RegisterResult.toString()); |
|||
return jsonObject.getString("personId"); |
|||
} |
|||
|
|||
/** |
|||
* 下发人员权限 |
|||
* |
|||
* @param dto |
|||
* @return java.lang.String |
|||
* @author zhy |
|||
* @date 2022/5/23 11:04 |
|||
*/ |
|||
public String authorityIssued(HikAuthorityFormDTO dto) { |
|||
String url = hikCloudProperties.getUrl().concat(ISSUE_AUTHORITY); |
|||
|
|||
Map<String, String> paramsMap = new HashMap<>(4); |
|||
paramsMap.put("Authorization", getAccessToken()); |
|||
|
|||
String data = HttpClientManager.getInstance().sendPostByJSONAndHeader(url, JSON.toJSONString(dto), paramsMap).getData(); |
|||
|
|||
if (null == data) { |
|||
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "人员权限下发失败"); |
|||
} |
|||
JSONObject toResult = JSON.parseObject(data); |
|||
Result result = ConvertUtils.mapToEntity(toResult, Result.class); |
|||
if (null != toResult.get("code")) { |
|||
result.setCode(((Integer) toResult.get("code")).intValue()); |
|||
} |
|||
if (NumConstant.TWO_HUNDRED != result.getCode()) { |
|||
logger.info(result.getMsg()); |
|||
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "人员权限下发失败"); |
|||
} |
|||
return "success"; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,31 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.plugin.power.modules.hik.dao.HikCommunityInfoDao"> |
|||
|
|||
<resultMap type="com.epmet.plugin.power.modules.hik.entity.HikCommunityInfoEntity" id="hikCommunityInfoMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="communityId" column="COMMUNITY_ID"/> |
|||
<result property="communityName" column="COMMUNITY_NAME"/> |
|||
<result property="provinceCode" column="PROVINCE_CODE"/> |
|||
<result property="cityCode" column="CITY_CODE"/> |
|||
<result property="countyCode" column="COUNTY_CODE"/> |
|||
<result property="longitude" column="LONGITUDE"/> |
|||
<result property="latitude" column="LATITUDE"/> |
|||
</resultMap> |
|||
|
|||
<select id="getCommunityInfoAll" resultType="com.epmet.plugin.power.dto.hik.HikCommunityInfoDTO"> |
|||
select |
|||
* |
|||
from pli_hik_community_info where DEL_FLAG = '0' |
|||
</select> |
|||
|
|||
|
|||
</mapper> |
@ -0,0 +1,25 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.plugin.power.modules.hik.dao.HikDeviceInfoDao"> |
|||
|
|||
<resultMap type="com.epmet.plugin.power.modules.hik.entity.HikDeviceInfoEntity" id="hikDeviceInfoMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="communityId" column="COMMUNITY_ID"/> |
|||
<result property="deviceId" column="DEVICE_ID"/> |
|||
<result property="deviceName" column="DEVICE_NAME"/> |
|||
<result property="deviceModel" column="DEVICE_MODEL"/> |
|||
<result property="deviceSerial" column="DEVICE_SERIAL"/> |
|||
<result property="deviceStatus" column="DEVICE_STATUS"/> |
|||
<result property="devicePath" column="DEVICE_PATH"/> |
|||
</resultMap> |
|||
|
|||
|
|||
</mapper> |
@ -0,0 +1,30 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.plugin.power.modules.hik.dao.HikErrorInfoDao"> |
|||
|
|||
<resultMap type="com.epmet.plugin.power.modules.hik.entity.HikErrorInfoEntity" id="hikErrorInfoMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="idCard" column="ID_CARD"/> |
|||
<result property="errorType" column="ERROR_TYPE"/> |
|||
<result property="errorInfo" column="ERROR_INFO"/> |
|||
</resultMap> |
|||
|
|||
<delete id="deletePhysical"> |
|||
DELETE |
|||
FROM |
|||
pli_hik_error_info |
|||
<where> |
|||
<if test="idCard != null and idCard != ''"> |
|||
AND ID_CARD = #{idCard} |
|||
</if> |
|||
</where> |
|||
</delete> |
|||
</mapper> |
Loading…
Reference in new issue