Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
@ -41,10 +41,10 @@ snail-job:
|
|||||||
spring:
|
spring:
|
||||||
ai:
|
ai:
|
||||||
dashscope:
|
dashscope:
|
||||||
api-key: xxx
|
api-key: sk-8d8df92fcbac4bd2922edba30b0bb8fa
|
||||||
chat:
|
chat:
|
||||||
options:
|
options:
|
||||||
model: qwen-plus
|
model: qwen3-max
|
||||||
datasource:
|
datasource:
|
||||||
type: com.zaxxer.hikari.HikariDataSource
|
type: com.zaxxer.hikari.HikariDataSource
|
||||||
# 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content
|
# 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content
|
||||||
|
|||||||
@ -76,9 +76,9 @@ spring:
|
|||||||
servlet:
|
servlet:
|
||||||
multipart:
|
multipart:
|
||||||
# 单个文件大小
|
# 单个文件大小
|
||||||
max-file-size: 200MB
|
max-file-size: 1024MB
|
||||||
# 设置总上传的文件大小
|
# 设置总上传的文件大小
|
||||||
max-request-size: 200MB
|
max-request-size: 1024MB
|
||||||
mvc:
|
mvc:
|
||||||
# 设置静态资源路径 防止所有请求都去查静态资源
|
# 设置静态资源路径 防止所有请求都去查静态资源
|
||||||
static-path-pattern: /static/**
|
static-path-pattern: /static/**
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package org.dromara.common.utils;
|
package org.dromara.common.utils;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.dromara.common.core.utils.MessageUtils;
|
import org.dromara.common.core.utils.MessageUtils;
|
||||||
@ -9,6 +10,8 @@ import org.dromara.contractor.domain.SubConstructionUser;
|
|||||||
import org.dromara.mobileAttendanceMachine.DeviceMessageSender;
|
import org.dromara.mobileAttendanceMachine.DeviceMessageSender;
|
||||||
import org.dromara.mobileAttendanceMachine.KqjEntity;
|
import org.dromara.mobileAttendanceMachine.KqjEntity;
|
||||||
import org.dromara.project.domain.BusAttendanceMachine;
|
import org.dromara.project.domain.BusAttendanceMachine;
|
||||||
|
import org.dromara.project.domain.BusAttendanceMachineRepeat;
|
||||||
|
import org.dromara.project.service.IBusAttendanceMachineRepeatService;
|
||||||
import org.dromara.project.service.IBusAttendanceMachineService;
|
import org.dromara.project.service.IBusAttendanceMachineService;
|
||||||
import org.dromara.sms4j.api.SmsBlend;
|
import org.dromara.sms4j.api.SmsBlend;
|
||||||
import org.dromara.sms4j.api.entity.SmsResponse;
|
import org.dromara.sms4j.api.entity.SmsResponse;
|
||||||
@ -19,6 +22,7 @@ import org.springframework.context.annotation.Lazy;
|
|||||||
import org.springframework.scheduling.annotation.Async;
|
import org.springframework.scheduling.annotation.Async;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -36,6 +40,9 @@ public class AsyncUtil {
|
|||||||
@Lazy
|
@Lazy
|
||||||
private IBusAttendanceMachineService attendanceMachineService;
|
private IBusAttendanceMachineService attendanceMachineService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IBusAttendanceMachineRepeatService busAttendanceMachineRepeatService;
|
||||||
|
|
||||||
//发送短信
|
//发送短信
|
||||||
@Async
|
@Async
|
||||||
public void sendSms(List<String> mobileList, String config) {
|
public void sendSms(List<String> mobileList, String config) {
|
||||||
@ -63,22 +70,107 @@ public class AsyncUtil {
|
|||||||
public void sendPersonnel(Long teamId, SubConstructionUser constructionUser) {
|
public void sendPersonnel(Long teamId, SubConstructionUser constructionUser) {
|
||||||
SysOssVo byId = ossService.getById(Long.valueOf(constructionUser.getFacePic()));
|
SysOssVo byId = ossService.getById(Long.valueOf(constructionUser.getFacePic()));
|
||||||
List<BusAttendanceMachine> list = attendanceMachineService.lambdaQuery().apply("FIND_IN_SET({0}, teams)", teamId).list();
|
List<BusAttendanceMachine> list = attendanceMachineService.lambdaQuery().apply("FIND_IN_SET({0}, teams)", teamId).list();
|
||||||
|
|
||||||
|
ArrayList<BusAttendanceMachineRepeat> repeats = new ArrayList<>();
|
||||||
for (BusAttendanceMachine machine : list) {
|
for (BusAttendanceMachine machine : list) {
|
||||||
deviceMessageSender.sendPersonnelInformation(machine.getSn(), constructionUser.getSysUserId().toString(), constructionUser.getUserName(), byId.getUrl());
|
Boolean b = deviceMessageSender.sendPersonnelInformation(machine.getSn(),
|
||||||
|
constructionUser.getSysUserId().toString(), constructionUser.getUserName(), byId.getUrl());
|
||||||
|
if (!b) {
|
||||||
|
//记录下来重连时下发
|
||||||
|
BusAttendanceMachineRepeat repeat = new BusAttendanceMachineRepeat();
|
||||||
|
repeat.setSn(machine.getSn());
|
||||||
|
repeat.setUserId(constructionUser.getSysUserId().toString());
|
||||||
|
repeat.setUserName(constructionUser.getUserName());
|
||||||
|
repeat.setUrl(byId.getUrl());
|
||||||
|
repeat.setType("1");
|
||||||
|
repeats.add(repeat);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (CollectionUtil.isNotEmpty(repeats)) {
|
||||||
|
busAttendanceMachineRepeatService.saveBatch(repeats);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//删除考勤人员
|
//删除考勤人员
|
||||||
@Async
|
@Async
|
||||||
public void deletePersonnel(SubConstructionUser constructionUser) {
|
public void deletePersonnel(SubConstructionUser constructionUser) {
|
||||||
|
ArrayList<BusAttendanceMachineRepeat> repeats = new ArrayList<>();
|
||||||
List<BusAttendanceMachine> list = attendanceMachineService.lambdaQuery().apply("FIND_IN_SET({0}, teams)", constructionUser.getTeamId()).list();
|
List<BusAttendanceMachine> list = attendanceMachineService.lambdaQuery().apply("FIND_IN_SET({0}, teams)", constructionUser.getTeamId()).list();
|
||||||
for (BusAttendanceMachine machine : list) {
|
for (BusAttendanceMachine machine : list) {
|
||||||
try {
|
try {
|
||||||
deviceMessageSender.deleteUser(machine.getSn(), constructionUser.getSysUserId().toString());
|
KqjEntity.CommonResponse commonResponse = deviceMessageSender.deleteUser(machine.getSn(), constructionUser.getSysUserId().toString());
|
||||||
|
int code = commonResponse.getData().getCode();
|
||||||
|
if (code != 0) {
|
||||||
|
//记录下来重连时下发
|
||||||
|
BusAttendanceMachineRepeat repeat = new BusAttendanceMachineRepeat();
|
||||||
|
repeat.setSn(machine.getSn());
|
||||||
|
repeat.setUserId(constructionUser.getSysUserId().toString());
|
||||||
|
repeat.setUserName(constructionUser.getUserName());
|
||||||
|
repeat.setUrl(null);
|
||||||
|
repeat.setType("2");
|
||||||
|
repeats.add(repeat);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("删除考勤人员异常", e);
|
||||||
|
BusAttendanceMachineRepeat repeat = new BusAttendanceMachineRepeat();
|
||||||
|
repeat.setSn(machine.getSn());
|
||||||
|
repeat.setUserId(constructionUser.getSysUserId().toString());
|
||||||
|
repeat.setUserName(constructionUser.getUserName());
|
||||||
|
repeat.setUrl(null);
|
||||||
|
repeat.setType("2");
|
||||||
|
repeats.add(repeat);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (CollectionUtil.isNotEmpty(repeats)) {
|
||||||
|
busAttendanceMachineRepeatService.saveBatch(repeats);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//重新下发人员
|
||||||
|
@Async
|
||||||
|
public void repeatSend(String sn) {
|
||||||
|
List<BusAttendanceMachineRepeat> list = busAttendanceMachineRepeatService.lambdaQuery()
|
||||||
|
.eq(BusAttendanceMachineRepeat::getSn, sn)
|
||||||
|
.eq(BusAttendanceMachineRepeat::getType, "1")
|
||||||
|
.list();
|
||||||
|
List<Long> repeatIds = new ArrayList<>();
|
||||||
|
for (BusAttendanceMachineRepeat repeat : list) {
|
||||||
|
Boolean b = deviceMessageSender.sendPersonnelInformation(repeat.getSn(), repeat.getUserId(), repeat.getUserName(), repeat.getUrl());
|
||||||
|
if (b) {
|
||||||
|
//成功删除记录
|
||||||
|
repeatIds.add(repeat.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (CollectionUtil.isNotEmpty(repeatIds)) {
|
||||||
|
busAttendanceMachineRepeatService.removeByIds(repeatIds);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//重新删除人员
|
||||||
|
@Async
|
||||||
|
public void repeatDelete(String sn) {
|
||||||
|
List<BusAttendanceMachineRepeat> list = busAttendanceMachineRepeatService.lambdaQuery()
|
||||||
|
.eq(BusAttendanceMachineRepeat::getSn, sn)
|
||||||
|
.eq(BusAttendanceMachineRepeat::getType, "2")
|
||||||
|
.list();
|
||||||
|
List<Long> repeatIds = new ArrayList<>();
|
||||||
|
for (BusAttendanceMachineRepeat repeat : list) {
|
||||||
|
try {
|
||||||
|
KqjEntity.CommonResponse commonResponse = deviceMessageSender.deleteUser(repeat.getSn(), repeat.getUserId());
|
||||||
|
int code = commonResponse.getData().getCode();
|
||||||
|
if (code == 0) {
|
||||||
|
//成功删除记录
|
||||||
|
repeatIds.add(repeat.getId());
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("删除考勤人员异常", e);
|
log.error("删除考勤人员异常", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (CollectionUtil.isNotEmpty(repeatIds)) {
|
||||||
|
busAttendanceMachineRepeatService.removeByIds(repeatIds);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -257,6 +257,7 @@ public class SubConstructionUserServiceImpl extends ServiceImpl<SubConstructionU
|
|||||||
constructionUser.setTypeOfWork(dto.getTypeOfWork());
|
constructionUser.setTypeOfWork(dto.getTypeOfWork());
|
||||||
constructionUser.setEntryDate(new Date());
|
constructionUser.setEntryDate(new Date());
|
||||||
constructionUser.setFirstDate(LocalDate.now());
|
constructionUser.setFirstDate(LocalDate.now());
|
||||||
|
constructionUser.setStatus("0");
|
||||||
|
|
||||||
int i = baseMapper.updateById(constructionUser);
|
int i = baseMapper.updateById(constructionUser);
|
||||||
|
|
||||||
|
|||||||
@ -7,10 +7,12 @@ import lombok.Data;
|
|||||||
import org.dromara.common.translation.annotation.Translation;
|
import org.dromara.common.translation.annotation.Translation;
|
||||||
import org.dromara.common.translation.constant.TransConstant;
|
import org.dromara.common.translation.constant.TransConstant;
|
||||||
import org.dromara.drone.domain.DroDroneBigPicture;
|
import org.dromara.drone.domain.DroDroneBigPicture;
|
||||||
|
import org.dromara.progress.domain.vo.progressplandetail.PgsProgressPlanDetailRecognizerVo;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -91,6 +93,11 @@ public class DroDroneBigPictureVo implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String recognizeResult;
|
private String recognizeResult;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 识别结果列表
|
||||||
|
*/
|
||||||
|
private String recognizeResultStr;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* tif文件
|
* tif文件
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -100,6 +100,15 @@ public interface IDroDroneBigPictureService extends IService<DroDroneBigPicture>
|
|||||||
*/
|
*/
|
||||||
Boolean compressPicture(String ossIds, List<Long> compressPicIds);
|
Boolean compressPicture(String ossIds, List<Long> compressPicIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 异步合成大图
|
||||||
|
*
|
||||||
|
* @param businessName 业务名称
|
||||||
|
* @param imageUrls 图片URL列表
|
||||||
|
* @return 任务id
|
||||||
|
*/
|
||||||
|
CompletableFuture<String> asyncAddBigPicture(String businessName, List<String> imageUrls);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 异步添加压缩图片
|
* 异步添加压缩图片
|
||||||
*
|
*
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package org.dromara.drone.service.impl;
|
|||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
@ -27,7 +28,9 @@ import org.dromara.drone.service.IDroDroneBigPictureService;
|
|||||||
import org.dromara.manager.dronemanager.DroneManager;
|
import org.dromara.manager.dronemanager.DroneManager;
|
||||||
import org.dromara.manager.dronemanager.vo.DroneImgMergeProgressVo;
|
import org.dromara.manager.dronemanager.vo.DroneImgMergeProgressVo;
|
||||||
import org.dromara.manager.dronemanager.vo.DroneImgMergeUrlVo;
|
import org.dromara.manager.dronemanager.vo.DroneImgMergeUrlVo;
|
||||||
|
import org.dromara.manager.recognizermanager.enums.RecognizerTypeEnum;
|
||||||
import org.dromara.progress.domain.dto.progressplandetail.PgsProgressPlanDetailAINumberReq;
|
import org.dromara.progress.domain.dto.progressplandetail.PgsProgressPlanDetailAINumberReq;
|
||||||
|
import org.dromara.progress.domain.vo.progressplandetail.PgsProgressPlanDetailRecognizerVo;
|
||||||
import org.dromara.progress.service.IPgsProgressPlanDetailService;
|
import org.dromara.progress.service.IPgsProgressPlanDetailService;
|
||||||
import org.dromara.system.domain.vo.SysOssVo;
|
import org.dromara.system.domain.vo.SysOssVo;
|
||||||
import org.dromara.system.service.ISysOssService;
|
import org.dromara.system.service.ISysOssService;
|
||||||
@ -90,11 +93,34 @@ public class DroDroneBigPictureServiceImpl extends ServiceImpl<DroDroneBigPictur
|
|||||||
BigDecimal p = progressVo.getProgress()
|
BigDecimal p = progressVo.getProgress()
|
||||||
.multiply(new BigDecimal("100"));
|
.multiply(new BigDecimal("100"));
|
||||||
pictureVo.setProgress(p.compareTo(BigDecimal.valueOf(100)) == 0 ?
|
pictureVo.setProgress(p.compareTo(BigDecimal.valueOf(100)) == 0 ?
|
||||||
BigDecimal.valueOf(100) : p.setScale(4, RoundingMode.HALF_UP));
|
BigDecimal.valueOf(100) : p.setScale(2, RoundingMode.HALF_UP));
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("查询图片合成进度异常", e);
|
log.error("查询图片合成进度异常", e);
|
||||||
}
|
}
|
||||||
|
if (StringUtils.isNotBlank(pictureVo.getRecognizeResult())) {
|
||||||
|
List<PgsProgressPlanDetailRecognizerVo> recognizerList =
|
||||||
|
JSONUtil.toList(pictureVo.getRecognizeResult(), PgsProgressPlanDetailRecognizerVo.class);
|
||||||
|
if (CollUtil.isNotEmpty(recognizerList)) {
|
||||||
|
// 1. 按类型名称分组
|
||||||
|
Map<String, List<PgsProgressPlanDetailRecognizerVo>> groupMap = recognizerList.stream()
|
||||||
|
.collect(Collectors.groupingBy(r -> {
|
||||||
|
RecognizerTypeEnum typeEnum = RecognizerTypeEnum.fromValue(r.getType());
|
||||||
|
return typeEnum != null ? typeEnum.getText() : "未知类型";
|
||||||
|
}));
|
||||||
|
// 2. 将每组转换为 “类型:name1, name2”
|
||||||
|
String recognizerStr = groupMap.entrySet().stream()
|
||||||
|
.map(entry -> {
|
||||||
|
String type = entry.getKey();
|
||||||
|
String names = entry.getValue().stream()
|
||||||
|
.map(PgsProgressPlanDetailRecognizerVo::getName)
|
||||||
|
.collect(Collectors.joining(", "));
|
||||||
|
return type + ":" + names;
|
||||||
|
})
|
||||||
|
.collect(Collectors.joining(";")); // 组之间用分号分隔
|
||||||
|
pictureVo.setRecognizeResultStr(recognizerStr);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return pictureVo;
|
return pictureVo;
|
||||||
}
|
}
|
||||||
@ -123,13 +149,36 @@ public class DroDroneBigPictureServiceImpl extends ServiceImpl<DroDroneBigPictur
|
|||||||
BigDecimal p = progressVo.getProgress()
|
BigDecimal p = progressVo.getProgress()
|
||||||
.multiply(new BigDecimal("100"));
|
.multiply(new BigDecimal("100"));
|
||||||
pictureVo.setProgress(p.compareTo(BigDecimal.valueOf(100)) == 0 ?
|
pictureVo.setProgress(p.compareTo(BigDecimal.valueOf(100)) == 0 ?
|
||||||
BigDecimal.valueOf(100) : p.setScale(4, RoundingMode.HALF_UP));
|
BigDecimal.valueOf(100) : p.setScale(2, RoundingMode.HALF_UP));
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
pictureVo.setStatus("4");
|
pictureVo.setStatus("4");
|
||||||
pictureVo.setRemark(e.getMessage());
|
pictureVo.setRemark(e.getMessage());
|
||||||
log.error("查询图片合成进度异常", e);
|
log.error("查询图片合成进度异常", e);
|
||||||
}
|
}
|
||||||
|
if (StringUtils.isNotBlank(pictureVo.getRecognizeResult())) {
|
||||||
|
List<PgsProgressPlanDetailRecognizerVo> recognizerList =
|
||||||
|
JSONUtil.toList(pictureVo.getRecognizeResult(), PgsProgressPlanDetailRecognizerVo.class);
|
||||||
|
if (CollUtil.isNotEmpty(recognizerList)) {
|
||||||
|
// 1. 按类型名称分组
|
||||||
|
Map<String, List<PgsProgressPlanDetailRecognizerVo>> groupMap = recognizerList.stream()
|
||||||
|
.collect(Collectors.groupingBy(r -> {
|
||||||
|
RecognizerTypeEnum typeEnum = RecognizerTypeEnum.fromValue(r.getType());
|
||||||
|
return typeEnum != null ? typeEnum.getText() : "未知类型";
|
||||||
|
}));
|
||||||
|
// 2. 将每组转换为 “类型:name1, name2”
|
||||||
|
String recognizerStr = groupMap.entrySet().stream()
|
||||||
|
.map(entry -> {
|
||||||
|
String type = entry.getKey();
|
||||||
|
String names = entry.getValue().stream()
|
||||||
|
.map(PgsProgressPlanDetailRecognizerVo::getName)
|
||||||
|
.collect(Collectors.joining(", "));
|
||||||
|
return type + ":" + names;
|
||||||
|
})
|
||||||
|
.collect(Collectors.joining(";")); // 组之间用分号分隔
|
||||||
|
pictureVo.setRecognizeResultStr(recognizerStr);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
result.setRecords(records);
|
result.setRecords(records);
|
||||||
@ -173,10 +222,14 @@ public class DroDroneBigPictureServiceImpl extends ServiceImpl<DroDroneBigPictur
|
|||||||
if (add == null) {
|
if (add == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (StringUtils.isNotBlank(add.getBigPic()) && StringUtils.isNotBlank(add.getTifFile())) {
|
||||||
|
add.setStatus("3");
|
||||||
|
}
|
||||||
boolean save = this.save(add);
|
boolean save = this.save(add);
|
||||||
if (!save) {
|
if (!save) {
|
||||||
throw new ServiceException("新增无人机大图信息失败");
|
throw new ServiceException("新增无人机大图信息失败");
|
||||||
}
|
}
|
||||||
|
Long id = add.getId();
|
||||||
// 压缩图片
|
// 压缩图片
|
||||||
String smallPic = add.getSmallPic();
|
String smallPic = add.getSmallPic();
|
||||||
if (StringUtils.isNotBlank(smallPic)) {
|
if (StringUtils.isNotBlank(smallPic)) {
|
||||||
@ -188,7 +241,7 @@ public class DroDroneBigPictureServiceImpl extends ServiceImpl<DroDroneBigPictur
|
|||||||
.map(String::valueOf)
|
.map(String::valueOf)
|
||||||
.collect(Collectors.joining(","));
|
.collect(Collectors.joining(","));
|
||||||
DroDroneBigPicture update = new DroDroneBigPicture();
|
DroDroneBigPicture update = new DroDroneBigPicture();
|
||||||
update.setId(add.getId());
|
update.setId(id);
|
||||||
update.setCompressPic(ossIds);
|
update.setCompressPic(ossIds);
|
||||||
this.updateById(update);
|
this.updateById(update);
|
||||||
}).exceptionally(ex -> {
|
}).exceptionally(ex -> {
|
||||||
@ -196,6 +249,26 @@ public class DroDroneBigPictureServiceImpl extends ServiceImpl<DroDroneBigPictur
|
|||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if (StringUtils.isNotBlank(smallPic) && StringUtils.isBlank(add.getBigPic())) {
|
||||||
|
List<Long> picIds = StringUtils.splitTo(smallPic, Convert::toLong);
|
||||||
|
List<SysOssVo> ossVos = ossService.listByIds(picIds);
|
||||||
|
List<String> picUrls = ossVos.stream().map(SysOssVo::getUrl).toList();
|
||||||
|
// 异步执行大图合并
|
||||||
|
self.asyncAddBigPicture(add.getTaskName(), picUrls)
|
||||||
|
.thenAccept(result -> {
|
||||||
|
DroDroneBigPicture update = new DroDroneBigPicture();
|
||||||
|
update.setId(id);
|
||||||
|
update.setStatus("2");
|
||||||
|
update.setTaskId(result);
|
||||||
|
this.updateById(update);
|
||||||
|
}).exceptionally(ex -> {
|
||||||
|
log.error("无人机大图信息[{}]异步执行合成图片失败", add.getTaskName(), ex);
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(add.getBigPic()) && StringUtils.isNotBlank(add.getTifFile())) {
|
||||||
|
return this.createProgressRecognize(id);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -254,8 +327,26 @@ public class DroDroneBigPictureServiceImpl extends ServiceImpl<DroDroneBigPictur
|
|||||||
fileUrl = mergeUrlVo.getPngUrl();
|
fileUrl = mergeUrlVo.getPngUrl();
|
||||||
tifUrl = mergeUrlVo.getTifUrl();
|
tifUrl = mergeUrlVo.getTifUrl();
|
||||||
} else {
|
} else {
|
||||||
fileUrl = bigPicture.getBigPic();
|
String bigPic = bigPicture.getBigPic();
|
||||||
tifUrl = bigPicture.getTifFile();
|
if (isLong(bigPic)) {
|
||||||
|
SysOssVo ossVo = ossService.getById(Long.parseLong(bigPic));
|
||||||
|
if (ossVo != null) {
|
||||||
|
bigPic = ossVo.getUrl();
|
||||||
|
} else {
|
||||||
|
throw new ServiceException("图片不存在");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fileUrl = bigPic;
|
||||||
|
String tifFile = bigPicture.getTifFile();
|
||||||
|
if (isLong(tifFile)) {
|
||||||
|
SysOssVo ossVo = ossService.getById(Long.parseLong(tifFile));
|
||||||
|
if (ossVo != null) {
|
||||||
|
tifFile = ossVo.getUrl();
|
||||||
|
} else {
|
||||||
|
throw new ServiceException("TIF文件不存在");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
tifUrl = tifFile;
|
||||||
}
|
}
|
||||||
// 创建进度识别
|
// 创建进度识别
|
||||||
PgsProgressPlanDetailAINumberReq ai = new PgsProgressPlanDetailAINumberReq();
|
PgsProgressPlanDetailAINumberReq ai = new PgsProgressPlanDetailAINumberReq();
|
||||||
@ -413,6 +504,19 @@ public class DroDroneBigPictureServiceImpl extends ServiceImpl<DroDroneBigPictur
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 异步合成大图
|
||||||
|
*
|
||||||
|
* @param businessName 业务名称
|
||||||
|
* @param imageUrls 图片URL列表
|
||||||
|
* @return 任务id
|
||||||
|
*/
|
||||||
|
@Async
|
||||||
|
@Override
|
||||||
|
public CompletableFuture<String> asyncAddBigPicture(String businessName, List<String> imageUrls) {
|
||||||
|
return CompletableFuture.completedFuture(droneManager.createImageMergeTask(businessName, imageUrls));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 异步添加压缩图片
|
* 异步添加压缩图片
|
||||||
*
|
*
|
||||||
@ -516,4 +620,19 @@ public class DroDroneBigPictureServiceImpl extends ServiceImpl<DroDroneBigPictur
|
|||||||
.collect(Collectors.toSet());
|
.collect(Collectors.toSet());
|
||||||
return set1.equals(set2);
|
return set1.equals(set2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断字符串是否为Long
|
||||||
|
*
|
||||||
|
* @param str 字符串
|
||||||
|
* @return 是否为Long
|
||||||
|
*/
|
||||||
|
private static boolean isLong(String str) {
|
||||||
|
try {
|
||||||
|
Long.parseLong(str);
|
||||||
|
return true;
|
||||||
|
} catch (Exception e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -34,6 +34,7 @@ public class DroneManager {
|
|||||||
*
|
*
|
||||||
* @param businessName 业务名称
|
* @param businessName 业务名称
|
||||||
* @param imageUrls 图片URL列表
|
* @param imageUrls 图片URL列表
|
||||||
|
* @return 任务ID
|
||||||
*/
|
*/
|
||||||
public String createImageMergeTask(String businessName, List<String> imageUrls) {
|
public String createImageMergeTask(String businessName, List<String> imageUrls) {
|
||||||
return DroneRequestUtils.createImgMergeTask(droneProperties.getUrl(), businessName, imageUrls);
|
return DroneRequestUtils.createImgMergeTask(droneProperties.getUrl(), businessName, imageUrls);
|
||||||
|
|||||||
@ -67,6 +67,7 @@ public class DroneRequestUtils {
|
|||||||
*
|
*
|
||||||
* @param businessName 业务名称
|
* @param businessName 业务名称
|
||||||
* @param imageUrls 图片URL列表
|
* @param imageUrls 图片URL列表
|
||||||
|
* @return 任务ID
|
||||||
*/
|
*/
|
||||||
public static String createImgMergeTask(String url, String businessName, List<String> imageUrls) {
|
public static String createImgMergeTask(String url, String businessName, List<String> imageUrls) {
|
||||||
if (StringUtils.isBlank(businessName) || CollUtil.isEmpty(imageUrls)) {
|
if (StringUtils.isBlank(businessName) || CollUtil.isEmpty(imageUrls)) {
|
||||||
|
|||||||
@ -0,0 +1,105 @@
|
|||||||
|
package org.dromara.project.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||||
|
import org.dromara.common.log.annotation.Log;
|
||||||
|
import org.dromara.common.web.core.BaseController;
|
||||||
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
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.log.enums.BusinessType;
|
||||||
|
import org.dromara.common.excel.utils.ExcelUtil;
|
||||||
|
import org.dromara.project.domain.vo.BusAttendanceMachineRepeatVo;
|
||||||
|
import org.dromara.project.domain.bo.BusAttendanceMachineRepeatBo;
|
||||||
|
import org.dromara.project.service.IBusAttendanceMachineRepeatService;
|
||||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 考勤重新下发
|
||||||
|
*
|
||||||
|
* @author Lion Li
|
||||||
|
* @date 2025-11-24
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/project/attendanceMachineRepeat")
|
||||||
|
public class BusAttendanceMachineRepeatController extends BaseController {
|
||||||
|
|
||||||
|
private final IBusAttendanceMachineRepeatService busAttendanceMachineRepeatService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询考勤重新下发列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("project:attendanceMachineRepeat:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo<BusAttendanceMachineRepeatVo> list(BusAttendanceMachineRepeatBo bo, PageQuery pageQuery) {
|
||||||
|
return busAttendanceMachineRepeatService.queryPageList(bo, pageQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出考勤重新下发列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("project:attendanceMachineRepeat:export")
|
||||||
|
@Log(title = "考勤重新下发", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(BusAttendanceMachineRepeatBo bo, HttpServletResponse response) {
|
||||||
|
List<BusAttendanceMachineRepeatVo> list = busAttendanceMachineRepeatService.queryList(bo);
|
||||||
|
ExcelUtil.exportExcel(list, "考勤重新下发", BusAttendanceMachineRepeatVo.class, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取考勤重新下发详细信息
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("project:attendanceMachineRepeat:query")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public R<BusAttendanceMachineRepeatVo> getInfo(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable Long id) {
|
||||||
|
return R.ok(busAttendanceMachineRepeatService.queryById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增考勤重新下发
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("project:attendanceMachineRepeat:add")
|
||||||
|
@Log(title = "考勤重新下发", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping()
|
||||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody BusAttendanceMachineRepeatBo bo) {
|
||||||
|
return toAjax(busAttendanceMachineRepeatService.insertByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改考勤重新下发
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("project:attendanceMachineRepeat:edit")
|
||||||
|
@Log(title = "考勤重新下发", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping()
|
||||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody BusAttendanceMachineRepeatBo bo) {
|
||||||
|
return toAjax(busAttendanceMachineRepeatService.updateByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除考勤重新下发
|
||||||
|
*
|
||||||
|
* @param ids 主键串
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("project:attendanceMachineRepeat:remove")
|
||||||
|
@Log(title = "考勤重新下发", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
|
@PathVariable Long[] ids) {
|
||||||
|
return toAjax(busAttendanceMachineRepeatService.deleteWithValidByIds(List.of(ids), true));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,61 @@
|
|||||||
|
package org.dromara.project.domain;
|
||||||
|
|
||||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 考勤重新下发对象 bus_attendance_machine_repeat
|
||||||
|
*
|
||||||
|
* @author Lion Li
|
||||||
|
* @date 2025-11-24
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("bus_attendance_machine_repeat")
|
||||||
|
public class BusAttendanceMachineRepeat extends BaseEntity {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键ID
|
||||||
|
*/
|
||||||
|
@TableId(value = "id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备sn
|
||||||
|
*/
|
||||||
|
private String sn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户id
|
||||||
|
*/
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户名
|
||||||
|
*/
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人脸地址
|
||||||
|
*/
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (1-新增 2-删除)
|
||||||
|
*/
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,61 @@
|
|||||||
|
package org.dromara.project.domain.bo;
|
||||||
|
|
||||||
|
import org.dromara.project.domain.BusAttendanceMachineRepeat;
|
||||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 考勤重新下发业务对象 bus_attendance_machine_repeat
|
||||||
|
*
|
||||||
|
* @author Lion Li
|
||||||
|
* @date 2025-11-24
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@AutoMapper(target = BusAttendanceMachineRepeat.class, reverseConvertGenerate = false)
|
||||||
|
public class BusAttendanceMachineRepeatBo extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键ID
|
||||||
|
*/
|
||||||
|
@NotNull(message = "主键ID不能为空", groups = { EditGroup.class })
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备sn
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "设备sn不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private String sn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户id
|
||||||
|
*/
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户名
|
||||||
|
*/
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人脸地址
|
||||||
|
*/
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (1-新增 2-删除)
|
||||||
|
*/
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,75 @@
|
|||||||
|
package org.dromara.project.domain.vo;
|
||||||
|
|
||||||
|
import org.dromara.project.domain.BusAttendanceMachineRepeat;
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||||
|
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||||
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 考勤重新下发视图对象 bus_attendance_machine_repeat
|
||||||
|
*
|
||||||
|
* @author Lion Li
|
||||||
|
* @date 2025-11-24
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
@AutoMapper(target = BusAttendanceMachineRepeat.class)
|
||||||
|
public class BusAttendanceMachineRepeatVo implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键ID
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "主键ID")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备sn
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "设备sn")
|
||||||
|
private String sn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户id
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "用户id")
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户名
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "用户名")
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人脸地址
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "人脸地址")
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (1-新增 2-删除)
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "", converter = ExcelDictConvert.class)
|
||||||
|
@ExcelDictFormat(readConverterExp = "1=-新增,2=-删除")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
package org.dromara.project.mapper;
|
||||||
|
|
||||||
|
import org.dromara.project.domain.BusAttendanceMachineRepeat;
|
||||||
|
import org.dromara.project.domain.vo.BusAttendanceMachineRepeatVo;
|
||||||
|
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 考勤重新下发Mapper接口
|
||||||
|
*
|
||||||
|
* @author Lion Li
|
||||||
|
* @date 2025-11-24
|
||||||
|
*/
|
||||||
|
public interface BusAttendanceMachineRepeatMapper extends BaseMapperPlus<BusAttendanceMachineRepeat, BusAttendanceMachineRepeatVo> {
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,70 @@
|
|||||||
|
package org.dromara.project.service;
|
||||||
|
|
||||||
|
import org.dromara.project.domain.vo.BusAttendanceMachineRepeatVo;
|
||||||
|
import org.dromara.project.domain.bo.BusAttendanceMachineRepeatBo;
|
||||||
|
import org.dromara.project.domain.BusAttendanceMachineRepeat;
|
||||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 考勤重新下发Service接口
|
||||||
|
*
|
||||||
|
* @author Lion Li
|
||||||
|
* @date 2025-11-24
|
||||||
|
*/
|
||||||
|
public interface IBusAttendanceMachineRepeatService extends IService<BusAttendanceMachineRepeat>{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询考勤重新下发
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
* @return 考勤重新下发
|
||||||
|
*/
|
||||||
|
BusAttendanceMachineRepeatVo queryById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询考勤重新下发列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @param pageQuery 分页参数
|
||||||
|
* @return 考勤重新下发分页列表
|
||||||
|
*/
|
||||||
|
TableDataInfo<BusAttendanceMachineRepeatVo> queryPageList(BusAttendanceMachineRepeatBo bo, PageQuery pageQuery);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询符合条件的考勤重新下发列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @return 考勤重新下发列表
|
||||||
|
*/
|
||||||
|
List<BusAttendanceMachineRepeatVo> queryList(BusAttendanceMachineRepeatBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增考勤重新下发
|
||||||
|
*
|
||||||
|
* @param bo 考勤重新下发
|
||||||
|
* @return 是否新增成功
|
||||||
|
*/
|
||||||
|
Boolean insertByBo(BusAttendanceMachineRepeatBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改考勤重新下发
|
||||||
|
*
|
||||||
|
* @param bo 考勤重新下发
|
||||||
|
* @return 是否修改成功
|
||||||
|
*/
|
||||||
|
Boolean updateByBo(BusAttendanceMachineRepeatBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验并批量删除考勤重新下发信息
|
||||||
|
*
|
||||||
|
* @param ids 待删除的主键集合
|
||||||
|
* @param isValid 是否进行有效性校验
|
||||||
|
* @return 是否删除成功
|
||||||
|
*/
|
||||||
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
}
|
||||||
@ -0,0 +1,136 @@
|
|||||||
|
package org.dromara.project.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.dromara.common.core.utils.MapstructUtils;
|
||||||
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.dromara.project.domain.bo.BusAttendanceMachineRepeatBo;
|
||||||
|
import org.dromara.project.domain.vo.BusAttendanceMachineRepeatVo;
|
||||||
|
import org.dromara.project.domain.BusAttendanceMachineRepeat;
|
||||||
|
import org.dromara.project.mapper.BusAttendanceMachineRepeatMapper;
|
||||||
|
import org.dromara.project.service.IBusAttendanceMachineRepeatService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 考勤重新下发Service业务层处理
|
||||||
|
*
|
||||||
|
* @author Lion Li
|
||||||
|
* @date 2025-11-24
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class BusAttendanceMachineRepeatServiceImpl extends ServiceImpl<BusAttendanceMachineRepeatMapper, BusAttendanceMachineRepeat>
|
||||||
|
implements IBusAttendanceMachineRepeatService {
|
||||||
|
|
||||||
|
private final BusAttendanceMachineRepeatMapper baseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询考勤重新下发
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
* @return 考勤重新下发
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public BusAttendanceMachineRepeatVo queryById(Long id){
|
||||||
|
return baseMapper.selectVoById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询考勤重新下发列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @param pageQuery 分页参数
|
||||||
|
* @return 考勤重新下发分页列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TableDataInfo<BusAttendanceMachineRepeatVo> queryPageList(BusAttendanceMachineRepeatBo bo, PageQuery pageQuery) {
|
||||||
|
LambdaQueryWrapper<BusAttendanceMachineRepeat> lqw = buildQueryWrapper(bo);
|
||||||
|
Page<BusAttendanceMachineRepeatVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
|
return TableDataInfo.build(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询符合条件的考勤重新下发列表
|
||||||
|
*
|
||||||
|
* @param bo 查询条件
|
||||||
|
* @return 考勤重新下发列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<BusAttendanceMachineRepeatVo> queryList(BusAttendanceMachineRepeatBo bo) {
|
||||||
|
LambdaQueryWrapper<BusAttendanceMachineRepeat> lqw = buildQueryWrapper(bo);
|
||||||
|
return baseMapper.selectVoList(lqw);
|
||||||
|
}
|
||||||
|
|
||||||
|
private LambdaQueryWrapper<BusAttendanceMachineRepeat> buildQueryWrapper(BusAttendanceMachineRepeatBo bo) {
|
||||||
|
Map<String, Object> params = bo.getParams();
|
||||||
|
LambdaQueryWrapper<BusAttendanceMachineRepeat> lqw = Wrappers.lambdaQuery();
|
||||||
|
lqw.orderByDesc(BusAttendanceMachineRepeat::getId);
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getSn()), BusAttendanceMachineRepeat::getSn, bo.getSn());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getUserId()), BusAttendanceMachineRepeat::getUserId, bo.getUserId());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getUserName()), BusAttendanceMachineRepeat::getUserName, bo.getUserName());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getUrl()), BusAttendanceMachineRepeat::getUrl, bo.getUrl());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getType()), BusAttendanceMachineRepeat::getType, bo.getType());
|
||||||
|
return lqw;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增考勤重新下发
|
||||||
|
*
|
||||||
|
* @param bo 考勤重新下发
|
||||||
|
* @return 是否新增成功
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean insertByBo(BusAttendanceMachineRepeatBo bo) {
|
||||||
|
BusAttendanceMachineRepeat add = MapstructUtils.convert(bo, BusAttendanceMachineRepeat.class);
|
||||||
|
validEntityBeforeSave(add);
|
||||||
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
|
if (flag) {
|
||||||
|
bo.setId(add.getId());
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改考勤重新下发
|
||||||
|
*
|
||||||
|
* @param bo 考勤重新下发
|
||||||
|
* @return 是否修改成功
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean updateByBo(BusAttendanceMachineRepeatBo bo) {
|
||||||
|
BusAttendanceMachineRepeat update = MapstructUtils.convert(bo, BusAttendanceMachineRepeat.class);
|
||||||
|
validEntityBeforeSave(update);
|
||||||
|
return baseMapper.updateById(update) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存前的数据校验
|
||||||
|
*/
|
||||||
|
private void validEntityBeforeSave(BusAttendanceMachineRepeat entity){
|
||||||
|
//TODO 做一些数据校验,如唯一约束
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验并批量删除考勤重新下发信息
|
||||||
|
*
|
||||||
|
* @param ids 待删除的主键集合
|
||||||
|
* @param isValid 是否进行有效性校验
|
||||||
|
* @return 是否删除成功
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
|
if(isValid){
|
||||||
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||||
|
}
|
||||||
|
return baseMapper.deleteByIds(ids) > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -478,10 +478,10 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
|||||||
attendance.setClockStatus(BusAttendanceClockStatusEnum.NORMAL.getValue());
|
attendance.setClockStatus(BusAttendanceClockStatusEnum.NORMAL.getValue());
|
||||||
}
|
}
|
||||||
//只要请假,直接归为请假
|
//只要请假,直接归为请假
|
||||||
LocalDateTime localDateTime = localDate.atTime(busAttendanceRuleVo.getClockInTime());
|
//LocalDateTime localDateTime = localDate.atTime(busAttendanceRuleVo.getClockInTime());
|
||||||
if (leaveService.isLeave(localDateTime, userId)) {
|
//if (leaveService.isLeave(localDateTime, userId)) {
|
||||||
attendance.setClockStatus(BusAttendanceClockStatusEnum.LEAVE.getValue());
|
// attendance.setClockStatus(BusAttendanceClockStatusEnum.LEAVE.getValue());
|
||||||
}
|
//}
|
||||||
|
|
||||||
// 填充信息
|
// 填充信息
|
||||||
attendance.setUserId(userId);
|
attendance.setUserId(userId);
|
||||||
@ -532,10 +532,10 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
|||||||
busAttendance.setClockStatus(BusAttendanceClockStatusEnum.NORMAL.getValue());
|
busAttendance.setClockStatus(BusAttendanceClockStatusEnum.NORMAL.getValue());
|
||||||
}
|
}
|
||||||
//只要请假,直接归为请假
|
//只要请假,直接归为请假
|
||||||
LocalDateTime localDateTime = localDate.atTime(busAttendanceRuleVo.getClockInTime());
|
//LocalDateTime localDateTime = localDate.atTime(busAttendanceRuleVo.getClockInTime());
|
||||||
if (leaveService.isLeave(localDateTime, userId)) {
|
//if (leaveService.isLeave(localDateTime, userId)) {
|
||||||
busAttendance.setClockStatus(BusAttendanceClockStatusEnum.LEAVE.getValue());
|
// busAttendance.setClockStatus(BusAttendanceClockStatusEnum.LEAVE.getValue());
|
||||||
}
|
//}
|
||||||
|
|
||||||
busAttendance.setSource(req.getSource());
|
busAttendance.setSource(req.getSource());
|
||||||
busAttendance.setSn(req.getSn());
|
busAttendance.setSn(req.getSn());
|
||||||
@ -576,10 +576,10 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
|||||||
busAttendance.setMinuteCount(0);
|
busAttendance.setMinuteCount(0);
|
||||||
}
|
}
|
||||||
//只要请假,直接归为请假
|
//只要请假,直接归为请假
|
||||||
LocalDateTime localDateTime = localDate.atTime(busAttendanceRuleVo.getClockInTime());
|
//LocalDateTime localDateTime = localDate.atTime(busAttendanceRuleVo.getClockInTime());
|
||||||
if (leaveService.isLeave(localDateTime, userId)) {
|
//if (leaveService.isLeave(localDateTime, userId)) {
|
||||||
busAttendance.setClockStatus(BusAttendanceClockStatusEnum.LEAVE.getValue());
|
// busAttendance.setClockStatus(BusAttendanceClockStatusEnum.LEAVE.getValue());
|
||||||
}
|
//}
|
||||||
updateById(busAttendance);
|
updateById(busAttendance);
|
||||||
} else {
|
} else {
|
||||||
BusAttendance attendance = new BusAttendance();
|
BusAttendance attendance = new BusAttendance();
|
||||||
@ -594,10 +594,10 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
|||||||
attendance.setClockStatus(BusAttendanceClockStatusEnum.NORMAL.getValue());
|
attendance.setClockStatus(BusAttendanceClockStatusEnum.NORMAL.getValue());
|
||||||
}
|
}
|
||||||
//只要请假,直接归为请假
|
//只要请假,直接归为请假
|
||||||
LocalDateTime localDateTime = localDate.atTime(busAttendanceRuleVo.getClockInTime());
|
//LocalDateTime localDateTime = localDate.atTime(busAttendanceRuleVo.getClockInTime());
|
||||||
if (leaveService.isLeave(localDateTime, userId)) {
|
//if (leaveService.isLeave(localDateTime, userId)) {
|
||||||
attendance.setClockStatus(BusAttendanceClockStatusEnum.LEAVE.getValue());
|
// attendance.setClockStatus(BusAttendanceClockStatusEnum.LEAVE.getValue());
|
||||||
}
|
//}
|
||||||
// 填充信息
|
// 填充信息
|
||||||
attendance.setUserId(userId);
|
attendance.setUserId(userId);
|
||||||
attendance.setProjectId(req.getProjectId());
|
attendance.setProjectId(req.getProjectId());
|
||||||
|
|||||||
@ -216,6 +216,7 @@ public class BusConstructionUserExitServiceImpl extends ServiceImpl<BusConstruct
|
|||||||
LambdaUpdateWrapper<SubConstructionUser> constructionUserLuw = Wrappers.lambdaUpdate(SubConstructionUser.class)
|
LambdaUpdateWrapper<SubConstructionUser> constructionUserLuw = Wrappers.lambdaUpdate(SubConstructionUser.class)
|
||||||
.eq(SubConstructionUser::getId, constructionUser.getId())
|
.eq(SubConstructionUser::getId, constructionUser.getId())
|
||||||
.set(SubConstructionUser::getTeamId, null)
|
.set(SubConstructionUser::getTeamId, null)
|
||||||
|
.set(SubConstructionUser::getStatus, "1")
|
||||||
.set(SubConstructionUser::getLeaveDate, new Date());
|
.set(SubConstructionUser::getLeaveDate, new Date());
|
||||||
if (StringUtils.isNotBlank(salaryVoucherFile) && StringUtils.isNotBlank(salaryConfirmationFile)) {
|
if (StringUtils.isNotBlank(salaryVoucherFile) && StringUtils.isNotBlank(salaryConfirmationFile)) {
|
||||||
constructionUserLuw.set(SubConstructionUser::getExitStatus, "2");
|
constructionUserLuw.set(SubConstructionUser::getExitStatus, "2");
|
||||||
|
|||||||
@ -190,6 +190,7 @@ public class BusProjectTeamMemberServiceImpl extends ServiceImpl<BusProjectTeamM
|
|||||||
.set(SubConstructionUser::getLeaveDate, null)
|
.set(SubConstructionUser::getLeaveDate, null)
|
||||||
.set(SubConstructionUser::getExitStatus, "0")
|
.set(SubConstructionUser::getExitStatus, "0")
|
||||||
.set(SubConstructionUser::getUserRole, "0")
|
.set(SubConstructionUser::getUserRole, "0")
|
||||||
|
.set(SubConstructionUser::getStatus, "0")
|
||||||
.set(StrUtil.isNotBlank(req.getTypeOfWork()), SubConstructionUser::getTypeOfWork, req.getTypeOfWork())
|
.set(StrUtil.isNotBlank(req.getTypeOfWork()), SubConstructionUser::getTypeOfWork, req.getTypeOfWork())
|
||||||
.set(constructionUser.getFirstDate() == null, SubConstructionUser::getFirstDate, LocalDate.now());
|
.set(constructionUser.getFirstDate() == null, SubConstructionUser::getFirstDate, LocalDate.now());
|
||||||
constructionUserService.update(constructionUserLuw);
|
constructionUserService.update(constructionUserLuw);
|
||||||
@ -366,6 +367,7 @@ public class BusProjectTeamMemberServiceImpl extends ServiceImpl<BusProjectTeamM
|
|||||||
.eq(SubConstructionUser::getId, constructionUser.getId())
|
.eq(SubConstructionUser::getId, constructionUser.getId())
|
||||||
.set(SubConstructionUser::getExitStatus, exitStatus)
|
.set(SubConstructionUser::getExitStatus, exitStatus)
|
||||||
.set(SubConstructionUser::getTeamId, null)
|
.set(SubConstructionUser::getTeamId, null)
|
||||||
|
.set(SubConstructionUser::getStatus, "1")
|
||||||
.set(SubConstructionUser::getLeaveDate, new Date());
|
.set(SubConstructionUser::getLeaveDate, new Date());
|
||||||
constructionUserService.update(constructionUserLuw);
|
constructionUserService.update(constructionUserLuw);
|
||||||
|
|
||||||
|
|||||||
@ -2,11 +2,13 @@ package org.dromara.websocket.websocket.service;
|
|||||||
|
|
||||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
import jakarta.websocket.*;
|
import jakarta.websocket.*;
|
||||||
import jakarta.websocket.server.ServerEndpoint;
|
import jakarta.websocket.server.ServerEndpoint;
|
||||||
import lombok.extern.log4j.Log4j2;
|
import lombok.extern.log4j.Log4j2;
|
||||||
import org.dromara.common.core.exception.ServiceException;
|
import org.dromara.common.core.exception.ServiceException;
|
||||||
import org.dromara.common.core.utils.SpringUtils;
|
import org.dromara.common.core.utils.SpringUtils;
|
||||||
|
import org.dromara.common.utils.AsyncUtil;
|
||||||
import org.dromara.mobileAttendanceMachine.KqjEntity;
|
import org.dromara.mobileAttendanceMachine.KqjEntity;
|
||||||
import org.dromara.project.service.IBusAttendanceMachineService;
|
import org.dromara.project.service.IBusAttendanceMachineService;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@ -33,6 +35,9 @@ public class DeviceWebSocketServer {
|
|||||||
|
|
||||||
private final static IBusAttendanceMachineService attendanceMachineService = SpringUtils.getBean(IBusAttendanceMachineService.class);
|
private final static IBusAttendanceMachineService attendanceMachineService = SpringUtils.getBean(IBusAttendanceMachineService.class);
|
||||||
|
|
||||||
|
private final static AsyncUtil asyncUtil = SpringUtils.getBean(AsyncUtil.class);
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------ 常量定义 ------------------------------
|
// ------------------------------ 常量定义 ------------------------------
|
||||||
public static final String DECLARE = "declare"; // 设备注册消息
|
public static final String DECLARE = "declare"; // 设备注册消息
|
||||||
public static final String PING = "ping"; // 心跳消息
|
public static final String PING = "ping"; // 心跳消息
|
||||||
@ -388,6 +393,8 @@ public class DeviceWebSocketServer {
|
|||||||
// 示例:BusAttendanceMachineService.register(sn);
|
// 示例:BusAttendanceMachineService.register(sn);
|
||||||
if (attendanceMachineService != null) {
|
if (attendanceMachineService != null) {
|
||||||
attendanceMachineService.insertBySn(sn);
|
attendanceMachineService.insertBySn(sn);
|
||||||
|
asyncUtil.repeatSend(sn);
|
||||||
|
asyncUtil.repeatDelete(sn);
|
||||||
} else {
|
} else {
|
||||||
log.error("IBusAttendanceMachineService 为空,无法进行设备注册");
|
log.error("IBusAttendanceMachineService 为空,无法进行设备注册");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -215,7 +215,7 @@ public class XzdCsContractInformationVo implements Serializable {
|
|||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "签约组织")
|
@ExcelProperty(value = "签约组织")
|
||||||
private Long signOrganization;
|
private Long signOrganization;
|
||||||
@Translation(type = TransConstant.XZD_KHXX_ID_TO_NAME, mapper = "signOrganization")
|
@Translation(type = TransConstant.DEPT_ID_TO_NAME, mapper = "signOrganization")
|
||||||
private String signOrganizationName;
|
private String signOrganizationName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -0,0 +1,7 @@
|
|||||||
|
<?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="org.dromara.project.mapper.BusAttendanceMachineRepeatMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
Reference in New Issue
Block a user