Merge branch 'master' of http://47.109.37.87:3000/by2025/SmartParks
This commit is contained in:
commit
005dbc1110
@ -1,51 +1,66 @@
|
||||
name: Gitea Actions Demo
|
||||
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
|
||||
name: Build and Push Microservices Images
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ] # 当main分支有推送时触发
|
||||
branches:
|
||||
- [main] # 替换为要监听的分支
|
||||
|
||||
jobs:
|
||||
Explore-Gitea-Actions:
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
service:
|
||||
- ruoyi-auth
|
||||
- ruoyi-gateway
|
||||
- ruoyi-modules/Property
|
||||
- ruoyi-modules/ruoyi-gen
|
||||
- ruoyi-modules/ruoyi-job
|
||||
- ruoyi-modules/ruoyi-resource
|
||||
- ruoyi-modules/ruoyi-system
|
||||
- ruoyi-modules/ruoyi-workflow
|
||||
- ruoyi-modules/Sis
|
||||
- ruoyi-visual/ruoyi-monitor
|
||||
- ruoyi-visual/ruoyi-nacos
|
||||
- ruoyi-seata-server
|
||||
- ruoyi-sentinel-dashboard
|
||||
- ruoyi-snailjob-server
|
||||
steps:
|
||||
|
||||
- name: Checkout code
|
||||
uses: http://47.109.37.87:3000/bichangxiong/checkout@v4 # 使用 Gitea 镜像
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set Up JDK
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
fetch-depth: 1 # 只拉取最新一次提交
|
||||
# - name: Checkout code
|
||||
# uses: actions/checkout@v4 # 拉取代码到工作目录
|
||||
- name: Set up JDK 17
|
||||
uses: http://47.109.37.87:3000/bichangxiong/setup-java@v3
|
||||
with:
|
||||
java-version: '17'
|
||||
java-version: '17' # 按项目实际Java版本调整
|
||||
distribution: 'temurin'
|
||||
cache: maven
|
||||
- name: Set up Maven
|
||||
uses: stCarolas/setup-maven@v5
|
||||
with:
|
||||
maven-version: 3.8.2
|
||||
|
||||
- name: Install dependencies
|
||||
run: mvn clean package -DskipTests -Dmaven.repo.local=/home/runner/maven-repo
|
||||
- name: copy file via ssh password
|
||||
uses: appleboy/scp-action@v0.1.7
|
||||
with:
|
||||
host: 192.168.1.3
|
||||
username: root
|
||||
password: by@2025!
|
||||
port: 22
|
||||
source: "ruoyi-modules/Property/target/Property.jar,ruoyi-modules/Property/docker-compose.yml,ruoyi-modules/Property/Dockerfile"
|
||||
target: "/project/runner/plus/"
|
||||
- name: Deploy to server via SSH
|
||||
uses: appleboy/ssh-action@v0.1.7
|
||||
with:
|
||||
host: 192.168.1.3
|
||||
username: root
|
||||
password: by@2025!
|
||||
port: 22
|
||||
script: |
|
||||
cd /project/runner/plus/ruoyi-modules/Property
|
||||
docker-compose up -d --force-recreate
|
||||
- name: Build Project with Maven
|
||||
run: mvn clean package -DskipTests -f ./${{ matrix.service }}/pom.xml
|
||||
|
||||
- name: Set Up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- run: echo "🍏 This job's status is ${{ job.status }}."
|
||||
- name: Login to Gitea Container Registry
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ${{ secrets.REGISTRY_URL }}
|
||||
username: ${{ secrets.REGISTRY_USER }}
|
||||
password: ${{ secrets.REGISTRY_PASS }}
|
||||
|
||||
- name: Determine Dockerfile Path
|
||||
id: dockerfile-path
|
||||
run: |
|
||||
if [ "${{ matrix.service }}" = "ruoyi-visual/ruoyi-nacos" ]; then
|
||||
echo "dockerfile_path=./ruoyi-visual/ruoyi-nacos/Dockerfile" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "dockerfile_path=./${{ matrix.service }}/Dockerfile" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Build and Push Docker Image
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
file: ${{ steps.dockerfile-path.outputs.dockerfile_path }}
|
||||
tags: ${{ secrets.REGISTRY_URL }}/by2025/${{ matrix.service }}:${{ github.sha }}
|
||||
push: true
|
@ -35,6 +35,7 @@ public class PlusWebSocketHandler extends AbstractWebSocketHandler {
|
||||
}
|
||||
WebSocketSessionHolder.addSession(loginUser.getUserId(), session);
|
||||
log.info("[connect] sessionId: {},userId:{},userType:{}", session.getId(), loginUser.getUserId(), loginUser.getUserType());
|
||||
System.out.println(WebSocketSessionHolder.getSessions(loginUser.getUserId()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -26,8 +26,10 @@ public class WebSocketSessionHolder {
|
||||
* @param session 要添加的WebSocket会话
|
||||
*/
|
||||
public static void addSession(Long sessionKey, WebSocketSession session) {
|
||||
System.out.println(USER_SESSION_MAP);
|
||||
removeSession(sessionKey);
|
||||
USER_SESSION_MAP.put(sessionKey, session);
|
||||
System.out.println(USER_SESSION_MAP);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -36,6 +38,7 @@ public class WebSocketSessionHolder {
|
||||
* @param sessionKey 要移除的会话键
|
||||
*/
|
||||
public static void removeSession(Long sessionKey) {
|
||||
System.out.println(USER_SESSION_MAP);
|
||||
WebSocketSession session = USER_SESSION_MAP.remove(sessionKey);
|
||||
try {
|
||||
session.close(CloseStatus.BAD_DATA);
|
||||
@ -50,6 +53,7 @@ public class WebSocketSessionHolder {
|
||||
* @return 与给定会话键对应的WebSocket会话,如果不存在则返回null
|
||||
*/
|
||||
public static WebSocketSession getSessions(Long sessionKey) {
|
||||
System.out.println(USER_SESSION_MAP);
|
||||
return USER_SESSION_MAP.get(sessionKey);
|
||||
}
|
||||
|
||||
|
@ -36,6 +36,7 @@ public class WebSocketUtils {
|
||||
*/
|
||||
public static void sendMessage(Long sessionKey, String message) {
|
||||
WebSocketSession session = WebSocketSessionHolder.getSessions(sessionKey);
|
||||
|
||||
sendMessage(session, message);
|
||||
}
|
||||
|
||||
|
@ -126,6 +126,10 @@
|
||||
<version>2.4.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-common-websocket</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
@ -7,6 +7,7 @@ import java.util.UUID;
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.nacos.api.config.ConfigService;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
@ -14,6 +15,9 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.dromara.common.core.constant.GlobalConstants;
|
||||
import org.dromara.common.redis.utils.RedisUtils;
|
||||
import org.dromara.common.websocket.dto.WebSocketMessageDto;
|
||||
import org.dromara.common.websocket.holder.WebSocketSessionHolder;
|
||||
import org.dromara.common.websocket.utils.WebSocketUtils;
|
||||
import org.dromara.property.domain.bo.QrCodeInfo;
|
||||
import org.dromara.resource.api.RemoteMessageService;
|
||||
import org.dromara.system.api.RemoteConfigService;
|
||||
@ -51,8 +55,6 @@ public class TbVisitorManagementController extends BaseController {
|
||||
@DubboReference
|
||||
private final RemoteConfigService remoteConfigService;
|
||||
|
||||
@DubboReference(stub = "true")
|
||||
private final RemoteMessageService remoteMessageService;
|
||||
|
||||
|
||||
|
||||
@ -97,7 +99,13 @@ public class TbVisitorManagementController extends BaseController {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("type","qrcode");
|
||||
jsonObject.put("date",qrcode);
|
||||
remoteMessageService.publishMessage(List.of(qrCodeInfo.getUserid()),jsonObject.toString());
|
||||
System.out.println(WebSocketSessionHolder.getSessions(1L));
|
||||
System.out.println(WebSocketSessionHolder.getSessionsAll());
|
||||
WebSocketMessageDto webSocketMessage = new WebSocketMessageDto();
|
||||
webSocketMessage.setMessage(jsonObject.toString());
|
||||
webSocketMessage.setSessionKeys(List.of(qrCodeInfo.getUserid()));
|
||||
WebSocketUtils.publishMessage(webSocketMessage);
|
||||
// WebSocketUtils.sendMessage(qrCodeInfo.getUserid(),jsonObject.toString());
|
||||
return R.ok("二维码可用");
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,47 @@
|
||||
package org.dromara.property.controller.mobile;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.property.domain.bo.InspectionPointBo;
|
||||
import org.dromara.property.domain.vo.InspectionPointVo;
|
||||
import org.dromara.property.service.IInspectionPointService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 巡检点
|
||||
* 前端访问路由地址为:/property/point
|
||||
*
|
||||
* @author mocheng
|
||||
* @date 2025-07-11
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/mobile/point")
|
||||
public class MInspectionPointController extends BaseController {
|
||||
|
||||
private final IInspectionPointService inspectionPointService;
|
||||
/**
|
||||
* 扫码签到
|
||||
*/
|
||||
@PostMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody InspectionPointBo bo) {
|
||||
return toAjax(inspectionPointService.updateByBo(bo));
|
||||
}
|
||||
}
|
@ -1,6 +1,4 @@
|
||||
package org.dromara.property.domain;
|
||||
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
@ -97,7 +97,9 @@ public class CostItemsBo extends BaseEntity {
|
||||
/**
|
||||
* 计费单价
|
||||
*/
|
||||
@NotBlank(message = "计费单价", groups = { AddGroup.class, EditGroup.class })
|
||||
@NotNull(message = "计费单价不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
@DecimalMin(value = "0.00", inclusive = false, message = "计费单价必须大于0")
|
||||
@ExcelProperty("计费单价")
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
/**
|
||||
|
@ -7,11 +7,11 @@ package org.dromara.property.domain.enums;
|
||||
**/
|
||||
public enum MeetAttachStatusEnum {
|
||||
/**
|
||||
* 待确认
|
||||
* 上架
|
||||
*/
|
||||
ENAABLE("上架", "0"),
|
||||
/**
|
||||
* 待提货
|
||||
* 下架
|
||||
*/
|
||||
DEACTIVATE("下架", "1");
|
||||
|
||||
|
@ -3,7 +3,7 @@ package org.dromara.property.domain.enums;
|
||||
/**
|
||||
* @Author:yuyongle
|
||||
* @Date:2025/7/4 10:35
|
||||
* @Description:
|
||||
* @Description:会议室状态枚举
|
||||
**/
|
||||
public enum MeetStatusEnum {
|
||||
/**
|
||||
|
@ -0,0 +1,33 @@
|
||||
package org.dromara.property.domain.enums;
|
||||
|
||||
/**
|
||||
* @Author:yuyongle
|
||||
* @Date:2025/8/11 10:59
|
||||
* @Description:工单状态枚举
|
||||
**/
|
||||
public enum WorkOrderStatusEnum {
|
||||
|
||||
CREATE_ORDER("创建工单", "0"),
|
||||
DISPATCHED("已派单", "1"),
|
||||
ROB_ORDER("已抢单", "2"),
|
||||
IN_HAND("处理中", "3"),
|
||||
DONE("已完成", "4"),
|
||||
ABANDON("已废弃", "5");
|
||||
|
||||
|
||||
private final String name;
|
||||
private final String value;
|
||||
|
||||
WorkOrderStatusEnum(String name, String value) {
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return this.value;
|
||||
}
|
||||
}
|
@ -99,9 +99,11 @@ public class CostCarChargeServiceImpl implements ICostCarChargeService {
|
||||
lqw.eq(bo.getFloorId() != null, CostCarCharge::getFloorId, bo.getFloorId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getLocation()), CostCarCharge::getLocation, bo.getLocation());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getState()), CostCarCharge::getState, bo.getState());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getChargeStatus()), CostCarCharge::getChargeStatus, bo.getChargeStatus());
|
||||
lqw.eq(bo.getCostItemsId() != null, CostCarCharge::getCostItemsId, bo.getCostItemsId());
|
||||
lqw.eq(bo.getStarTime() != null, CostCarCharge::getStarTime, bo.getStarTime());
|
||||
lqw.eq(bo.getEndTime() != null, CostCarCharge::getEndTime, bo.getEndTime());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getState()), CostCarCharge::getState, bo.getState());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSearchValue()), CostCarCharge::getSearchValue, bo.getSearchValue());
|
||||
return lqw;
|
||||
}
|
||||
|
@ -78,6 +78,7 @@ public class CostItemsServiceImpl implements ICostItemsService {
|
||||
lqw.orderByAsc(CostItems::getId);
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCostType()), CostItems::getCostType, bo.getCostType());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getChargeItem()), CostItems::getChargeItem, bo.getChargeItem());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getChargeNo()), CostItems::getChargeNo, bo.getChargeNo());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCostMark()), CostItems::getCostMark, bo.getCostMark());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPaymentType()), CostItems::getPaymentType, bo.getPaymentType());
|
||||
lqw.eq(bo.getChargeCycle() != null, CostItems::getChargeCycle, bo.getChargeCycle());
|
||||
|
@ -178,15 +178,16 @@ public class MachineMaintainPlanServiceImpl implements IMachineMaintainPlanServi
|
||||
*/
|
||||
private void validEntityBeforebo(Long id, MachineMaintainPlanBo bo) {
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
Assert.isTrue(CollUtil.isNotEmpty(bo.getMachineMaintainPlanStaffBoList()), "巡检人员不存在");
|
||||
QueryWrapper<MachineMaintainPlanStaff> staffLambdaQueryWrapper = new QueryWrapper<>();
|
||||
staffLambdaQueryWrapper.eq("maintain_plan_id", id);
|
||||
machineMaintainPlanStaffMapper.delete(staffLambdaQueryWrapper);
|
||||
List<MachineMaintainPlanStaffBo> machineMaintainPlanStaffBoList = bo.getMachineMaintainPlanStaffBoList();
|
||||
machineMaintainPlanStaffBoList.stream().forEach(s->{
|
||||
s.setMaintainPlanId(id);
|
||||
});
|
||||
machineMaintainPlanStaffMapper.insertBatch(BeanUtil.copyToList(machineMaintainPlanStaffBoList, MachineMaintainPlanStaff.class));
|
||||
if(CollUtil.isNotEmpty(bo.getMachineMaintainPlanStaffBoList())){
|
||||
QueryWrapper<MachineMaintainPlanStaff> staffLambdaQueryWrapper = new QueryWrapper<>();
|
||||
staffLambdaQueryWrapper.eq("maintain_plan_id", id);
|
||||
machineMaintainPlanStaffMapper.delete(staffLambdaQueryWrapper);
|
||||
List<MachineMaintainPlanStaffBo> machineMaintainPlanStaffBoList = bo.getMachineMaintainPlanStaffBoList();
|
||||
machineMaintainPlanStaffBoList.stream().forEach(s->{
|
||||
s.setMaintainPlanId(id);
|
||||
});
|
||||
machineMaintainPlanStaffMapper.insertBatch(BeanUtil.copyToList(machineMaintainPlanStaffBoList, MachineMaintainPlanStaff.class));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -105,6 +105,7 @@ public class TbVisitorManagementServiceImpl implements ITbVisitorManagementServi
|
||||
@Override
|
||||
public Boolean insertByBo(TbVisitorManagementBo bo) {
|
||||
QrCodeInfo info = RedisUtils.getCacheObject(GlobalConstants.CAPTCHA_CODE_KEY +"Qrcode" + bo.getQrCodeId());
|
||||
RedisUtils.deleteKeys(GlobalConstants.CAPTCHA_CODE_KEY +"Qrcode" + bo.getQrCodeId());
|
||||
TbVisitorManagement add = MapstructUtils.convert(bo, TbVisitorManagement.class);
|
||||
validEntityBeforeSave(add);
|
||||
add.setCreateById(info.getUserid());
|
||||
|
@ -7,6 +7,7 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.property.domain.InspectionPlanStaff;
|
||||
import org.dromara.property.domain.InspectionTask;
|
||||
import org.dromara.property.domain.bo.InspectionPlanBo;
|
||||
@ -41,6 +42,7 @@ import static org.dromara.common.mybatis.core.mapper.BaseMapperPlus.log;
|
||||
* @Date:2025/7/11 15:28
|
||||
* @Description: 巡检任务定时处理器
|
||||
**/
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
//@Validated
|
||||
|
@ -8,6 +8,7 @@ import cn.hutool.core.util.RandomUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.property.domain.MachineMaintainPlanStaff;
|
||||
import org.dromara.property.domain.MachineMaintainTask;
|
||||
import org.dromara.property.domain.bo.MachineMaintainPlanBo;
|
||||
@ -42,6 +43,7 @@ import static org.dromara.common.mybatis.core.mapper.BaseMapperPlus.log;
|
||||
* @Date:2025/7/17 09:25
|
||||
* @Description:
|
||||
**/
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
//@Validated
|
||||
@ -64,6 +66,7 @@ public class MachineTasks {
|
||||
List<MachineMaintainPlanVo> machineMaintainPlanVoList = machineMaintainPlanService.queryList(machineMaintainPlanBo);
|
||||
// 如果没有有效计划,直接返回
|
||||
if (ObjectUtil.isEmpty(machineMaintainPlanVoList)) {
|
||||
log.info("暂时没有有效的计划");
|
||||
return;
|
||||
}
|
||||
machineMaintainPlanVoList.stream().forEach(plan->{
|
||||
|
@ -2,17 +2,31 @@ package org.dromara.property.tasks;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
|
||||
import cn.hutool.core.date.DateUnit;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.property.domain.AttendanceUserGroup;
|
||||
import org.dromara.property.domain.ServiceWorkOrders;
|
||||
import org.dromara.property.domain.ServiceWorkOrdersRecord;
|
||||
import org.dromara.property.domain.enums.WorkOrderStatusEnum;
|
||||
import org.dromara.property.mapper.AttendanceUserGroupMapper;
|
||||
import org.dromara.property.mapper.ServiceWorkOrdersMapper;
|
||||
import org.dromara.property.mapper.ServiceWorkOrdersRecordMapper;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @Author:yuyongle
|
||||
@ -20,23 +34,123 @@ import org.dromara.common.log.annotation.Log;
|
||||
* @Description:自动派单
|
||||
**/
|
||||
@Slf4j
|
||||
@Component
|
||||
//@Component
|
||||
//@RequiredArgsConstructor
|
||||
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/serviceWorkOrderTasks")
|
||||
public class ServiceWorkOrderTasks {
|
||||
private ServiceWorkOrdersMapper workOrdersMapper;
|
||||
private ServiceWorkOrdersRecordMapper workOrdersRecordMapper;
|
||||
private AttendanceUserGroupMapper attendanceUserGroupMapper;
|
||||
|
||||
//查询状态为创建工单的工单
|
||||
/**
|
||||
* 查询状态为创建工单的工单,查询当天排班人员,为工单自动派单
|
||||
*/
|
||||
// @Transactional(rollbackFor = Exception.class)
|
||||
// @Scheduled(cron = "0 0 */1 * * ?")
|
||||
@GetMapping("/serviceWorkOrderTaskId")
|
||||
private void handleServiceWorkOrder() {
|
||||
List<ServiceWorkOrders> serviceWorkOrderList = workOrdersMapper.selectList(
|
||||
new LambdaQueryWrapper<ServiceWorkOrders>()
|
||||
.eq(ServiceWorkOrders::getStatus, "0"));
|
||||
.eq(ServiceWorkOrders::getStatus, WorkOrderStatusEnum.CREATE_ORDER.getValue()));
|
||||
if(CollUtil.isNotEmpty(serviceWorkOrderList)){
|
||||
serviceWorkOrderList.stream().forEach(s->{
|
||||
|
||||
//查询今天上班的人员
|
||||
LocalDate today = LocalDate.now();
|
||||
List<AttendanceUserGroup> attendanceUserGroups = attendanceUserGroupMapper.selectList(
|
||||
new LambdaQueryWrapper<AttendanceUserGroup>()
|
||||
.eq(AttendanceUserGroup::getStartDate, today)
|
||||
);
|
||||
if(CollUtil.isNotEmpty(attendanceUserGroups)){
|
||||
attendanceUserGroups.stream().forEach(s1->{
|
||||
ServiceWorkOrdersRecord serviceWorkOrdersRecord = new ServiceWorkOrdersRecord();
|
||||
serviceWorkOrdersRecord.setOrderId(s.getId());
|
||||
serviceWorkOrdersRecord.setStatus(WorkOrderStatusEnum.DISPATCHED.getValue());
|
||||
serviceWorkOrdersRecord.setHandler(s1.getEmployeeId());
|
||||
workOrdersRecordMapper.insert(serviceWorkOrdersRecord);
|
||||
s.setStatus(WorkOrderStatusEnum.DISPATCHED.getValue());
|
||||
s.setHandler(s1.getEmployeeId());
|
||||
workOrdersMapper.updateById(s);
|
||||
log.info("派单工单号为:{}",s.getOrderNo());
|
||||
log.info("处理人为:{}",s1.getEmployeeId());
|
||||
});
|
||||
}else {
|
||||
log.info("当天无排班人员");
|
||||
}
|
||||
});
|
||||
}else {
|
||||
log.info("派单工单为:{}",serviceWorkOrderList.size());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理超过30分钟的工单
|
||||
*/
|
||||
// @Transactional(rollbackFor = Exception.class)
|
||||
// @Scheduled(cron = "0 0 */1 * * ?")
|
||||
@GetMapping("/thirtyWorkOrderTaskId")
|
||||
private void thirtyHandleServiceWorkOrder() {
|
||||
// 1. 查询当前状态为“已派单”的工单
|
||||
List<ServiceWorkOrders> serviceWorkOrderList = workOrdersMapper.selectList(
|
||||
new LambdaQueryWrapper<ServiceWorkOrders>()
|
||||
.eq(ServiceWorkOrders::getStatus, WorkOrderStatusEnum.DISPATCHED.getValue())
|
||||
);
|
||||
LocalDate today = LocalDate.now();
|
||||
// 2. 查询今天有排班的人员
|
||||
List<AttendanceUserGroup> attendanceUserGroups = attendanceUserGroupMapper.selectList(
|
||||
new LambdaQueryWrapper<AttendanceUserGroup>()
|
||||
.eq(AttendanceUserGroup::getStartDate, today)
|
||||
);
|
||||
if (CollUtil.isEmpty(serviceWorkOrderList) || CollUtil.isEmpty(attendanceUserGroups)) {
|
||||
log.info("当前无可处理的超时工单或今日无排班人员");
|
||||
return;
|
||||
}
|
||||
Date now = new Date();
|
||||
// 3. 遍历超时工单
|
||||
serviceWorkOrderList.forEach(workOrder -> {
|
||||
// 查询该工单的最新记录(可能有多条记录)
|
||||
ServiceWorkOrdersRecord latestRecord = workOrdersRecordMapper.selectOne(
|
||||
new LambdaQueryWrapper<ServiceWorkOrdersRecord>()
|
||||
.eq(ServiceWorkOrdersRecord::getOrderId, workOrder.getId())
|
||||
.orderByDesc(ServiceWorkOrdersRecord::getCreateTime)
|
||||
.last("LIMIT 1") // 获取最新一条记录
|
||||
);
|
||||
if (ObjectUtil.isEmpty(latestRecord) || latestRecord.getCreateTime() == null) {
|
||||
return;
|
||||
}
|
||||
// 判断是否超过30分钟
|
||||
long minutesElapsed = DateUtil.between(latestRecord.getCreateTime(), now, DateUnit.MINUTE);
|
||||
if (minutesElapsed <= 30) {
|
||||
return; // 未超时,跳过
|
||||
}
|
||||
// 4. 标记原记录为废弃
|
||||
latestRecord.setStatus(WorkOrderStatusEnum.ABANDON.getValue());
|
||||
workOrdersRecordMapper.updateById(latestRecord);
|
||||
log.info("工单号:{} 的原记录已废弃,超时未处理", workOrder.getOrderNo());
|
||||
// 5. 重新派单给今天所有排班人员(排除原处理人?根据业务决定)
|
||||
boolean hasNewDispatch = false;
|
||||
for (AttendanceUserGroup group : attendanceUserGroups) {
|
||||
Long employeeId = group.getEmployeeId();
|
||||
// 可选:避免重新派给原处理人
|
||||
if (employeeId.equals(latestRecord.getHandler())) {
|
||||
log.debug("跳过原处理人:{}", employeeId);
|
||||
continue;
|
||||
}
|
||||
// 创建新的派单记录
|
||||
ServiceWorkOrdersRecord newRecord = new ServiceWorkOrdersRecord();
|
||||
newRecord.setOrderId(workOrder.getId());
|
||||
newRecord.setHandler(employeeId);
|
||||
newRecord.setStatus(WorkOrderStatusEnum.DISPATCHED.getValue());
|
||||
newRecord.setCreateTime(now);
|
||||
workOrdersRecordMapper.insert(newRecord);
|
||||
log.info("工单号:{} 已重新派发给员工ID:{}", workOrder.getOrderNo(), employeeId);
|
||||
// 6. 更新主工单状态(可选:若只保留最新记录状态,也可不更新主表)
|
||||
workOrder.setStatus(WorkOrderStatusEnum.DISPATCHED.getValue()); // 仍为已派单
|
||||
workOrder.setHandler(employeeId); // 可清空,或设为最后一个人(根据业务)
|
||||
workOrdersMapper.updateById(workOrder);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -2,12 +2,15 @@ package org.dromara.sis.controller;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.sis.sdk.unview.model.UvModel;
|
||||
import org.dromara.sis.sdk.unview.service.VideoAlarmService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* 宇视告警书记上报
|
||||
*
|
||||
@ -32,8 +35,9 @@ public class VideoAlarmController {
|
||||
}
|
||||
|
||||
@PostMapping("/huawei/callback")
|
||||
public void huaweiAlarm(@RequestBody Object data) {
|
||||
log.info("华为上报消息,msg={}", data);
|
||||
public void huaweiAlarm(HttpServletRequest request) throws IOException {
|
||||
int read = request.getInputStream().read();
|
||||
log.info("华为上报消息,msg={}", read);
|
||||
}
|
||||
|
||||
|
||||
|
@ -135,4 +135,10 @@ public class SisElevatorInfo extends TenantEntity {
|
||||
*/
|
||||
private Long unitId;
|
||||
|
||||
/**
|
||||
* 是否允许控制
|
||||
*/
|
||||
private Boolean isControl;
|
||||
|
||||
|
||||
}
|
||||
|
@ -143,6 +143,11 @@ public class SisElevatorInfoBo extends BaseEntity {
|
||||
*/
|
||||
private Long unitId;
|
||||
|
||||
/**
|
||||
* 是否允许控制
|
||||
*/
|
||||
private Boolean isControl;
|
||||
|
||||
/**
|
||||
* 绑定的远程呼梯设备
|
||||
*/
|
||||
|
@ -29,10 +29,10 @@ public class SisPersonLibImgBo extends BaseEntity {
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 人员库编码
|
||||
* 人员标签
|
||||
*/
|
||||
@NotEmpty(message = "人像库id不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private Collection<Long> libIds;
|
||||
@NotNull(message = "人员标签不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private Integer rosterType;
|
||||
|
||||
/**
|
||||
* 人像名称
|
||||
@ -90,10 +90,4 @@ public class SisPersonLibImgBo extends BaseEntity {
|
||||
* 图片MD5
|
||||
*/
|
||||
private String imgMd5Value;
|
||||
|
||||
/**
|
||||
* 人员标签
|
||||
*/
|
||||
private Integer rosterType;
|
||||
|
||||
}
|
||||
|
@ -56,16 +56,6 @@ public class SisDeviceManageVo implements Serializable {
|
||||
@ExcelProperty(value = "设备")
|
||||
private String deviceMac;
|
||||
|
||||
/**
|
||||
* 设备账号
|
||||
*/
|
||||
private String deviceAccount;
|
||||
|
||||
/**
|
||||
* 设备密码
|
||||
*/
|
||||
private String devicePwd;
|
||||
|
||||
/**
|
||||
* 设备类型
|
||||
*/
|
||||
|
@ -156,6 +156,11 @@ public class SisElevatorInfoVo implements Serializable {
|
||||
*/
|
||||
private Long unitId;
|
||||
|
||||
/**
|
||||
* 是否允许控制
|
||||
*/
|
||||
private Boolean isControl;
|
||||
|
||||
/**
|
||||
* 呼梯摄像头
|
||||
*/
|
||||
|
@ -85,12 +85,6 @@ public class SisPersonLibImgVo implements Serializable {
|
||||
@ExcelProperty(value = "远程库图像ID")
|
||||
private Long remoteHWId;
|
||||
|
||||
/**
|
||||
* 人像库id
|
||||
*/
|
||||
@ExcelProperty(value = "人像库id")
|
||||
private Collection<Long> libIds;
|
||||
|
||||
/**
|
||||
* 入驻员工id
|
||||
*/
|
||||
|
@ -9,8 +9,7 @@ import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.dromara.common.core.utils.SpringUtils;
|
||||
import org.dromara.property.api.RemoteFloorService;
|
||||
import org.dromara.property.api.domain.vo.RemoteFloorVo;
|
||||
import org.dromara.sis.domain.bo.SisDeviceManageBo;
|
||||
import org.dromara.sis.domain.vo.SisDeviceManageVo;
|
||||
import org.dromara.sis.domain.SisDeviceManage;
|
||||
import org.dromara.sis.domain.vo.SisElevatorInfoVo;
|
||||
import org.dromara.sis.sdk.hik.HikApiService;
|
||||
import org.dromara.sis.sdk.hik.calback.HikAlarmCallBack;
|
||||
@ -78,7 +77,7 @@ public class HikDeviceApplicationRunner implements ApplicationRunner {
|
||||
|
||||
@Async
|
||||
public void hikNetCameraLogin() {
|
||||
List<SisDeviceManageVo> deviceList = deviceManageService.queryList(new SisDeviceManageBo());
|
||||
List<SisDeviceManage> deviceList = deviceManageService.queryHikDevices();
|
||||
if (CollUtil.isEmpty(deviceList)) {
|
||||
log.info("没有查询到摄像设备信息,不执行登录");
|
||||
return;
|
||||
|
@ -1,6 +1,5 @@
|
||||
package org.dromara.sis.sdk.e8;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.sis.sdk.e8.domain.QueryDto;
|
||||
import org.dromara.sis.sdk.e8.domain.accessControl.req.CustomerAuthAddReq;
|
||||
@ -20,6 +19,8 @@ import org.dromara.sis.sdk.e8.domain.door.res.DoorDeviceFindRes;
|
||||
import org.dromara.sis.sdk.e8.domain.lift.req.LiftAddReq;
|
||||
import org.dromara.sis.sdk.e8.domain.lift.req.LiftUpdateReq;
|
||||
import org.dromara.sis.sdk.e8.domain.lift.res.LiftFindRes;
|
||||
import org.dromara.sis.sdk.e8.domain.visitors.req.VisitorAddReq;
|
||||
import org.dromara.sis.sdk.e8.domain.visitors.res.VisitorAddRes;
|
||||
import org.dromara.sis.sdk.e8.domain.voucher.req.ChangeCardReq;
|
||||
import org.dromara.sis.sdk.e8.domain.voucher.req.IssueVoucherReq;
|
||||
import org.dromara.sis.sdk.e8.domain.voucher.req.OperateVoucherReq;
|
||||
@ -34,6 +35,7 @@ import java.util.List;
|
||||
public interface E8PlatformApi {
|
||||
|
||||
//***************************************客户信息接口*******************************************/
|
||||
|
||||
/**
|
||||
* 查询单个人员信息
|
||||
*
|
||||
@ -46,9 +48,9 @@ public interface E8PlatformApi {
|
||||
* 人员信息分页查询
|
||||
*
|
||||
* @param dto 传参
|
||||
* @return IPage<CustomFindRes>
|
||||
* @return TableDataInfo<CustomFindRes>
|
||||
*/
|
||||
IPage<CustomFindRes> findCustomerList(QueryDto dto);
|
||||
TableDataInfo<CustomFindRes> findCustomerList(QueryDto dto);
|
||||
|
||||
/**
|
||||
* 新增人员信息
|
||||
@ -75,6 +77,7 @@ public interface E8PlatformApi {
|
||||
Boolean deleteCustomer(Long id);
|
||||
|
||||
//***************************************门禁信息接口*******************************************
|
||||
|
||||
/**
|
||||
* 查询门禁信息
|
||||
*
|
||||
@ -156,13 +159,14 @@ public interface E8PlatformApi {
|
||||
TableDataInfo<CustomerAuthFindRes> getPageCustomerAuth(QueryDto dto);
|
||||
|
||||
//***************************************电梯信息接口*******************************************
|
||||
|
||||
/**
|
||||
* 电梯信息分页查询
|
||||
*
|
||||
* @param dto 传参
|
||||
* @return IPage<LiftFindRes>
|
||||
* @return TableDataInfo<LiftFindRes>
|
||||
*/
|
||||
IPage<LiftFindRes> getPageList(QueryDto dto);
|
||||
TableDataInfo<LiftFindRes> getPageList(QueryDto dto);
|
||||
|
||||
/**
|
||||
* 查询电梯楼层
|
||||
@ -197,6 +201,7 @@ public interface E8PlatformApi {
|
||||
Boolean deleteLift(Integer id);
|
||||
|
||||
//***************************************凭证信息接口*******************************************
|
||||
|
||||
/**
|
||||
* 发行凭证
|
||||
*
|
||||
@ -228,4 +233,22 @@ public interface E8PlatformApi {
|
||||
* @return imageUrl 人脸图片地址
|
||||
*/
|
||||
String uploadFace(byte[] imageByte);
|
||||
|
||||
//***************************************访客信息接口*******************************************
|
||||
|
||||
/**
|
||||
* 新增访客登记
|
||||
*
|
||||
* @param req 入参
|
||||
* @return VisitorAddRes
|
||||
*/
|
||||
VisitorAddRes addVisitor(VisitorAddReq req);
|
||||
|
||||
/**
|
||||
* 获取访客二维码
|
||||
*
|
||||
* @param ids 访客ids
|
||||
* @return VisitorAddRes
|
||||
*/
|
||||
VisitorAddRes getVisitorQrCode(List<Long> ids);
|
||||
}
|
||||
|
@ -2,9 +2,6 @@ package org.dromara.sis.sdk.e8.domain.custom.res;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
import org.dromara.sis.sdk.e8.domain.enums.AreaTypeEnum;
|
||||
import org.dromara.sis.sdk.e8.domain.enums.UserTypeEnum;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -467,16 +464,6 @@ public class CustomFindRes {
|
||||
*/
|
||||
private String areaName;
|
||||
|
||||
/**
|
||||
* 用户类型
|
||||
*/
|
||||
private UserTypeEnum userType;
|
||||
|
||||
/**
|
||||
* 区域类型
|
||||
*/
|
||||
private AreaTypeEnum areaType;
|
||||
|
||||
/**
|
||||
* 区域类型描述
|
||||
*/
|
||||
|
@ -1,45 +0,0 @@
|
||||
package org.dromara.sis.sdk.e8.domain.enums;
|
||||
|
||||
/**
|
||||
* @author lsm
|
||||
* @apiNote AreaTypeEnum
|
||||
* @since 2025/5/26 21:22
|
||||
*/
|
||||
public enum AreaTypeEnum {
|
||||
// 枚举值,括号中是对应的编号和描述
|
||||
REGION(0, "区域"),
|
||||
BUILDING(1, "楼栋"),
|
||||
HOUSE(2, "房屋"),
|
||||
DOOR(3, "门"),
|
||||
FLOOR(4, "楼层");
|
||||
|
||||
// 定义私有变量,用于存储编号和描述
|
||||
private final int code;
|
||||
private final String description;
|
||||
|
||||
// 构造方法,用于初始化每个枚举值的编号和描述
|
||||
AreaTypeEnum(int code, String description) {
|
||||
this.code = code;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
// 获取编号的方法
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
// 获取描述的方法
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
// 根据编号获取对应的枚举值
|
||||
public static AreaTypeEnum getByCode(int code) {
|
||||
for (AreaTypeEnum areaType : AreaTypeEnum.values()) {
|
||||
if (areaType.getCode() == code) {
|
||||
return areaType;
|
||||
}
|
||||
}
|
||||
return null; // 如果没有找到匹配的编号,返回 null
|
||||
}
|
||||
}
|
@ -1,50 +0,0 @@
|
||||
package org.dromara.sis.sdk.e8.domain.enums;
|
||||
|
||||
/**
|
||||
* @author zcxlsm
|
||||
* @apiNote UserEnumType
|
||||
* @since 2025/5/26 21:16
|
||||
*/
|
||||
public enum UserTypeEnum {
|
||||
// 枚举值,括号中是对应的编号和描述
|
||||
OWNER(0, "业主"),
|
||||
FAMILY_MEMBER(1, "家属"),
|
||||
TENANT(2, "租客"),
|
||||
EMPLOYEE(3, "员工"),
|
||||
BUSINESS_OWNER(4, "企业主"),
|
||||
STAFF(11, "职员"),
|
||||
TEMPORARY_PERSONNEL(12, "临时人员"),
|
||||
HOUSEHOLD_HEAD(13, "户主"),
|
||||
EXTERNAL_PERSONNEL(14, "外部人员"),
|
||||
OTHER_PERSONNEL(100, "其他人员");
|
||||
|
||||
// 定义私有变量,用于存储编号和描述
|
||||
private final int code;
|
||||
private final String description;
|
||||
|
||||
// 构造方法,用于初始化每个枚举值的编号和描述
|
||||
UserTypeEnum(int code, String description) {
|
||||
this.code = code;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
// 获取编号的方法
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
// 获取描述的方法
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
// 根据编号获取对应的枚举值
|
||||
public static UserTypeEnum getByCode(int code) {
|
||||
for (UserTypeEnum userType : UserTypeEnum.values()) {
|
||||
if (userType.getCode() == code) {
|
||||
return userType;
|
||||
}
|
||||
}
|
||||
return null; // 如果没有找到匹配的编号,返回 null
|
||||
}
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
package org.dromara.sis.sdk.e8.domain.visitors.req;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author lsm
|
||||
* @apiNote VisitorAddReq
|
||||
* @since 2025/8/12
|
||||
*/
|
||||
@Data
|
||||
public class VisitorAddReq {
|
||||
|
||||
/**
|
||||
* 访客名称
|
||||
*/
|
||||
private String visitorName;
|
||||
|
||||
/**
|
||||
* 手机号码
|
||||
*/
|
||||
private String mobilePhone;
|
||||
|
||||
/**
|
||||
* 被访人手机号
|
||||
*/
|
||||
private String intervieweeMobile;
|
||||
|
||||
/**
|
||||
* 授权开始时间
|
||||
*/
|
||||
private String visitorStartTime;
|
||||
|
||||
/**
|
||||
* 授权结束时间
|
||||
*/
|
||||
private String vistorEndTime;
|
||||
|
||||
/**
|
||||
* 访客登记类型 0:登记 1:邀请 2:预约
|
||||
*/
|
||||
private Integer visitorRegisterType = 1;
|
||||
|
||||
/**
|
||||
* 访客登记来源 0:E8平台 1:访客机 2:小程序
|
||||
*/
|
||||
private Integer reservedField1 = 0;
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
package org.dromara.sis.sdk.e8.domain.visitors.res;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author lsm
|
||||
* @apiNote VisitorAddRes
|
||||
* @since 2025/8/12
|
||||
*/
|
||||
@Data
|
||||
public class VisitorAddRes {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 访客Id
|
||||
*/
|
||||
private Long visitorId;
|
||||
|
||||
/**
|
||||
* 访客编号
|
||||
*/
|
||||
private String visitorNo;
|
||||
|
||||
/**
|
||||
* 访客姓名
|
||||
*/
|
||||
private String visitorName;
|
||||
|
||||
/**
|
||||
* 被访人
|
||||
*/
|
||||
private String intervieweeName;
|
||||
|
||||
/**
|
||||
* 授权门名称(多个以;分隔) 用于打印二维码显示用
|
||||
*/
|
||||
private String itemNames;
|
||||
|
||||
/**
|
||||
* 授权门名称(多个以;分隔) 用于打印二维码显示用
|
||||
*/
|
||||
private String areaNames;
|
||||
|
||||
/**
|
||||
* 二维码加密字符串
|
||||
*/
|
||||
private String qrCodeStr;
|
||||
}
|
@ -3,8 +3,6 @@ package org.dromara.sis.sdk.e8.service;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.lang.TypeReference;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
@ -32,6 +30,8 @@ import org.dromara.sis.sdk.e8.domain.lift.req.LiftAddReq;
|
||||
import org.dromara.sis.sdk.e8.domain.lift.req.LiftFindReq;
|
||||
import org.dromara.sis.sdk.e8.domain.lift.req.LiftUpdateReq;
|
||||
import org.dromara.sis.sdk.e8.domain.lift.res.LiftFindRes;
|
||||
import org.dromara.sis.sdk.e8.domain.visitors.req.VisitorAddReq;
|
||||
import org.dromara.sis.sdk.e8.domain.visitors.res.VisitorAddRes;
|
||||
import org.dromara.sis.sdk.e8.domain.voucher.req.ChangeCardReq;
|
||||
import org.dromara.sis.sdk.e8.domain.voucher.req.IssueVoucherReq;
|
||||
import org.dromara.sis.sdk.e8.domain.voucher.req.OperateVoucherReq;
|
||||
@ -94,7 +94,7 @@ public class E8PlatformApiService implements E8PlatformApi {
|
||||
* @return IPage<CustomerInfo>
|
||||
*/
|
||||
@Override
|
||||
public IPage<CustomFindRes> findCustomerList(QueryDto dto) {
|
||||
public TableDataInfo<CustomFindRes> findCustomerList(QueryDto dto) {
|
||||
// 创建参数映射,用于存储HTTP请求的参数
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
// 添加分页参数:当前页码和最大结果数量
|
||||
@ -117,14 +117,14 @@ public class E8PlatformApiService implements E8PlatformApi {
|
||||
Map<String, Object> result = JSONUtil.toBean(JSONUtil.toJsonStr(apiResp.getResult()), new TypeReference<>() {
|
||||
}, false);
|
||||
// 创建一个分页对象,用于存储客户信息列表和分页数据
|
||||
IPage<CustomFindRes> pageInfo = new Page<>(dto.getPageIndex(), dto.getMaxResultCount());
|
||||
TableDataInfo<CustomFindRes> tableDataInfo = new TableDataInfo<>();
|
||||
// 设置总记录数
|
||||
pageInfo.setTotal(Long.parseLong(result.get("total").toString()));
|
||||
tableDataInfo.setTotal(Long.parseLong(result.get("total").toString()));
|
||||
// 将API响应结果中的客户信息列表转换为CustomFindRes对象列表,并设置到分页对象中
|
||||
pageInfo.setRecords(JSONUtil.toList(JSONUtil.toJsonStr(result.get("item")), CustomFindRes.class));
|
||||
tableDataInfo.setRows(JSONUtil.toList(JSONUtil.toJsonStr(result.get("item")), CustomFindRes.class));
|
||||
|
||||
// 返回分页对象
|
||||
return pageInfo;
|
||||
return tableDataInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -494,10 +494,10 @@ public class E8PlatformApiService implements E8PlatformApi {
|
||||
* 电梯信息分页查询
|
||||
*
|
||||
* @param dto 传参
|
||||
* @return IPage<LiftFindRes>
|
||||
* @return TableDataInfo<LiftFindRes>
|
||||
*/
|
||||
@Override
|
||||
public IPage<LiftFindRes> getPageList(QueryDto dto) {
|
||||
public TableDataInfo<LiftFindRes> getPageList(QueryDto dto) {
|
||||
// 创建一个参数映射,用于存储API请求所需的参数
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
// 将分页索引和最大结果数放入参数映射中
|
||||
@ -517,14 +517,14 @@ public class E8PlatformApiService implements E8PlatformApi {
|
||||
Map<String, Object> result = JSONUtil.toBean(JSONUtil.toJsonStr(apiResp.getResult()), new TypeReference<>() {
|
||||
}, false);
|
||||
// 创建一个分页对象,传入分页索引和最大结果数
|
||||
IPage<LiftFindRes> page = new Page<>(dto.getPageIndex(), dto.getMaxResultCount());
|
||||
TableDataInfo<LiftFindRes> tableDataInfo = new TableDataInfo<>();
|
||||
// 设置分页对象的总记录数
|
||||
page.setTotal(Long.parseLong(result.get("total").toString()));
|
||||
tableDataInfo.setTotal(Long.parseLong(result.get("total").toString()));
|
||||
// 将结果中的项转换为LiftFindRes列表,并设置为分页对象的记录
|
||||
page.setRecords(JSONUtil.toList(JSONUtil.toJsonStr(result.get("item")), LiftFindRes.class));
|
||||
tableDataInfo.setRows(JSONUtil.toList(JSONUtil.toJsonStr(result.get("item")), LiftFindRes.class));
|
||||
|
||||
// 返回填充了数据的分页对象
|
||||
return page;
|
||||
return tableDataInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -694,4 +694,59 @@ public class E8PlatformApiService implements E8PlatformApi {
|
||||
|
||||
return apiResp.getMessage();
|
||||
}
|
||||
|
||||
//***************************************电梯信息接口*******************************************
|
||||
private static final String VISITOR_CREATE = "/api/E8Door/visitor-registration";
|
||||
private static final String VISITOR_QRCODE = "/api/E8Door/visitor-registration/get-visitor-print-content";
|
||||
|
||||
/**
|
||||
* 新增访客登记
|
||||
*
|
||||
* @param req 入参
|
||||
* @return VisitorAddRes
|
||||
*/
|
||||
@Override
|
||||
public VisitorAddRes addVisitor(VisitorAddReq req) {
|
||||
// 将添加请求对象转换为Map对象,以便后续API调用
|
||||
Map<String, Object> params = BeanUtil.beanToMap(req);
|
||||
|
||||
// 执行客户创建API调用,并获取API响应对象
|
||||
ApiResp apiResp = e8ApiUtil.doPost(params, VISITOR_CREATE);
|
||||
|
||||
// 检查API调用是否成功
|
||||
if (!apiResp.getSuccess()) {
|
||||
log.error("E8新增访客信息失败 errorMsg:{}", apiResp);
|
||||
// 如果API调用失败,返回null
|
||||
return null;
|
||||
}
|
||||
|
||||
// 返回API调用是否成功的标志
|
||||
return JSONUtil.toBean(JSONUtil.toJsonStr(apiResp.getResult()), VisitorAddRes.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取访客二维码
|
||||
*
|
||||
* @param ids 访客ids
|
||||
* @return String
|
||||
*/
|
||||
@Override
|
||||
public VisitorAddRes getVisitorQrCode(List<Long> ids) {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("ids", ids);
|
||||
|
||||
// 执行客户创建API调用,并获取API响应对象
|
||||
ApiResp apiResp = e8ApiUtil.doPost(params, VISITOR_QRCODE);
|
||||
|
||||
// 检查API调用是否成功
|
||||
if (!apiResp.getSuccess()) {
|
||||
log.error("E8获取访客二维码失败 errorMsg:{}", apiResp);
|
||||
// 如果API调用失败,返回null
|
||||
return null;
|
||||
}
|
||||
|
||||
// 返回API调用是否成功的标志
|
||||
return JSONUtil.toList(JSONUtil.toJsonStr(apiResp.getResult()), VisitorAddRes.class).get(0);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package org.dromara.sis.sdk.e8.utils;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.crypto.digest.DigestUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.http.HttpResponse;
|
||||
@ -58,10 +59,8 @@ public class E8ApiUtil {
|
||||
jsonBody = JSONUtil.toJsonStr(params);
|
||||
}
|
||||
|
||||
// url
|
||||
String url = BASE_URL + api;
|
||||
|
||||
|
||||
// 对请求体进行Base64加密,指定UTF-8编码,避免乱码
|
||||
String base64Body = Base64.getEncoder().encodeToString(jsonBody.getBytes(StandardCharsets.UTF_8));
|
||||
|
||||
@ -156,8 +155,14 @@ public class E8ApiUtil {
|
||||
*/
|
||||
public String getPostSign(Map<String, Object> params, String api, String timestamp) {
|
||||
String url = BASE_URL + api;
|
||||
|
||||
// one&two
|
||||
String paramsUrl = buildUrlWithParams(url, params) + "×tamp=" + timestamp;
|
||||
String paramsUrl;
|
||||
if (StrUtil.equals(url, buildUrlWithParams(url, params))){
|
||||
paramsUrl = url + "timestamp=" + timestamp;
|
||||
}else {
|
||||
paramsUrl = buildUrlWithParams(url, params) + "×tamp=" + timestamp;
|
||||
}
|
||||
// three
|
||||
String upperUrl = paramsUrl.toUpperCase();
|
||||
// four
|
||||
|
@ -280,10 +280,9 @@ public class HikAlarmCallBack implements HCNetSDK.FMSGCallBack_V31 {
|
||||
buffers1.get(bigImg);
|
||||
//设备ip
|
||||
String sAlarmInfo = new String(pAlarmer.sDeviceIP).trim();
|
||||
log.info("海康设备告警信息上传,设备={}, 人脸图片大小={}, 背景图片大小={}", sAlarmInfo, smallImg.length, bigImg.length);
|
||||
|
||||
SisDeviceManage device = sisDeviceManageService.queryByDeviceIp(sAlarmInfo);
|
||||
if (!device.getIsComparison()) {
|
||||
log.info("海康设备告警信息上传,设备={}, 人脸图片大小={}, 背景图片大小={}", sAlarmInfo, smallImg.length, bigImg.length);
|
||||
zeroSensationPassageService.pass(sAlarmInfo, smallImg, bigImg);
|
||||
}
|
||||
}
|
||||
@ -321,7 +320,7 @@ public class HikAlarmCallBack implements HCNetSDK.FMSGCallBack_V31 {
|
||||
|
||||
log.info("比对结果:{},相似度:{},人员:{},id:{}", compareResults, similarity, name, pid);
|
||||
log.info("处理前置人脸比对结果,耗时:{}", interval.interval());
|
||||
zeroSensationPassageService.handleEleOut(new String(pAlarmer.sDeviceIP).trim(), interval);
|
||||
zeroSensationPassageService.handleEleOut(new String(pAlarmer.sDeviceIP).trim());
|
||||
}
|
||||
|
||||
|
||||
|
@ -37,7 +37,7 @@ public class ElevatorControlTcpUtil {
|
||||
|
||||
/**
|
||||
* -- SETTER --
|
||||
* 设置连接状态监听器
|
||||
* 设置连接状态监听器
|
||||
*/
|
||||
// 连接状态监听器
|
||||
@Setter
|
||||
@ -203,7 +203,6 @@ public class ElevatorControlTcpUtil {
|
||||
|
||||
// 设置100ms超时
|
||||
clientSocket.setSoTimeout(100);
|
||||
|
||||
byte[] response = new byte[FRAME_LENGTH];
|
||||
int bytesRead = 0;
|
||||
while (bytesRead < FRAME_LENGTH) {
|
||||
@ -266,17 +265,25 @@ public class ElevatorControlTcpUtil {
|
||||
}
|
||||
|
||||
private byte[] buildFrame(byte command, byte[] floorData) {
|
||||
byte[] frame = new byte[FRAME_LENGTH];
|
||||
if (floorData.length != 7) {
|
||||
throw new IllegalArgumentException("楼层数据必须为7字节");
|
||||
}
|
||||
|
||||
byte[] frame = new byte[10]; // 10字节帧
|
||||
// 帧头
|
||||
frame[0] = command;
|
||||
// 地址
|
||||
frame[1] = FIXED_ADDRESS;
|
||||
// 数据部分(7字节)
|
||||
System.arraycopy(floorData, 0, frame, 2, 7);
|
||||
|
||||
// 计算校验和(从帧头到数据结束)
|
||||
byte checksum = 0;
|
||||
for (int i = 0; i < 9; i++) {
|
||||
for (int i = 0; i < 9; i++) { // 前9字节求和
|
||||
checksum = (byte) (checksum + frame[i]);
|
||||
}
|
||||
// 帧尾(校验和)
|
||||
frame[9] = checksum;
|
||||
|
||||
return frame;
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,6 @@ public interface IZeroSensationPassageService {
|
||||
*
|
||||
* @param deviceIp 设备ip
|
||||
*/
|
||||
void handleEleOut(String deviceIp, TimeInterval interval);
|
||||
void handleEleOut(String deviceIp);
|
||||
|
||||
}
|
||||
|
@ -13,7 +13,6 @@ import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.resource.api.RemoteFileService;
|
||||
import org.dromara.sis.domain.SisPersonLibImg;
|
||||
import org.dromara.sis.domain.bo.SisLibImgRefBo;
|
||||
import org.dromara.sis.domain.bo.SisPersonLibImgBo;
|
||||
import org.dromara.sis.domain.vo.*;
|
||||
import org.dromara.sis.mapper.SisPersonLibImgMapper;
|
||||
@ -38,7 +37,6 @@ public class SisPersonLibImgServiceImpl implements ISisPersonLibImgService {
|
||||
private final SisPersonLibImgMapper baseMapper;
|
||||
|
||||
private final HuaWeiBoxApi huaWeiBoxApi;
|
||||
private final ISisLibImgRefService sisLibImgRefService;
|
||||
|
||||
@DubboReference
|
||||
private RemoteFileService remoteFileService;
|
||||
@ -51,15 +49,7 @@ public class SisPersonLibImgServiceImpl implements ISisPersonLibImgService {
|
||||
*/
|
||||
@Override
|
||||
public SisPersonLibImgVo queryById(Long id) {
|
||||
SisLibImgRefBo refBo = new SisLibImgRefBo();
|
||||
refBo.setImgId(id);
|
||||
List<SisLibImgRefVo> refs = sisLibImgRefService.queryList(refBo);
|
||||
Collection<Long> refIds = refs.stream().map(SisLibImgRefVo::getId).toList();
|
||||
|
||||
SisPersonLibImgVo vo = new SisPersonLibImgVo();
|
||||
vo.setLibIds(refIds);
|
||||
|
||||
return vo;
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,5 +1,6 @@
|
||||
package org.dromara.sis.service.impl;
|
||||
|
||||
import cn.dev33.satoken.context.mock.SaTokenContextMockUtil;
|
||||
import cn.hutool.core.codec.Base64Encoder;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
@ -10,7 +11,6 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.dromara.property.api.RemoteFloorService;
|
||||
import org.dromara.property.api.domain.vo.RemoteFloorVo;
|
||||
import org.dromara.sis.domain.SisElevatorFloorChannelRef;
|
||||
import org.dromara.sis.domain.enums.ControlTypeEnum;
|
||||
import org.dromara.sis.domain.enums.RosterTypeEnum;
|
||||
import org.dromara.sis.domain.vo.*;
|
||||
@ -121,7 +121,7 @@ public class ZeroSensationPassageServiceImpl implements IZeroSensationPassageSer
|
||||
} else if (item.getControlType().equals(ControlTypeEnum.ELEVATOR_OUT_CONTROL.getCode())) { // 电梯外面面板权限
|
||||
handleEle(item.getBindId(), r.getAuthGroupId(), ControlTypeEnum.ELEVATOR_OUT_CONTROL.getCode(), item.getDeviceFloorId());
|
||||
} else if (item.getControlType().equals(ControlTypeEnum.ELEVATOR_IN_CONTROL.getCode())) { // 电梯里面的面板
|
||||
handleEle(item.getBindId(), r.getAuthGroupId(), ControlTypeEnum.ELEVATOR_IN_CONTROL.getCode(), item.getDeviceFloorId());
|
||||
handleEle(item.getBindId(), r.getAuthGroupId(), ControlTypeEnum.ELEVATOR_IN_CONTROL.getCode(), 0L);
|
||||
} else {
|
||||
log.info("设备绑定了未知的控制类型[{}],不处理", item.getControlType());
|
||||
}
|
||||
@ -135,7 +135,8 @@ public class ZeroSensationPassageServiceImpl implements IZeroSensationPassageSer
|
||||
* @param deviceIp 设备ip
|
||||
*/
|
||||
@Override
|
||||
public void handleEleOut(String deviceIp, TimeInterval interval) {
|
||||
public void handleEleOut(String deviceIp) {
|
||||
TimeInterval interval = new TimeInterval();
|
||||
// 获取当前设备的绑定设备信息
|
||||
List<SisDeviceBindRefVo> bindRefList = deviceBindRefService.queryByDeviceIp(deviceIp);
|
||||
List<SisDeviceBindRefVo> outRefList = bindRefList.stream().filter(item -> Objects.equals(item.getControlType(), ControlTypeEnum.ELEVATOR_OUT_CONTROL.getCode())).toList();
|
||||
@ -193,17 +194,20 @@ public class ZeroSensationPassageServiceImpl implements IZeroSensationPassageSer
|
||||
|
||||
// 获取当前电梯信息
|
||||
SisElevatorInfoVo ele = elevatorInfoService.queryById(deviceId);
|
||||
// 当前电梯不允许控制
|
||||
if (!ele.getIsControl()) return;
|
||||
|
||||
|
||||
// 获取权限组下电梯⇄楼层关联信息
|
||||
List<SisElevatorFloorRefVo> groupRef = elevatorFloorRefService.queryByAuthGroupId(groupId);
|
||||
if (ObjectUtil.isEmpty(groupRef)) return;
|
||||
if (CollUtil.isEmpty(groupRef)) return;
|
||||
|
||||
// 取出当前电梯的楼层授权信息
|
||||
List<SisElevatorFloorRefVo> eleRef = groupRef.stream().filter(o -> Objects.equals(o.getElevatorId(), deviceId)).toList();
|
||||
if (ObjectUtil.isEmpty(eleRef)) return;
|
||||
|
||||
if (Objects.equals(controlType, ControlTypeEnum.ELEVATOR_IN_CONTROL.getCode())) {
|
||||
log.info("开始下发里面版梯控权限....");
|
||||
if (Objects.equals(controlType, ControlTypeEnum.ELEVATOR_OUT_CONTROL.getCode())) {
|
||||
log.info("开始下发外部面板梯控权限....");
|
||||
for (SisElevatorFloorRefVo ref : eleRef) {
|
||||
if (ref.getUpChannel() != null && Objects.equals(ref.getFloorId(), deviceFloorId)) {
|
||||
HikApiService.getInstance().controlGateway(ele.getControlIp(), ref.getUpChannel().intValue(), 2);
|
||||
@ -213,14 +217,14 @@ public class ZeroSensationPassageServiceImpl implements IZeroSensationPassageSer
|
||||
HikApiService.getInstance().controlGateway(ele.getControlIp(), ref.getDownChannel().intValue(), 2);
|
||||
}
|
||||
}
|
||||
cleanLiftAuthRocketProducer.sendMessage(deviceId, groupId, deviceFloorId, "清除电梯" + deviceId + "梯控权限", 3);
|
||||
}
|
||||
|
||||
|
||||
// 获取当前电梯所在建筑的楼层
|
||||
List<RemoteFloorVo> floorList = remoteFloorService.queryByBuildingId(ele.getBuildingId());
|
||||
// 模拟上下文
|
||||
List<RemoteFloorVo> floorList = SaTokenContextMockUtil.setMockContext(() -> remoteFloorService.queryByBuildingId(ele.getBuildingId()));
|
||||
if (CollUtil.isEmpty(floorList)) return;
|
||||
|
||||
if (Objects.equals(controlType, ControlTypeEnum.ELEVATOR_OUT_CONTROL.getCode())) {
|
||||
if (Objects.equals(controlType, ControlTypeEnum.ELEVATOR_IN_CONTROL.getCode())) {
|
||||
SisElevatorFloorRefVo vo;
|
||||
List<Integer> num = new ArrayList<>();
|
||||
for (int i = 1; i < floorList.size(); i++) {
|
||||
@ -234,14 +238,8 @@ public class ZeroSensationPassageServiceImpl implements IZeroSensationPassageSer
|
||||
}
|
||||
if (CollUtil.isEmpty(num)) return;
|
||||
|
||||
if (!ElevatorControlTcpUtil.getInstance().isClientConnected()) {
|
||||
log.info("梯控模块未连接,请检查梯控模块是否启动");
|
||||
return;
|
||||
}
|
||||
ElevatorControlTcpUtil.getInstance().sendManualCommand(num);
|
||||
}
|
||||
log.info("梯控下发权限完成");
|
||||
|
||||
cleanLiftAuthRocketProducer.sendMessage(deviceId, groupId, deviceFloorId, "清除电梯" + deviceId + "梯控权限", 3);
|
||||
}
|
||||
}
|
||||
|
@ -11,6 +11,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
LEFT JOIN sis_auth_record c
|
||||
ON c.target_id = b.id
|
||||
AND c.group_id = b.auth_group_id
|
||||
WHERE a.remote_img_id = #{personId};
|
||||
WHERE a.remote_hw_id = #{personId};
|
||||
</select>
|
||||
</mapper>
|
||||
|
Loading…
Reference in New Issue
Block a user