代码规范修改
This commit is contained in:
parent
ba4cfd3732
commit
0b69e33546
|
|
@ -19,7 +19,41 @@ public class PersonnelControlDto extends ScreenParamDto {
|
|||
@ApiModelProperty(value = "建管单位id")
|
||||
private String orgId;
|
||||
|
||||
@ApiModelProperty(value = "关键字")
|
||||
@ApiModelProperty(value = "设备名称")
|
||||
private String keyWord;
|
||||
|
||||
@ApiModelProperty(value = "围栏名称")
|
||||
private String fencingName;
|
||||
|
||||
@ApiModelProperty(value = "围栏类型")
|
||||
private String fencingType;
|
||||
|
||||
@ApiModelProperty(value = "报警类型")
|
||||
private String alarmType;
|
||||
|
||||
@ApiModelProperty(value = "警戒等级")
|
||||
private String alertType;
|
||||
|
||||
@ApiModelProperty(value = "围栏颜色")
|
||||
private String color;
|
||||
|
||||
@ApiModelProperty(value = "经纬度")
|
||||
private String arrayField;
|
||||
|
||||
@ApiModelProperty(value = "围栏id")
|
||||
private String UUID;
|
||||
|
||||
@ApiModelProperty(value = "经度")
|
||||
private String longitude;
|
||||
|
||||
@ApiModelProperty(value = "纬度")
|
||||
private String latitude;
|
||||
|
||||
@ApiModelProperty(value = "状态")
|
||||
private String status;
|
||||
|
||||
@ApiModelProperty(value = "围栏ID")
|
||||
private String id;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,6 +37,23 @@ public class PersonnelControlVo {
|
|||
@ApiModelProperty("告警内容")
|
||||
private String warningContent;
|
||||
|
||||
@ApiModelProperty("围栏名称")
|
||||
private String fenceName;
|
||||
|
||||
@ApiModelProperty("围栏类型")
|
||||
private String fenceType;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
private String createTime;
|
||||
|
||||
@ApiModelProperty("报警类型")
|
||||
private String alarmType;
|
||||
|
||||
@ApiModelProperty("警戒等级")
|
||||
private String alertType;
|
||||
|
||||
@ApiModelProperty("围栏颜色")
|
||||
private String color;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,5 +70,52 @@ public class PersonnelControlController extends BaseController {
|
|||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/addNewFence", method = RequestMethod.POST)
|
||||
@ApiOperation(value = "人员管控-围栏新增")
|
||||
public AjaxResult addNewFence(@RequestBody PersonnelControlDto dto) {
|
||||
try {
|
||||
int list = service.addNewFence(dto);
|
||||
return AjaxResult.success(list);
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error();
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "人员管控-围栏列表")
|
||||
@GetMapping("getNewFenceList")
|
||||
@Log(title = "围栏列表", menu = "围栏列表->围栏列表", grade = OperationType.QUERY_BUSINESS, details = "查询围栏列表", type = "业务日志")
|
||||
public TableDataInfo getNewFenceList(PersonnelControlDto dto) {
|
||||
try{
|
||||
startLayPage();
|
||||
List<PersonnelControlVo> list = service.getNewFenceList(dto);
|
||||
return getDataTableLayui(list);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
return getDataTableBadLayui(new ArrayList<>(),"请求出错了");
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/subcontractorSwitchListen", method = RequestMethod.POST)
|
||||
@ApiOperation(value = "人员管控-人员列表")
|
||||
public AjaxResult subcontractorSwitchListen(@RequestBody PersonnelControlDto dto) {
|
||||
try {
|
||||
List<PersonnelControlVo> list = service.subcontractorSwitchListen(dto);
|
||||
return AjaxResult.success(list);
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error();
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/delSubcontractorById", method = RequestMethod.POST)
|
||||
@ApiOperation(value = "人员管控-人员列表")
|
||||
public AjaxResult delSubcontractorById(@RequestBody PersonnelControlDto dto) {
|
||||
try {
|
||||
List<PersonnelControlVo> list = service.delSubcontractorById(dto);
|
||||
return AjaxResult.success(list);
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import com.securitycontrol.entity.screen.dto.PersonnelControlDto;
|
|||
import com.securitycontrol.entity.screen.vo.ConstructionQualityVo;
|
||||
import com.securitycontrol.entity.screen.vo.OperatingQualityVo;
|
||||
import com.securitycontrol.entity.screen.vo.PersonnelControlVo;
|
||||
import io.lettuce.core.dynamic.annotation.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -48,4 +49,33 @@ public interface PersonnelControlMapper {
|
|||
* @date 2024/3/27 17:23
|
||||
*/
|
||||
List<PersonnelControlVo> getPersonnelMovementList(PersonnelControlDto dto);
|
||||
|
||||
|
||||
/**
|
||||
* 人员管控-围栏新增
|
||||
*
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @description
|
||||
* @author jjLV
|
||||
* @date 2024/3/27 17:23
|
||||
*/
|
||||
int addNewFence(PersonnelControlDto dto);
|
||||
|
||||
int insertCoordinates(PersonnelControlDto dto);
|
||||
|
||||
/**
|
||||
* 人员管控-围栏列表
|
||||
*
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @description
|
||||
* @author jjLV
|
||||
* @date 2024/3/27 17:23
|
||||
*/
|
||||
List<PersonnelControlVo> getNewFenceList(PersonnelControlDto dto);
|
||||
|
||||
List<PersonnelControlVo> subcontractorSwitchListen(PersonnelControlDto dto);
|
||||
|
||||
List<PersonnelControlVo> delSubcontractorById(PersonnelControlDto dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,6 @@
|
|||
package com.securitycontrol.screen.service;
|
||||
|
||||
import com.securitycontrol.entity.screen.dto.ConstructionQualityDto;
|
||||
import com.securitycontrol.entity.screen.dto.OperatingQualityDto;
|
||||
import com.securitycontrol.entity.screen.dto.PersonnelControlDto;
|
||||
import com.securitycontrol.entity.screen.vo.ConstructionQualityVo;
|
||||
import com.securitycontrol.entity.screen.vo.OperatingQualityVo;
|
||||
import com.securitycontrol.entity.screen.vo.PersonnelControlVo;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -48,4 +44,48 @@ public interface PersonnelControlService {
|
|||
* @date 2024/3/27 17:23
|
||||
*/
|
||||
List<PersonnelControlVo> getPersonnelMovementList(PersonnelControlDto dto);
|
||||
|
||||
/**
|
||||
* 人员管控-围栏新增
|
||||
*
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @description
|
||||
* @author jjLV
|
||||
* @date 2024/3/27 17:23
|
||||
*/
|
||||
int addNewFence(PersonnelControlDto dto);
|
||||
|
||||
/**
|
||||
* 人员管控-围栏列表
|
||||
*
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @description
|
||||
* @author jjLV
|
||||
* @date 2024/3/27 17:23
|
||||
*/
|
||||
List<PersonnelControlVo> getNewFenceList(PersonnelControlDto dto);
|
||||
|
||||
/**
|
||||
* 人员管控-状态更新
|
||||
*
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @description
|
||||
* @author jjLV
|
||||
* @date 2024/3/27 17:23
|
||||
*/
|
||||
List<PersonnelControlVo> subcontractorSwitchListen(PersonnelControlDto dto);
|
||||
|
||||
/**
|
||||
* 人员管控-删除围栏
|
||||
*
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @description
|
||||
* @author jjLV
|
||||
* @date 2024/3/27 17:23
|
||||
*/
|
||||
List<PersonnelControlVo> delSubcontractorById(PersonnelControlDto dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,9 @@
|
|||
package com.securitycontrol.screen.service.impl;
|
||||
|
||||
import com.securitycontrol.entity.screen.dto.ConstructionQualityDto;
|
||||
import com.securitycontrol.entity.screen.dto.OperatingQualityDto;
|
||||
import com.securitycontrol.common.core.utils.uuid.IdUtils;
|
||||
import com.securitycontrol.entity.screen.dto.PersonnelControlDto;
|
||||
import com.securitycontrol.entity.screen.vo.ConstructionQualityVo;
|
||||
import com.securitycontrol.entity.screen.vo.OperatingQualityVo;
|
||||
import com.securitycontrol.entity.screen.vo.PersonnelControlVo;
|
||||
import com.securitycontrol.screen.mapper.OperatingMapper;
|
||||
import com.securitycontrol.screen.mapper.PersonnelControlMapper;
|
||||
import com.securitycontrol.screen.service.OperatingService;
|
||||
import com.securitycontrol.screen.service.PersonnelControlService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -68,4 +63,74 @@ public class PersonnelControlImpl implements PersonnelControlService {
|
|||
public List<PersonnelControlVo> getPersonnelMovementList(PersonnelControlDto dto) {
|
||||
return mapper.getPersonnelMovementList(dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 人员管控-围栏新增
|
||||
*
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @description
|
||||
* @author jjLV
|
||||
* @date 2024/3/27 17:23
|
||||
*/
|
||||
@Override
|
||||
public int addNewFence(PersonnelControlDto dto) {
|
||||
String UUID = IdUtils.getUUId();
|
||||
dto.setUUID(UUID);
|
||||
int result = mapper.addNewFence(dto);
|
||||
int insertResult = 0;
|
||||
if (result > 0) {
|
||||
String[] splitArr = dto.getArrayField().split(",");
|
||||
for (int i = 0; i < splitArr.length; i++) {
|
||||
String[] coordinates = splitArr[i].split("@");
|
||||
dto.setLatitude(coordinates[1]);
|
||||
dto.setLongitude(coordinates[0]);
|
||||
insertResult = mapper.insertCoordinates(dto);
|
||||
|
||||
}
|
||||
}
|
||||
return insertResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* 人员管控-围栏列表
|
||||
*
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @description
|
||||
* @author jjLV
|
||||
* @date 2024/3/27 17:23
|
||||
*/
|
||||
@Override
|
||||
public List<PersonnelControlVo> getNewFenceList(PersonnelControlDto dto) {
|
||||
return mapper.getNewFenceList(dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 人员管控-状态更新
|
||||
*
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @description
|
||||
* @author jjLV
|
||||
* @date 2024/3/27 17:23
|
||||
*/
|
||||
@Override
|
||||
public List<PersonnelControlVo> subcontractorSwitchListen(PersonnelControlDto dto) {
|
||||
return mapper.subcontractorSwitchListen(dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 人员管控-删除围栏
|
||||
*
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @description
|
||||
* @author jjLV
|
||||
* @date 2024/3/27 17:23
|
||||
*/
|
||||
@Override
|
||||
public List<PersonnelControlVo> delSubcontractorById(PersonnelControlDto dto) {
|
||||
return mapper.delSubcontractorById(dto);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,26 @@
|
|||
<?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.securitycontrol.screen.mapper.PersonnelControlMapper">
|
||||
<insert id="addNewFence">
|
||||
INSERT INTO tb_pro_fence
|
||||
(id, fence_name, fence_type, bid_code, create_time, update_time, alarm_type, alert_ype, color)
|
||||
VALUES
|
||||
(#{UUID}, #{fencingName}, #{fencingType}, #{bidCode}, NOW(), NOW(), #{alarmType}, #{alertType}, #{color})
|
||||
</insert>
|
||||
<insert id="insertCoordinates">
|
||||
INSERT INTO tb_fence_detail
|
||||
(id, fence_id, lat, lon, create_time)
|
||||
VALUES
|
||||
(UUID(), #{UUID}, #{latitude}, #{longitude}, NOW())
|
||||
</insert>
|
||||
<update id="subcontractorSwitchListen">
|
||||
UPDATE tb_pro_fence
|
||||
SET status = #{status}
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
<delete id="delSubcontractorById">
|
||||
delete from tb_pro_fence where id = #{id}
|
||||
</delete>
|
||||
|
||||
<!--人员管控-穿戴装备-->
|
||||
<select id="getWearEquipmentList" resultType="com.securitycontrol.entity.screen.vo.PersonnelControlVo">
|
||||
|
|
@ -55,4 +75,24 @@
|
|||
AND tw.bid_code = #{bidCode}
|
||||
AND DATE(tw.warn_time) = CURDATE();
|
||||
</select>
|
||||
<select id="getNewFenceList" resultType="com.securitycontrol.entity.screen.vo.PersonnelControlVo">
|
||||
SELECT
|
||||
tpf.id AS id,
|
||||
tpf.fence_name AS fenceName,
|
||||
sd.dict_name AS fenceType,
|
||||
tpf.create_time AS createTime,
|
||||
sd1.dict_name AS alarmType,
|
||||
sd2.dict_name AS alertType,
|
||||
tpf.color AS color,
|
||||
tpf.status AS status
|
||||
FROM
|
||||
tb_pro_fence tpf
|
||||
LEFT JOIN sys_dict sd ON tpf.fence_type = sd.dict_id
|
||||
LEFT JOIN sys_dict sd1 ON tpf.alarm_type = sd.dict_id
|
||||
LEFT JOIN sys_dict sd2 ON tpf.alert_ype = sd.dict_id
|
||||
WHERE
|
||||
bid_code = #{bidCode}
|
||||
GROUP BY
|
||||
tpf.fence_name
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue