Compare commits
120 Commits
a941db7870
...
flowUpdate
| Author | SHA1 | Date | |
|---|---|---|---|
| f6e01abe0e | |||
| 02f324e1d4 | |||
| 96392dbf57 | |||
| e39e788ddc | |||
| e17ab16821 | |||
| 8a928e852d | |||
| 397f8ee768 | |||
| 8e25b416ec | |||
| e6b0527e44 | |||
| 403848cb4b | |||
| a4b1820e1c | |||
| c2afe05e81 | |||
| 1902ba9d59 | |||
| 1d1a0e45c6 | |||
| 72c775b1e3 | |||
| bec0848cd9 | |||
| 4e78886a82 | |||
| 292a56bccd | |||
| 3f12c15cf8 | |||
| 1ab47ccb57 | |||
| 321fc67c4f | |||
| b6e8031cef | |||
| d7265b08a8 | |||
| 2f0ad8a8cd | |||
| 22c58031d2 | |||
| 473f6943d5 | |||
| 08ef9ccfea | |||
| 94b5736241 | |||
| 95b4bc85b3 | |||
| dfaadd4977 | |||
| f372f22934 | |||
| bc91c44596 | |||
| 480d7be81d | |||
| 1c0be9b5ee | |||
| 9c7d8ffc96 | |||
| 167cbf256b | |||
| c3ce1c22d3 | |||
| 891c205233 | |||
| 3b184abc96 | |||
| 9a20cf0e43 | |||
| faf434e4d2 | |||
| 73988b8828 | |||
| 0c3b14e010 | |||
| d764fbe473 | |||
| 073f704c0e | |||
| 5f64f3aef4 | |||
| baa492b799 | |||
| a668381101 | |||
| 4f2ac72edc | |||
| b501965d25 | |||
| 57b662837d | |||
| f11ed11629 | |||
| cdcbfaa1a9 | |||
| ef775a3cfb | |||
| 818b67b5aa | |||
| a0554e47fd | |||
| 49c9ef8878 | |||
| 3265a58813 | |||
| 5a9044786c | |||
| d8d0828f8e | |||
| 8bade20502 | |||
| be944595e3 | |||
| 1eaf29b282 | |||
| 4bb24fe464 | |||
| e704522965 | |||
| 3440b885ee | |||
| 3e85e79bdd | |||
| 90b0eb82f4 | |||
| ef2c1ff455 | |||
| 074fb5bf86 | |||
| 3f4b127cdf | |||
| e93ea2fdfd | |||
| cf368db9af | |||
| 034d01d604 | |||
| af247d917b | |||
| a51d836dc2 | |||
| 1f233c142a | |||
| 4b3a56eb5f | |||
| 2b25ec1483 | |||
| 0736552eb7 | |||
| d99d59ffa0 | |||
| 5da05dcf24 | |||
| fceb06eca8 | |||
| 24219b6942 | |||
| 8566231790 | |||
| b96cc95741 | |||
| 8478cd2997 | |||
| 1bbc1e52ae | |||
| 9221cb50a3 | |||
| e8e15f4a98 | |||
| 0941197ca9 | |||
| 23dc2f2759 | |||
| 7321db3419 | |||
| be7576f8ea | |||
| cc72b1bd64 | |||
| e1d713b23e | |||
| 5ebc46d2e1 | |||
| 0da63144e7 | |||
| 347bd92b69 | |||
| 6d859c6a8c | |||
| 733b95632b | |||
| b905320413 | |||
| 8d4059bbf4 | |||
| b1b8ced0a8 | |||
| 9d3c212856 | |||
| ceec388f5f | |||
| 44f604ff57 | |||
| fae9c61f07 | |||
| e48b27715f | |||
| feb0e49da3 | |||
| 245cdb40f7 | |||
| a2d2431bce | |||
| 048a175526 | |||
| d9d2688e24 | |||
| 15382b5aba | |||
| 8500469918 | |||
| 864eb1462f | |||
| 86b44282ea | |||
| 7ccf5e4469 | |||
| 137ab4e802 |
@ -18,7 +18,7 @@
|
|||||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
<java.version>21</java.version>
|
<java.version>21</java.version>
|
||||||
<mybatis.version>3.5.16</mybatis.version>
|
<mybatis.version>3.5.16</mybatis.version>
|
||||||
<springdoc.version>2.8.4</springdoc.version>
|
<springdoc.version>2.3.0</springdoc.version>
|
||||||
<therapi-javadoc.version>0.15.0</therapi-javadoc.version>
|
<therapi-javadoc.version>0.15.0</therapi-javadoc.version>
|
||||||
<easyexcel.version>4.0.3</easyexcel.version>
|
<easyexcel.version>4.0.3</easyexcel.version>
|
||||||
<velocity.version>2.3</velocity.version>
|
<velocity.version>2.3</velocity.version>
|
||||||
@ -49,7 +49,7 @@
|
|||||||
<!-- 面向运行时的D-ORM依赖 -->
|
<!-- 面向运行时的D-ORM依赖 -->
|
||||||
<anyline.version>8.7.2-20250101</anyline.version>
|
<anyline.version>8.7.2-20250101</anyline.version>
|
||||||
<!--工作流配置-->
|
<!--工作流配置-->
|
||||||
<warm-flow.version>1.7.4</warm-flow.version>
|
<warm-flow.version>1.8.2</warm-flow.version>
|
||||||
|
|
||||||
<!-- 插件版本 -->
|
<!-- 插件版本 -->
|
||||||
<maven-jar-plugin.version>3.2.2</maven-jar-plugin.version>
|
<maven-jar-plugin.version>3.2.2</maven-jar-plugin.version>
|
||||||
|
|||||||
@ -59,9 +59,9 @@ spring:
|
|||||||
driverClassName: com.mysql.cj.jdbc.Driver
|
driverClassName: com.mysql.cj.jdbc.Driver
|
||||||
# jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
|
# jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
|
||||||
# rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
|
# rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
|
||||||
url: jdbc:mysql://192.168.110.2:13386/xinnengyuandev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
url: jdbc:mysql://192.168.110.2:13386/xinnengyuandev-update?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||||
username: xinnengyuandev
|
username: xinnengyuandev-update
|
||||||
password: StRWCZdZirysNSs2
|
password: cp7cAbWLZnRc6wyp
|
||||||
# url: jdbc:mysql://192.168.110.2:13386/xinnengyuan?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
# url: jdbc:mysql://192.168.110.2:13386/xinnengyuan?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||||
# username: xinnengyuan
|
# username: xinnengyuan
|
||||||
# password: mEZPC5Sdf3r2HENi
|
# password: mEZPC5Sdf3r2HENi
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -110,6 +110,8 @@ sa-token:
|
|||||||
timeout: 2592000
|
timeout: 2592000
|
||||||
# token临时有效期 (指定时间内无操作就视为token过期) 单位: 秒
|
# token临时有效期 (指定时间内无操作就视为token过期) 单位: 秒
|
||||||
active-timeout: 86400
|
active-timeout: 86400
|
||||||
|
# 同一账号最大登录数量,-1代表不限
|
||||||
|
max-login-count: -1
|
||||||
|
|
||||||
# security配置
|
# security配置
|
||||||
security:
|
security:
|
||||||
@ -135,6 +137,7 @@ security:
|
|||||||
- /facility/matrix/**
|
- /facility/matrix/**
|
||||||
- /hat/device/data
|
- /hat/device/data
|
||||||
- /websocket/ue
|
- /websocket/ue
|
||||||
|
- /websocket/vehicle
|
||||||
|
|
||||||
# 多租户配置
|
# 多租户配置
|
||||||
tenant:
|
tenant:
|
||||||
@ -207,6 +210,10 @@ api-decrypt:
|
|||||||
- /gps/equipment/dataAcceptance # GPS数据接收接口
|
- /gps/equipment/dataAcceptance # GPS数据接收接口
|
||||||
|
|
||||||
springdoc:
|
springdoc:
|
||||||
|
default-flat-param-object: true
|
||||||
|
swagger-ui:
|
||||||
|
path: /swagger-ui.html
|
||||||
|
tags-sorter: alpha
|
||||||
api-docs:
|
api-docs:
|
||||||
# 是否开启接口文档
|
# 是否开启接口文档
|
||||||
enabled: true
|
enabled: true
|
||||||
@ -226,10 +233,14 @@ springdoc:
|
|||||||
components:
|
components:
|
||||||
# 鉴权方式配置
|
# 鉴权方式配置
|
||||||
security-schemes:
|
security-schemes:
|
||||||
apiKey:
|
Authorization:
|
||||||
type: APIKEY
|
type: HTTP
|
||||||
in: HEADER
|
in: HEADER
|
||||||
name: ${sa-token.token-name}
|
name: ${sa-token.token-name}
|
||||||
|
Clientid:
|
||||||
|
type: HTTP
|
||||||
|
in: HEADER
|
||||||
|
name: Clientid
|
||||||
#这里定义了两个分组,可定义多个,也可以不定义
|
#这里定义了两个分组,可定义多个,也可以不定义
|
||||||
group-configs:
|
group-configs:
|
||||||
- group: 1.通用模块
|
- group: 1.通用模块
|
||||||
@ -318,6 +329,8 @@ xss:
|
|||||||
- /xzd/fenbaohetongbiangg/**
|
- /xzd/fenbaohetongbiangg/**
|
||||||
- /xzd/fenbaohetongxinxi/**
|
- /xzd/fenbaohetongxinxi/**
|
||||||
- /xzd/contractManagement/**
|
- /xzd/contractManagement/**
|
||||||
|
- /xzd/jixiehetongxinxi/contractMachinery/**
|
||||||
|
- /xzd/jixiehetongbiang/machineryContractAlteration/**
|
||||||
|
|
||||||
# 全局线程池相关配置
|
# 全局线程池相关配置
|
||||||
# 如使用JDK21请直接使用虚拟线程 不要开启此配置
|
# 如使用JDK21请直接使用虚拟线程 不要开启此配置
|
||||||
|
|||||||
@ -24,6 +24,7 @@ import org.dromara.facility.domain.FacMatrix;
|
|||||||
import org.dromara.facility.service.IFacMatrixService;
|
import org.dromara.facility.service.IFacMatrixService;
|
||||||
import org.dromara.facility.service.IFacPhotovoltaicPanelPartsService;
|
import org.dromara.facility.service.IFacPhotovoltaicPanelPartsService;
|
||||||
import org.dromara.facility.service.IFacPhotovoltaicPanelService;
|
import org.dromara.facility.service.IFacPhotovoltaicPanelService;
|
||||||
|
import org.dromara.manager.recognizermanager.enums.RecognizerTypeEnum;
|
||||||
import org.dromara.manager.recognizermanager.vo.RecognizeConvertCoordinateResult;
|
import org.dromara.manager.recognizermanager.vo.RecognizeConvertCoordinateResult;
|
||||||
import org.dromara.manager.ys7manager.Ys7Constant;
|
import org.dromara.manager.ys7manager.Ys7Constant;
|
||||||
import org.dromara.manager.ys7manager.Ys7Manager;
|
import org.dromara.manager.ys7manager.Ys7Manager;
|
||||||
@ -403,7 +404,8 @@ public class DemoTest {
|
|||||||
@Test
|
@Test
|
||||||
void testImport() {
|
void testImport() {
|
||||||
photovoltaicPanelService.updateFinishNumberByCoordinate(List.of(1968510961294921730L),
|
photovoltaicPanelService.updateFinishNumberByCoordinate(List.of(1968510961294921730L),
|
||||||
List.of(new RecognizeConvertCoordinateResult("107.124334530", "23.830557974")));
|
List.of(new RecognizeConvertCoordinateResult("107.124334530", "23.830557974")),
|
||||||
|
RecognizerTypeEnum.BRACKET.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
@ -26,4 +26,9 @@ public class RecognizerTest {
|
|||||||
RecognizeVo recognize = recognizerManager.recognize("http://xny.yj-3d.com:7363/file/tif/20250625160218orthophoto.png", List.of(RecognizerTypeEnum.PANEL));
|
RecognizeVo recognize = recognizerManager.recognize("http://xny.yj-3d.com:7363/file/tif/20250625160218orthophoto.png", List.of(RecognizerTypeEnum.PANEL));
|
||||||
log.info("recognize: {}", recognize);
|
log.info("recognize: {}", recognize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void testChange() {
|
||||||
|
recognizerManager.convertCoordinate("http://xny.yj-3d.com:9000/xinnengyuan-dev/2025/11/11/d48767a62bc04867a552e06ba6712004.tif", List.of());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,45 @@
|
|||||||
|
package org.dromara.common.core.domain.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程实例业务扩展对象
|
||||||
|
*
|
||||||
|
* @author may
|
||||||
|
* @date 2025-08-05
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class FlowInstanceBizExtDTO implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程实例ID
|
||||||
|
*/
|
||||||
|
private Long instanceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务ID
|
||||||
|
*/
|
||||||
|
private String businessId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务编码
|
||||||
|
*/
|
||||||
|
private String businessCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务标题
|
||||||
|
*/
|
||||||
|
private String businessTitle;
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,6 +1,7 @@
|
|||||||
package org.dromara.common.core.domain.dto;
|
package org.dromara.common.core.domain.dto;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
@ -30,11 +31,21 @@ public class StartProcessDTO implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String flowCode;
|
private String flowCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 办理人(可不填 用于覆盖当前节点办理人)
|
||||||
|
*/
|
||||||
|
private String handler;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 流程变量,前端会提交一个元素{'entity': {业务详情数据对象}}
|
* 流程变量,前端会提交一个元素{'entity': {业务详情数据对象}}
|
||||||
*/
|
*/
|
||||||
private Map<String, Object> variables;
|
private Map<String, Object> variables;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程业务扩展信息
|
||||||
|
*/
|
||||||
|
private FlowInstanceBizExtDTO bizExt;
|
||||||
|
|
||||||
public Map<String, Object> getVariables() {
|
public Map<String, Object> getVariables() {
|
||||||
if (variables == null) {
|
if (variables == null) {
|
||||||
return new HashMap<>(16);
|
return new HashMap<>(16);
|
||||||
@ -42,4 +53,11 @@ public class StartProcessDTO implements Serializable {
|
|||||||
variables.entrySet().removeIf(entry -> Objects.isNull(entry.getValue()));
|
variables.entrySet().removeIf(entry -> Objects.isNull(entry.getValue()));
|
||||||
return variables;
|
return variables;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public FlowInstanceBizExtDTO getBizExt() {
|
||||||
|
if (ObjectUtil.isNull(bizExt)) {
|
||||||
|
bizExt = new FlowInstanceBizExtDTO();
|
||||||
|
}
|
||||||
|
return bizExt;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -52,21 +52,23 @@ public class TaskAssigneeDTO implements Serializable {
|
|||||||
*/
|
*/
|
||||||
public static <T> List<TaskHandler> convertToHandlerList(
|
public static <T> List<TaskHandler> convertToHandlerList(
|
||||||
List<T> sourceList,
|
List<T> sourceList,
|
||||||
Function<T, Long> storageId,
|
Function<T, String> storageId,
|
||||||
Function<T, String> handlerCode,
|
Function<T, String> handlerCode,
|
||||||
Function<T, String> handlerName,
|
Function<T, String> handlerName,
|
||||||
Function<T, Long> groupName,
|
Function<T, String> groupName,
|
||||||
Function<T, Date> createTimeMapper) {
|
Function<T, Date> createTimeMapper) {
|
||||||
return sourceList.stream()
|
return sourceList.stream()
|
||||||
.map(item -> new TaskHandler(
|
.map(item -> new TaskHandler(
|
||||||
String.valueOf(storageId.apply(item)),
|
storageId.apply(item),
|
||||||
handlerCode.apply(item),
|
handlerCode.apply(item),
|
||||||
handlerName.apply(item),
|
handlerName.apply(item),
|
||||||
groupName != null ? String.valueOf(groupName.apply(item)) : null,
|
groupName.apply(item),
|
||||||
createTimeMapper.apply(item)
|
createTimeMapper.apply(item)
|
||||||
)).collect(Collectors.toList());
|
)).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
|
|||||||
@ -62,4 +62,10 @@ public class ProcessEvent implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private Boolean submit;
|
private Boolean submit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实例id
|
||||||
|
*/
|
||||||
|
private Long instanceId;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import lombok.Data;
|
|||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 流程办理监听
|
* 流程办理监听
|
||||||
@ -56,4 +57,14 @@ public class ProcessTaskEvent implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实例id
|
||||||
|
*/
|
||||||
|
private Long instanceId;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 办理参数
|
||||||
|
*/
|
||||||
|
private Map<String, Object> params;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package org.dromara.common.core.exception;
|
package org.dromara.common.core.exception;
|
||||||
|
|
||||||
|
import cn.hutool.core.text.StrFormatter;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
@ -56,4 +57,8 @@ public final class ServiceException extends RuntimeException {
|
|||||||
this.detailMessage = detailMessage;
|
this.detailMessage = detailMessage;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ServiceException(String message, Object... args) {
|
||||||
|
this.message = StrFormatter.format(message, args);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -82,6 +82,7 @@ public interface WorkflowService {
|
|||||||
* completeTask.getVariables().put("ignore", true);
|
* completeTask.getVariables().put("ignore", true);
|
||||||
*
|
*
|
||||||
* @param completeTask 参数
|
* @param completeTask 参数
|
||||||
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
boolean completeTask(CompleteTaskDTO completeTask);
|
boolean completeTask(CompleteTaskDTO completeTask);
|
||||||
|
|
||||||
@ -90,6 +91,15 @@ public interface WorkflowService {
|
|||||||
*
|
*
|
||||||
* @param taskId 任务ID
|
* @param taskId 任务ID
|
||||||
* @param message 办理意见
|
* @param message 办理意见
|
||||||
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
boolean completeTask(Long taskId, String message);
|
boolean completeTask(Long taskId, String message);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 启动流程并办理第一个任务
|
||||||
|
*
|
||||||
|
* @param startProcess 参数
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
boolean startCompleteTask(StartProcessDTO startProcess);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,5 @@
|
|||||||
|
package org.dromara.common.core.service;
|
||||||
|
|
||||||
|
public interface XzdCbysZjhcbService {
|
||||||
|
String selectNmaeByIds(String ids);
|
||||||
|
}
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
package org.dromara.common.core.service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 机械合同信息Service接口
|
||||||
|
*
|
||||||
|
* @author Lion Li
|
||||||
|
* @date 2025-11-12
|
||||||
|
*/
|
||||||
|
public interface XzdContractMachineryService {
|
||||||
|
|
||||||
|
String selectNmaeByIds(String ids);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
package org.dromara.common.core.service;
|
||||||
|
|
||||||
|
public interface XzdProjectManagerApprovalService {
|
||||||
|
|
||||||
|
String selectNmaeByIds(String ids);
|
||||||
|
}
|
||||||
@ -7,7 +7,6 @@ import lombok.NoArgsConstructor;
|
|||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.function.BiFunction;
|
import java.util.function.BiFunction;
|
||||||
import java.util.function.Consumer;
|
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@ -31,8 +30,10 @@ public class StreamUtils {
|
|||||||
if (CollUtil.isEmpty(collection)) {
|
if (CollUtil.isEmpty(collection)) {
|
||||||
return CollUtil.newArrayList();
|
return CollUtil.newArrayList();
|
||||||
}
|
}
|
||||||
|
return collection.stream()
|
||||||
|
.filter(function)
|
||||||
// 注意此处不要使用 .toList() 新语法 因为返回的是不可变List 会导致序列化问题
|
// 注意此处不要使用 .toList() 新语法 因为返回的是不可变List 会导致序列化问题
|
||||||
return collection.stream().filter(function).collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -40,13 +41,26 @@ public class StreamUtils {
|
|||||||
*
|
*
|
||||||
* @param collection 需要查询的集合
|
* @param collection 需要查询的集合
|
||||||
* @param function 过滤方法
|
* @param function 过滤方法
|
||||||
|
* @return 找到符合条件的第一个元素,没有则返回 Optional.empty()
|
||||||
|
*/
|
||||||
|
public static <E> Optional<E> findFirst(Collection<E> collection, Predicate<E> function) {
|
||||||
|
if (CollUtil.isEmpty(collection)) {
|
||||||
|
return Optional.empty();
|
||||||
|
}
|
||||||
|
return collection.stream()
|
||||||
|
.filter(function)
|
||||||
|
.findFirst();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 找到流中满足条件的第一个元素值
|
||||||
|
*
|
||||||
|
* @param collection 需要查询的集合
|
||||||
|
* @param function 过滤方法
|
||||||
* @return 找到符合条件的第一个元素,没有则返回 null
|
* @return 找到符合条件的第一个元素,没有则返回 null
|
||||||
*/
|
*/
|
||||||
public static <E> E findFirst(Collection<E> collection, Predicate<E> function) {
|
public static <E> E findFirstValue(Collection<E> collection, Predicate<E> function) {
|
||||||
if (CollUtil.isEmpty(collection)) {
|
return findFirst(collection,function).orElse(null);
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return collection.stream().filter(function).findFirst().orElse(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -54,13 +68,26 @@ public class StreamUtils {
|
|||||||
*
|
*
|
||||||
* @param collection 需要查询的集合
|
* @param collection 需要查询的集合
|
||||||
* @param function 过滤方法
|
* @param function 过滤方法
|
||||||
* @return 找到符合条件的任意一个元素,没有则返回null
|
* @return 找到符合条件的任意一个元素,没有则返回 Optional.empty()
|
||||||
*/
|
*/
|
||||||
public static <E> Optional<E> findAny(Collection<E> collection, Predicate<E> function) {
|
public static <E> Optional<E> findAny(Collection<E> collection, Predicate<E> function) {
|
||||||
if (CollUtil.isEmpty(collection)) {
|
if (CollUtil.isEmpty(collection)) {
|
||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
}
|
}
|
||||||
return collection.stream().filter(function).findAny();
|
return collection.stream()
|
||||||
|
.filter(function)
|
||||||
|
.findAny();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 找到流中任意一个满足条件的元素值
|
||||||
|
*
|
||||||
|
* @param collection 需要查询的集合
|
||||||
|
* @param function 过滤方法
|
||||||
|
* @return 找到符合条件的任意一个元素,没有则返回null
|
||||||
|
*/
|
||||||
|
public static <E> E findAnyValue(Collection<E> collection, Predicate<E> function) {
|
||||||
|
return findAny(collection,function).orElse(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -86,7 +113,10 @@ public class StreamUtils {
|
|||||||
if (CollUtil.isEmpty(collection)) {
|
if (CollUtil.isEmpty(collection)) {
|
||||||
return StringUtils.EMPTY;
|
return StringUtils.EMPTY;
|
||||||
}
|
}
|
||||||
return collection.stream().map(function).filter(Objects::nonNull).collect(Collectors.joining(delimiter));
|
return collection.stream()
|
||||||
|
.map(function)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.collect(Collectors.joining(delimiter));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -100,8 +130,11 @@ public class StreamUtils {
|
|||||||
if (CollUtil.isEmpty(collection)) {
|
if (CollUtil.isEmpty(collection)) {
|
||||||
return CollUtil.newArrayList();
|
return CollUtil.newArrayList();
|
||||||
}
|
}
|
||||||
|
return collection.stream()
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.sorted(comparing)
|
||||||
// 注意此处不要使用 .toList() 新语法 因为返回的是不可变List 会导致序列化问题
|
// 注意此处不要使用 .toList() 新语法 因为返回的是不可变List 会导致序列化问题
|
||||||
return collection.stream().filter(Objects::nonNull).sorted(comparing).collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -118,7 +151,9 @@ public class StreamUtils {
|
|||||||
if (CollUtil.isEmpty(collection)) {
|
if (CollUtil.isEmpty(collection)) {
|
||||||
return MapUtil.newHashMap();
|
return MapUtil.newHashMap();
|
||||||
}
|
}
|
||||||
return collection.stream().filter(Objects::nonNull).collect(Collectors.toMap(key, Function.identity(), (l, r) -> l));
|
return collection.stream()
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.collect(Collectors.toMap(key, Function.identity(), (l, r) -> l));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -137,7 +172,25 @@ public class StreamUtils {
|
|||||||
if (CollUtil.isEmpty(collection)) {
|
if (CollUtil.isEmpty(collection)) {
|
||||||
return MapUtil.newHashMap();
|
return MapUtil.newHashMap();
|
||||||
}
|
}
|
||||||
return collection.stream().filter(Objects::nonNull).collect(Collectors.toMap(key, value, (l, r) -> l));
|
return collection.stream()
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.collect(Collectors.toMap(key, value, (l, r) -> l));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取 map 中的数据作为新 Map 的 value ,key 不变
|
||||||
|
* @param map 需要处理的map
|
||||||
|
* @param take 取值函数
|
||||||
|
* @param <K> map中的key类型
|
||||||
|
* @param <E> map中的value类型
|
||||||
|
* @param <V> 新map中的value类型
|
||||||
|
* @return 新的map
|
||||||
|
*/
|
||||||
|
public static <K, E, V> Map<K, V> toMap(Map<K, E> map, BiFunction<K, E, V> take) {
|
||||||
|
if (CollUtil.isEmpty(map)) {
|
||||||
|
return MapUtil.newHashMap();
|
||||||
|
}
|
||||||
|
return toMap(map.entrySet(), Map.Entry::getKey, entry -> take.apply(entry.getKey(), entry.getValue()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -154,8 +207,8 @@ public class StreamUtils {
|
|||||||
if (CollUtil.isEmpty(collection)) {
|
if (CollUtil.isEmpty(collection)) {
|
||||||
return MapUtil.newHashMap();
|
return MapUtil.newHashMap();
|
||||||
}
|
}
|
||||||
return collection
|
return collection.stream()
|
||||||
.stream().filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
.collect(Collectors.groupingBy(key, LinkedHashMap::new, Collectors.toList()));
|
.collect(Collectors.groupingBy(key, LinkedHashMap::new, Collectors.toList()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -175,8 +228,8 @@ public class StreamUtils {
|
|||||||
if (CollUtil.isEmpty(collection)) {
|
if (CollUtil.isEmpty(collection)) {
|
||||||
return MapUtil.newHashMap();
|
return MapUtil.newHashMap();
|
||||||
}
|
}
|
||||||
return collection
|
return collection.stream()
|
||||||
.stream().filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
.collect(Collectors.groupingBy(key1, LinkedHashMap::new, Collectors.groupingBy(key2, LinkedHashMap::new, Collectors.toList())));
|
.collect(Collectors.groupingBy(key1, LinkedHashMap::new, Collectors.groupingBy(key2, LinkedHashMap::new, Collectors.toList())));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -193,11 +246,11 @@ public class StreamUtils {
|
|||||||
* @return 分类后的map
|
* @return 分类后的map
|
||||||
*/
|
*/
|
||||||
public static <E, T, U> Map<T, Map<U, E>> group2Map(Collection<E> collection, Function<E, T> key1, Function<E, U> key2) {
|
public static <E, T, U> Map<T, Map<U, E>> group2Map(Collection<E> collection, Function<E, T> key1, Function<E, U> key2) {
|
||||||
if (CollUtil.isEmpty(collection) || key1 == null || key2 == null) {
|
if (CollUtil.isEmpty(collection)) {
|
||||||
return MapUtil.newHashMap();
|
return MapUtil.newHashMap();
|
||||||
}
|
}
|
||||||
return collection
|
return collection.stream()
|
||||||
.stream().filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
.collect(Collectors.groupingBy(key1, LinkedHashMap::new, Collectors.toMap(key2, Function.identity(), (l, r) -> l)));
|
.collect(Collectors.groupingBy(key1, LinkedHashMap::new, Collectors.toMap(key2, Function.identity(), (l, r) -> l)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -215,8 +268,7 @@ public class StreamUtils {
|
|||||||
if (CollUtil.isEmpty(collection)) {
|
if (CollUtil.isEmpty(collection)) {
|
||||||
return CollUtil.newArrayList();
|
return CollUtil.newArrayList();
|
||||||
}
|
}
|
||||||
return collection
|
return collection.stream()
|
||||||
.stream()
|
|
||||||
.map(function)
|
.map(function)
|
||||||
.filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
// 注意此处不要使用 .toList() 新语法 因为返回的是不可变List 会导致序列化问题
|
// 注意此处不要使用 .toList() 新语法 因为返回的是不可变List 会导致序列化问题
|
||||||
@ -234,11 +286,10 @@ public class StreamUtils {
|
|||||||
* @return 转化后的Set
|
* @return 转化后的Set
|
||||||
*/
|
*/
|
||||||
public static <E, T> Set<T> toSet(Collection<E> collection, Function<E, T> function) {
|
public static <E, T> Set<T> toSet(Collection<E> collection, Function<E, T> function) {
|
||||||
if (CollUtil.isEmpty(collection) || function == null) {
|
if (CollUtil.isEmpty(collection)) {
|
||||||
return CollUtil.newHashSet();
|
return CollUtil.newHashSet();
|
||||||
}
|
}
|
||||||
return collection
|
return collection.stream()
|
||||||
.stream()
|
|
||||||
.map(function)
|
.map(function)
|
||||||
.filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
.collect(Collectors.toSet());
|
.collect(Collectors.toSet());
|
||||||
@ -258,26 +309,20 @@ public class StreamUtils {
|
|||||||
* @return 合并后的map
|
* @return 合并后的map
|
||||||
*/
|
*/
|
||||||
public static <K, X, Y, V> Map<K, V> merge(Map<K, X> map1, Map<K, Y> map2, BiFunction<X, Y, V> merge) {
|
public static <K, X, Y, V> Map<K, V> merge(Map<K, X> map1, Map<K, Y> map2, BiFunction<X, Y, V> merge) {
|
||||||
if (MapUtil.isEmpty(map1) && MapUtil.isEmpty(map2)) {
|
if (CollUtil.isEmpty(map1) && CollUtil.isEmpty(map2)) {
|
||||||
|
// 如果两个 map 都为空,则直接返回空的 map
|
||||||
return MapUtil.newHashMap();
|
return MapUtil.newHashMap();
|
||||||
} else if (MapUtil.isEmpty(map1)) {
|
} else if (CollUtil.isEmpty(map1)) {
|
||||||
map1 = MapUtil.newHashMap();
|
// 如果 map1 为空,则直接处理返回 map2
|
||||||
} else if (MapUtil.isEmpty(map2)) {
|
return toMap(map2.entrySet(), Map.Entry::getKey, entry -> merge.apply(null, entry.getValue()));
|
||||||
map2 = MapUtil.newHashMap();
|
} else if (CollUtil.isEmpty(map2)) {
|
||||||
|
// 如果 map2 为空,则直接处理返回 map1
|
||||||
|
return toMap(map1.entrySet(), Map.Entry::getKey, entry -> merge.apply(entry.getValue(), null));
|
||||||
}
|
}
|
||||||
Set<K> key = new HashSet<>();
|
Set<K> keySet = new HashSet<>();
|
||||||
key.addAll(map1.keySet());
|
keySet.addAll(map1.keySet());
|
||||||
key.addAll(map2.keySet());
|
keySet.addAll(map2.keySet());
|
||||||
Map<K, V> map = new HashMap<>();
|
return toMap(keySet, key -> key, key -> merge.apply(map1.get(key), map2.get(key)));
|
||||||
for (K t : key) {
|
|
||||||
X x = map1.get(t);
|
|
||||||
Y y = map2.get(t);
|
|
||||||
V z = merge.apply(x, y);
|
|
||||||
if (z != null) {
|
|
||||||
map.put(t, z);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return map;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -351,4 +351,14 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
|
|||||||
return noSpaces.matches("\\d+");
|
return noSpaces.matches("\\d+");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将可迭代对象中的元素使用逗号拼接成字符串
|
||||||
|
*
|
||||||
|
* @param iterable 可迭代对象,如 List、Set 等
|
||||||
|
* @return 拼接后的字符串
|
||||||
|
*/
|
||||||
|
public static String joinComma(Iterable<?> iterable) {
|
||||||
|
return StringUtils.join(iterable, SEPARATOR);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -44,7 +44,17 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.xiaoymin</groupId>
|
<groupId>com.github.xiaoymin</groupId>
|
||||||
<artifactId>knife4j-openapi3-jakarta-spring-boot-starter</artifactId>
|
<artifactId>knife4j-openapi3-jakarta-spring-boot-starter</artifactId>
|
||||||
<version>4.4.0</version>
|
<version>4.5.0</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.springdoc</groupId>
|
||||||
|
<artifactId>springdoc-openapi-starter-webmvc-api</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.springdoc</groupId>
|
||||||
|
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
package org.dromara.common.doc.config;
|
package org.dromara.common.doc.config;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.models.Components;
|
||||||
import io.swagger.v3.oas.models.OpenAPI;
|
import io.swagger.v3.oas.models.OpenAPI;
|
||||||
|
import io.swagger.v3.oas.models.Operation;
|
||||||
import io.swagger.v3.oas.models.Paths;
|
import io.swagger.v3.oas.models.Paths;
|
||||||
import io.swagger.v3.oas.models.info.Info;
|
import io.swagger.v3.oas.models.info.Info;
|
||||||
import io.swagger.v3.oas.models.security.SecurityRequirement;
|
import io.swagger.v3.oas.models.security.SecurityRequirement;
|
||||||
@ -9,6 +11,7 @@ import org.dromara.common.core.utils.StringUtils;
|
|||||||
import org.dromara.common.doc.config.properties.SpringDocProperties;
|
import org.dromara.common.doc.config.properties.SpringDocProperties;
|
||||||
import org.dromara.common.doc.handler.OpenApiHandler;
|
import org.dromara.common.doc.handler.OpenApiHandler;
|
||||||
import org.springdoc.core.configuration.SpringDocConfiguration;
|
import org.springdoc.core.configuration.SpringDocConfiguration;
|
||||||
|
import org.springdoc.core.customizers.GlobalOpenApiCustomizer;
|
||||||
import org.springdoc.core.customizers.OpenApiBuilderCustomizer;
|
import org.springdoc.core.customizers.OpenApiBuilderCustomizer;
|
||||||
import org.springdoc.core.customizers.OpenApiCustomizer;
|
import org.springdoc.core.customizers.OpenApiCustomizer;
|
||||||
import org.springdoc.core.customizers.ServerBaseUrlCustomizer;
|
import org.springdoc.core.customizers.ServerBaseUrlCustomizer;
|
||||||
@ -23,6 +26,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
|||||||
import org.springframework.boot.autoconfigure.web.ServerProperties;
|
import org.springframework.boot.autoconfigure.web.ServerProperties;
|
||||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.http.HttpHeaders;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -61,7 +65,6 @@ public class SpringDocConfig {
|
|||||||
keySet.forEach(securityRequirement::addList);
|
keySet.forEach(securityRequirement::addList);
|
||||||
list.add(securityRequirement);
|
list.add(securityRequirement);
|
||||||
openApi.security(list);
|
openApi.security(list);
|
||||||
|
|
||||||
return openApi;
|
return openApi;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -107,6 +110,15 @@ public class SpringDocConfig {
|
|||||||
}
|
}
|
||||||
PlusPaths newPaths = new PlusPaths();
|
PlusPaths newPaths = new PlusPaths();
|
||||||
oldPaths.forEach((k, v) -> newPaths.addPathItem(finalContextPath + k, v));
|
oldPaths.forEach((k, v) -> newPaths.addPathItem(finalContextPath + k, v));
|
||||||
|
newPaths.forEach((s, pathItem) -> {
|
||||||
|
// 为所有接口添加鉴权
|
||||||
|
pathItem.readOperations().forEach(operation -> {
|
||||||
|
operation.addSecurityItem(new SecurityRequirement()
|
||||||
|
.addList(HttpHeaders.AUTHORIZATION)
|
||||||
|
.addList("Clientid")
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
openApi.setPaths(newPaths);
|
openApi.setPaths(newPaths);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -123,4 +135,26 @@ public class SpringDocConfig {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public GlobalOpenApiCustomizer orderGlobalOpenApiCustomizer() {
|
||||||
|
return openApi -> {
|
||||||
|
// 全局添加鉴权参数
|
||||||
|
if(openApi.getPaths()!=null){
|
||||||
|
openApi.getPaths().forEach((s, pathItem) -> {
|
||||||
|
// 为所有接口添加鉴权
|
||||||
|
List<Operation> operations = pathItem.readOperations();
|
||||||
|
operations.forEach(operation -> {
|
||||||
|
operation.addSecurityItem(new SecurityRequirement()
|
||||||
|
.addList(HttpHeaders.AUTHORIZATION)
|
||||||
|
.addList("Clientid")
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,40 @@
|
|||||||
|
package org.dromara.common.excel.handler;
|
||||||
|
|
||||||
|
import com.alibaba.excel.write.handler.CellWriteHandler;
|
||||||
|
import com.alibaba.excel.write.handler.context.CellWriteHandlerContext;
|
||||||
|
import org.apache.poi.ss.usermodel.Cell;
|
||||||
|
import org.apache.poi.ss.usermodel.CellStyle;
|
||||||
|
import org.apache.poi.ss.usermodel.Workbook;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
public class LockColumnHandler implements CellWriteHandler {
|
||||||
|
|
||||||
|
private final Set<Integer> lockColumns;
|
||||||
|
|
||||||
|
public LockColumnHandler(Collection<Integer> lockColumns) {
|
||||||
|
this.lockColumns = new HashSet<>(lockColumns);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterCellDispose(CellWriteHandlerContext context) {
|
||||||
|
Cell cell = context.getCell();
|
||||||
|
if (cell == null) return;
|
||||||
|
|
||||||
|
Workbook workbook = cell.getSheet().getWorkbook();
|
||||||
|
|
||||||
|
// 必须为所有单元格创建一个新的 CellStyle
|
||||||
|
CellStyle style = workbook.createCellStyle();
|
||||||
|
|
||||||
|
// 锁定指定列
|
||||||
|
if (lockColumns.contains(cell.getColumnIndex())) {
|
||||||
|
style.setLocked(true);
|
||||||
|
} else {
|
||||||
|
style.setLocked(false); // 非锁定列必须明确设置为 false!
|
||||||
|
}
|
||||||
|
|
||||||
|
cell.setCellStyle(style);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,26 @@
|
|||||||
|
package org.dromara.common.excel.handler;
|
||||||
|
|
||||||
|
import com.alibaba.excel.write.handler.SheetWriteHandler;
|
||||||
|
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
|
||||||
|
import com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder;
|
||||||
|
import org.apache.poi.ss.usermodel.Sheet;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lilemy
|
||||||
|
* @date 2025-11-14 15:05
|
||||||
|
*/
|
||||||
|
public class SheetProtectHandler implements SheetWriteHandler {
|
||||||
|
|
||||||
|
private final String password;
|
||||||
|
|
||||||
|
public SheetProtectHandler(String password) {
|
||||||
|
this.password = password;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterSheetCreate(WriteWorkbookHolder writeWorkbookHolder,
|
||||||
|
WriteSheetHolder writeSheetHolder) {
|
||||||
|
Sheet sheet = writeSheetHolder.getSheet();
|
||||||
|
sheet.protectSheet(password); // 可为空字符串
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -4,7 +4,10 @@ import cn.hutool.core.collection.CollUtil;
|
|||||||
import cn.hutool.core.io.resource.ClassPathResource;
|
import cn.hutool.core.io.resource.ClassPathResource;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.alibaba.excel.EasyExcel;
|
import com.alibaba.excel.EasyExcel;
|
||||||
|
import com.alibaba.excel.ExcelReader;
|
||||||
import com.alibaba.excel.ExcelWriter;
|
import com.alibaba.excel.ExcelWriter;
|
||||||
|
import com.alibaba.excel.read.builder.ExcelReaderBuilder;
|
||||||
|
import com.alibaba.excel.read.metadata.ReadSheet;
|
||||||
import com.alibaba.excel.write.builder.ExcelWriterSheetBuilder;
|
import com.alibaba.excel.write.builder.ExcelWriterSheetBuilder;
|
||||||
import com.alibaba.excel.write.metadata.WriteSheet;
|
import com.alibaba.excel.write.metadata.WriteSheet;
|
||||||
import com.alibaba.excel.write.metadata.fill.FillConfig;
|
import com.alibaba.excel.write.metadata.fill.FillConfig;
|
||||||
@ -14,27 +17,27 @@ import jakarta.servlet.ServletOutputStream;
|
|||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import lombok.AccessLevel;
|
import lombok.AccessLevel;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.dromara.common.core.utils.file.FileUtils;
|
import org.dromara.common.core.utils.file.FileUtils;
|
||||||
import org.dromara.common.excel.convert.ExcelBigNumberConvert;
|
import org.dromara.common.excel.convert.ExcelBigNumberConvert;
|
||||||
import org.dromara.common.excel.core.*;
|
import org.dromara.common.excel.core.*;
|
||||||
import org.dromara.common.excel.handler.DataWriteHandler;
|
import org.dromara.common.excel.handler.DataWriteHandler;
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.dromara.common.excel.handler.LockColumnHandler;
|
||||||
|
import org.dromara.common.excel.handler.SheetProtectHandler;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.util.Collection;
|
import java.util.*;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Excel相关处理
|
* Excel相关处理
|
||||||
*
|
*
|
||||||
* @author Lion Li
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||||
public class ExcelUtil {
|
public class ExcelUtil {
|
||||||
|
|
||||||
@ -48,6 +51,41 @@ public class ExcelUtil {
|
|||||||
return EasyExcel.read(is).head(clazz).autoCloseStream(false).sheet().doReadSync();
|
return EasyExcel.read(is).head(clazz).autoCloseStream(false).sheet().doReadSync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 同步读取 Excel(支持读取多个 Sheet)
|
||||||
|
*
|
||||||
|
* @param is 输入流(一次性读取)
|
||||||
|
* @param clazz Excel 映射实体类
|
||||||
|
* @return 所有 Sheet 的数据汇总
|
||||||
|
*/
|
||||||
|
public static <T> List<T> importExcelAllSheet(InputStream is, Class<T> clazz) {
|
||||||
|
// 用于存放所有 sheet 的数据
|
||||||
|
List<T> allData = new ArrayList<>();
|
||||||
|
// 1. 构建 ExcelReader
|
||||||
|
ExcelReaderBuilder readerBuilder = EasyExcel.read(is);
|
||||||
|
ExcelReader reader = readerBuilder.build();
|
||||||
|
// 2. 获取 Excel 中全部 Sheet 信息(包含 SheetNo、页名等)
|
||||||
|
List<ReadSheet> readSheets = reader.excelExecutor().sheetList();
|
||||||
|
// 3. 遍历每一个 Sheet
|
||||||
|
for (ReadSheet sheet : readSheets) {
|
||||||
|
// 为每个 Sheet 创建独立监听器,用于接收读取结果
|
||||||
|
DefaultExcelListener<T> listener = new DefaultExcelListener<>(false);
|
||||||
|
// 4. 构建当前 Sheet 的读取器 使用 sheet.getSheetNo() 指定当前 sheet
|
||||||
|
ReadSheet readSheet = EasyExcel.readSheet(sheet.getSheetNo())
|
||||||
|
// 设置头映射实体类
|
||||||
|
.head(clazz)
|
||||||
|
// 注册读取监听器
|
||||||
|
.registerReadListener(listener)
|
||||||
|
.build();
|
||||||
|
// 5. 开始读取当前 Sheet
|
||||||
|
reader.read(readSheet);
|
||||||
|
// 6. 收集当前 Sheet 读取的数据
|
||||||
|
allData.addAll(listener.getExcelResult().getList());
|
||||||
|
}
|
||||||
|
// 7. 关闭读取器,释放资源
|
||||||
|
reader.finish();
|
||||||
|
return allData;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 使用校验监听器 异步导入 同步返回
|
* 使用校验监听器 异步导入 同步返回
|
||||||
@ -205,6 +243,37 @@ public class ExcelUtil {
|
|||||||
builder.doWrite(list);
|
builder.doWrite(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param list 导出数据集合
|
||||||
|
* @param sheetName 工作表的名称
|
||||||
|
* @param clazz 实体类
|
||||||
|
* @param lockColumns 锁定列
|
||||||
|
* @param merge 是否合并单元格
|
||||||
|
* @param os 输出流
|
||||||
|
*/
|
||||||
|
public static <T> void exportExcel(List<T> list, String sheetName, Class<T> clazz, List<Integer> lockColumns,
|
||||||
|
boolean merge, OutputStream os, List<DropDownOptions> options) {
|
||||||
|
ExcelWriterSheetBuilder builder = EasyExcel.write(os, clazz)
|
||||||
|
.registerWriteHandler(new LockColumnHandler(lockColumns)) // 锁定第3列
|
||||||
|
.registerWriteHandler(new SheetProtectHandler("dawdawdwad")) // 保护整张 sheet
|
||||||
|
.autoCloseStream(false)
|
||||||
|
// 自动适配
|
||||||
|
.registerWriteHandler(new LongestMatchColumnWidthStyleStrategy())
|
||||||
|
// 大数值自动转换 防止失真
|
||||||
|
.registerConverter(new ExcelBigNumberConvert())
|
||||||
|
.registerWriteHandler(new DataWriteHandler(clazz))
|
||||||
|
.sheet(sheetName);
|
||||||
|
if (merge) {
|
||||||
|
// 合并处理器
|
||||||
|
builder.registerWriteHandler(new CellMergeStrategy(list, true));
|
||||||
|
}
|
||||||
|
// 添加下拉框操作
|
||||||
|
builder.registerWriteHandler(new ExcelDownHandler(options));
|
||||||
|
builder.doWrite(list);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出多sheet excel(增强版,解决XML安全问题)
|
* 导出多sheet excel(增强版,解决XML安全问题)
|
||||||
*
|
*
|
||||||
@ -213,7 +282,9 @@ public class ExcelUtil {
|
|||||||
* @param clazz 实体类
|
* @param clazz 实体类
|
||||||
* @param optionsList 级联下拉选内容列表
|
* @param optionsList 级联下拉选内容列表
|
||||||
*/
|
*/
|
||||||
public static <T> void exportMultiSheetExcelEnhanced(List<List<T>> sheetData, List<String> sheetNames, Class<T> clazz, List<List<DropDownOptions>> optionsList,HttpServletResponse response) throws IOException {
|
public static <T> void exportMultiSheetExcelEnhanced(List<List<T>> sheetData, List<String> sheetNames,
|
||||||
|
Class<T> clazz, List<List<DropDownOptions>> optionsList,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
resetResponse("file", response);
|
resetResponse("file", response);
|
||||||
ExcelWriter excelWriter = null;
|
ExcelWriter excelWriter = null;
|
||||||
ServletOutputStream os = response.getOutputStream();
|
ServletOutputStream os = response.getOutputStream();
|
||||||
@ -224,6 +295,9 @@ public class ExcelUtil {
|
|||||||
.head(clazz)
|
.head(clazz)
|
||||||
.autoCloseStream(false)
|
.autoCloseStream(false)
|
||||||
.registerConverter(new ExcelBigNumberConvert())
|
.registerConverter(new ExcelBigNumberConvert())
|
||||||
|
// 自动适配
|
||||||
|
.registerWriteHandler(new LongestMatchColumnWidthStyleStrategy())
|
||||||
|
.registerWriteHandler(new DataWriteHandler(clazz))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
|
||||||
@ -252,12 +326,71 @@ public class ExcelUtil {
|
|||||||
excelWriter.finish();
|
excelWriter.finish();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// 记录日志但不中断主流程
|
// 记录日志但不中断主流程
|
||||||
e.printStackTrace();
|
log.error("Excel 导出错误", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出多sheet excel(增强版,解决XML安全问题)
|
||||||
|
*
|
||||||
|
* @param sheetData 多个sheet的数据
|
||||||
|
* @param sheetNames 多个sheet的名称
|
||||||
|
* @param clazz 实体类
|
||||||
|
* @param optionsList 级联下拉选内容列表
|
||||||
|
*/
|
||||||
|
public static <T> void exportExcel(List<List<T>> sheetData, List<String> sheetNames, List<Integer> lockColumns,
|
||||||
|
Class<T> clazz, List<List<DropDownOptions>> optionsList,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
resetResponse("file", response);
|
||||||
|
ExcelWriter excelWriter = null;
|
||||||
|
ServletOutputStream os = response.getOutputStream();
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 使用SXSSFWorkbook避免内存问题,并减少XML处理复杂度
|
||||||
|
excelWriter = EasyExcel.write(os)
|
||||||
|
.head(clazz)
|
||||||
|
.registerWriteHandler(new LockColumnHandler(lockColumns)) // 锁定第3列
|
||||||
|
// .registerWriteHandler(new SheetProtectHandler("dawdawdwad")) // 保护整张 sheet
|
||||||
|
.autoCloseStream(false)
|
||||||
|
.registerConverter(new ExcelBigNumberConvert())
|
||||||
|
// 自动适配
|
||||||
|
.registerWriteHandler(new LongestMatchColumnWidthStyleStrategy())
|
||||||
|
.registerWriteHandler(new DataWriteHandler(clazz))
|
||||||
|
.build();
|
||||||
|
|
||||||
|
|
||||||
|
// 为每个sheet写入数据
|
||||||
|
for (int i = 0; i < sheetData.size(); i++) {
|
||||||
|
// 创建基本sheet配置
|
||||||
|
WriteSheet writeSheet = EasyExcel.writerSheet(i, sheetNames.get(i))
|
||||||
|
.head(clazz)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
// 添加下拉选项(如果存在)
|
||||||
|
if (optionsList != null && optionsList.size() > i && optionsList.get(i) != null) {
|
||||||
|
ExcelDownHandler handler = new ExcelDownHandler(optionsList.get(i));
|
||||||
|
writeSheet.setCustomWriteHandlerList(
|
||||||
|
Collections.singletonList(handler));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 写入数据
|
||||||
|
excelWriter.write(sheetData.get(i), writeSheet);
|
||||||
|
}
|
||||||
|
|
||||||
|
} finally {
|
||||||
|
// 确保资源正确释放
|
||||||
|
if (excelWriter != null) {
|
||||||
|
try {
|
||||||
|
excelWriter.finish();
|
||||||
|
} catch (Exception e) {
|
||||||
|
// 记录日志但不中断主流程
|
||||||
|
log.error("Excel 导出错误", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 单表多数据模板导出 模板格式为 {.属性}
|
* 单表多数据模板导出 模板格式为 {.属性}
|
||||||
@ -493,6 +626,4 @@ public class ExcelUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -44,10 +44,6 @@ public interface TransConstant {
|
|||||||
String XZD_KHXX_ID_TO_NAME = "khxx_id_to_name";
|
String XZD_KHXX_ID_TO_NAME = "khxx_id_to_name";
|
||||||
|
|
||||||
|
|
||||||
// /**
|
|
||||||
// * 供应商id转名称
|
|
||||||
// */
|
|
||||||
// String XZD_KHXX_ID_TO_NAME = "gysxx_id_to_name";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新中大项目id转名称
|
* 新中大项目id转名称
|
||||||
@ -57,6 +53,12 @@ public interface TransConstant {
|
|||||||
* 采购合同id转名称
|
* 采购合同id转名称
|
||||||
*/
|
*/
|
||||||
String XZD_PURCHASE_CONTRACT_ID_TO_NAME = "xzd_purchase_contract_id_to_name";
|
String XZD_PURCHASE_CONTRACT_ID_TO_NAME = "xzd_purchase_contract_id_to_name";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 机械合同id转名称
|
||||||
|
*/
|
||||||
|
String XZD_PURCHASE_JXXIE_ID_TO_NAME = "xzd_purchase_contract_jixie_id_to_name";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 综合服务合同id转名称
|
* 综合服务合同id转名称
|
||||||
*/
|
*/
|
||||||
@ -69,4 +71,16 @@ public interface TransConstant {
|
|||||||
* 新中大供应商信息-开户银行id转银行名称
|
* 新中大供应商信息-开户银行id转银行名称
|
||||||
*/
|
*/
|
||||||
String XZD_SUPPLIER_OPEN_BANK_ID_TO_NAME = "xzd_supplier_open_bank_id_to_name";
|
String XZD_SUPPLIER_OPEN_BANK_ID_TO_NAME = "xzd_supplier_open_bank_id_to_name";
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新中大-项目经理推荐及审批id转名称
|
||||||
|
*/
|
||||||
|
String XZD_PROJECT_MANAGER_APPROVAL_ID_TO_NAME = "xzd_project_manager_approval_id_to_name";
|
||||||
|
/**
|
||||||
|
* 新中大-立项及成本-成本预算-总体计划成本id转名称
|
||||||
|
*/
|
||||||
|
String XZD_CBYS_ZJHCB_ID_TO_NAME = "xzd_cbys_zjhcb_id_to_name";
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,23 +1,23 @@
|
|||||||
package org.dromara.common.translation.core.impl;
|
package org.dromara.common.translation.core.impl;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.dromara.common.core.service.XzdSupplierInfoService;
|
import org.dromara.common.core.service.XzdCbysZjhcbService;
|
||||||
|
import org.dromara.common.core.service.XzdProjectManagerApprovalService;
|
||||||
import org.dromara.common.translation.annotation.TranslationType;
|
import org.dromara.common.translation.annotation.TranslationType;
|
||||||
import org.dromara.common.translation.constant.TransConstant;
|
import org.dromara.common.translation.constant.TransConstant;
|
||||||
import org.dromara.common.translation.core.TranslationInterface;
|
import org.dromara.common.translation.core.TranslationInterface;
|
||||||
|
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
//@TranslationType(type = TransConstant.XZD_KHXX_ID_TO_NAME)
|
@TranslationType(type = TransConstant.XZD_CBYS_ZJHCB_ID_TO_NAME)
|
||||||
public class XzdSupplierInfoImpl implements TranslationInterface<String> {
|
public class XzdCbysZjhcbImpl implements TranslationInterface<String> {
|
||||||
|
private final XzdCbysZjhcbService xzdCbysZjhcbService;
|
||||||
private final XzdSupplierInfoService xzdSupplierInfoService;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String translation(Object key, String other) {
|
public String translation(Object key, String other) {
|
||||||
if (key instanceof String ids) {
|
if (key instanceof String ids) {
|
||||||
return xzdSupplierInfoService.selectNmaeByIds(ids);
|
return xzdCbysZjhcbService.selectNmaeByIds(ids);
|
||||||
} else if (key instanceof Long id) {
|
} else if (key instanceof Long id) {
|
||||||
return xzdSupplierInfoService.selectNmaeByIds(id.toString());
|
return xzdCbysZjhcbService.selectNmaeByIds(id.toString());
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -0,0 +1,27 @@
|
|||||||
|
package org.dromara.common.translation.core.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.dromara.common.core.service.XzdContractMachineryService;
|
||||||
|
import org.dromara.common.core.service.XzdJsCgJungonService;
|
||||||
|
import org.dromara.common.translation.annotation.TranslationType;
|
||||||
|
import org.dromara.common.translation.constant.TransConstant;
|
||||||
|
import org.dromara.common.translation.core.TranslationInterface;
|
||||||
|
|
||||||
|
@AllArgsConstructor
|
||||||
|
@TranslationType(type = TransConstant.XZD_PURCHASE_JXXIE_ID_TO_NAME)
|
||||||
|
public class XzdJXHTTranslation implements TranslationInterface<String> {
|
||||||
|
|
||||||
|
private final XzdContractMachineryService xzdContractMachineryService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String translation(Object key, String other) {
|
||||||
|
if (key instanceof String ids) {
|
||||||
|
return xzdContractMachineryService.selectNmaeByIds(ids);
|
||||||
|
} else if (key instanceof Long id) {
|
||||||
|
return xzdContractMachineryService.selectNmaeByIds(id.toString());
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
package org.dromara.common.translation.core.impl;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.dromara.common.core.service.XzdProjectManagerApprovalService;
|
||||||
|
import org.dromara.common.translation.annotation.TranslationType;
|
||||||
|
import org.dromara.common.translation.constant.TransConstant;
|
||||||
|
import org.dromara.common.translation.core.TranslationInterface;
|
||||||
|
|
||||||
|
@AllArgsConstructor
|
||||||
|
@TranslationType(type = TransConstant.XZD_PROJECT_MANAGER_APPROVAL_ID_TO_NAME)
|
||||||
|
public class XzdProjectManagerApprovalImpl implements TranslationInterface<String> {
|
||||||
|
private final XzdProjectManagerApprovalService xzdProjectManagerApprovalService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String translation(Object key, String other) {
|
||||||
|
if (key instanceof String ids) {
|
||||||
|
return xzdProjectManagerApprovalService.selectNmaeByIds(ids);
|
||||||
|
} else if (key instanceof Long id) {
|
||||||
|
return xzdProjectManagerApprovalService.selectNmaeByIds(id.toString());
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -8,7 +8,9 @@ org.dromara.common.translation.core.impl.ProjectNameTranslationImpl
|
|||||||
org.dromara.common.translation.core.impl.XzdCustomerinformationImpl
|
org.dromara.common.translation.core.impl.XzdCustomerinformationImpl
|
||||||
org.dromara.common.translation.core.impl.XzdProjectImpl
|
org.dromara.common.translation.core.impl.XzdProjectImpl
|
||||||
org.dromara.common.translation.core.impl.XzdPurchaseContractInformationImpl
|
org.dromara.common.translation.core.impl.XzdPurchaseContractInformationImpl
|
||||||
org.dromara.common.translation.core.impl.XzdSupplierInfoImpl
|
|
||||||
org.dromara.common.translation.core.impl.XzdJsCgJungonImpl
|
org.dromara.common.translation.core.impl.XzdJsCgJungonImpl
|
||||||
org.dromara.common.translation.core.impl.XzdCsContractInformationImpl
|
org.dromara.common.translation.core.impl.XzdCsContractInformationImpl
|
||||||
org.dromara.common.translation.core.impl.XzdSupplierOpenBankImpl
|
org.dromara.common.translation.core.impl.XzdSupplierOpenBankImpl
|
||||||
|
org.dromara.common.translation.core.impl.XzdProjectManagerApprovalImpl
|
||||||
|
org.dromara.common.translation.core.impl.XzdCbysZjhcbImpl
|
||||||
|
org.dromara.common.translation.core.impl.XzdJXHTTranslation
|
||||||
|
|||||||
@ -45,8 +45,7 @@ public class PlusWebSocketInterceptor implements HandshakeInterceptor {
|
|||||||
String headerCid = ServletUtils.getRequest().getHeader(LoginHelper.CLIENT_KEY);
|
String headerCid = ServletUtils.getRequest().getHeader(LoginHelper.CLIENT_KEY);
|
||||||
String paramCid = ServletUtils.getParameter(LoginHelper.CLIENT_KEY);
|
String paramCid = ServletUtils.getParameter(LoginHelper.CLIENT_KEY);
|
||||||
String clientId = StpUtil.getExtra(LoginHelper.CLIENT_KEY).toString();
|
String clientId = StpUtil.getExtra(LoginHelper.CLIENT_KEY).toString();
|
||||||
String projectIdStr = ServletUtils.getRequest().getParameter("projectId");
|
String projectIdStr = ServletUtils.getRequest().getParameter(LoginHelper.PROJECT_KEY);
|
||||||
Long projectId = Long.parseLong(projectIdStr);
|
|
||||||
if (!StringUtils.equalsAny(clientId, headerCid, paramCid)) {
|
if (!StringUtils.equalsAny(clientId, headerCid, paramCid)) {
|
||||||
// token 无效
|
// token 无效
|
||||||
throw NotLoginException.newInstance(StpUtil.getLoginType(),
|
throw NotLoginException.newInstance(StpUtil.getLoginType(),
|
||||||
@ -55,7 +54,10 @@ public class PlusWebSocketInterceptor implements HandshakeInterceptor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
attributes.put(LOGIN_USER_KEY, loginUser);
|
attributes.put(LOGIN_USER_KEY, loginUser);
|
||||||
|
if (projectIdStr != null && !projectIdStr.isEmpty()) {
|
||||||
|
Long projectId = Long.parseLong(projectIdStr);
|
||||||
attributes.put(PROJECT_ID,projectId);
|
attributes.put(PROJECT_ID,projectId);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
} catch (NotLoginException e) {
|
} catch (NotLoginException e) {
|
||||||
log.error("WebSocket 认证失败'{}',无法访问系统资源", e.getMessage());
|
log.error("WebSocket 认证失败'{}',无法访问系统资源", e.getMessage());
|
||||||
|
|||||||
@ -29,6 +29,23 @@
|
|||||||
|
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<!-- TwelveMonkeys ImageIO 扩展 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.twelvemonkeys.imageio</groupId>
|
||||||
|
<artifactId>imageio-core</artifactId>
|
||||||
|
<version>3.12.0</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.twelvemonkeys.imageio</groupId>
|
||||||
|
<artifactId>imageio-webp</artifactId>
|
||||||
|
<version>3.12.0</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- https://mvnrepository.com/artifact/org.sejda.imageio/webp-imageio -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.sejda.imageio</groupId>
|
||||||
|
<artifactId>webp-imageio</artifactId>
|
||||||
|
<version>0.1.6</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba.cloud.ai</groupId>
|
<groupId>com.alibaba.cloud.ai</groupId>
|
||||||
<artifactId>spring-ai-alibaba-starter-dashscope</artifactId>
|
<artifactId>spring-ai-alibaba-starter-dashscope</artifactId>
|
||||||
|
|||||||
@ -20,13 +20,10 @@ import org.dromara.bigscreen.domain.dto.BusBwlBo;
|
|||||||
import org.dromara.bigscreen.domain.dto.BusSygjBo;
|
import org.dromara.bigscreen.domain.dto.BusSygjBo;
|
||||||
import org.dromara.bigscreen.domain.dto.BusWjzxBo;
|
import org.dromara.bigscreen.domain.dto.BusWjzxBo;
|
||||||
import org.dromara.bigscreen.domain.dto.TaskInfoDto;
|
import org.dromara.bigscreen.domain.dto.TaskInfoDto;
|
||||||
import org.dromara.bigscreen.domain.vo.BusBwlVo;
|
import org.dromara.bigscreen.domain.vo.*;
|
||||||
import org.dromara.bigscreen.domain.vo.BusSygjVo;
|
|
||||||
import org.dromara.bigscreen.domain.vo.BusWjzxVo;
|
|
||||||
import org.dromara.bigscreen.service.IBusBwlService;
|
import org.dromara.bigscreen.service.IBusBwlService;
|
||||||
import org.dromara.bigscreen.service.IBusSygjService;
|
import org.dromara.bigscreen.service.IBusSygjService;
|
||||||
import org.dromara.bigscreen.service.IBusWjzxService;
|
import org.dromara.bigscreen.service.IBusWjzxService;
|
||||||
import org.dromara.common.core.constant.SystemConstants;
|
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.core.domain.dto.UserDTO;
|
import org.dromara.common.core.domain.dto.UserDTO;
|
||||||
import org.dromara.common.core.enums.BusinessStatusEnum;
|
import org.dromara.common.core.enums.BusinessStatusEnum;
|
||||||
@ -41,7 +38,9 @@ import org.dromara.common.web.core.BaseController;
|
|||||||
import org.dromara.patch.domain.bo.PdMasterBo;
|
import org.dromara.patch.domain.bo.PdMasterBo;
|
||||||
import org.dromara.patch.domain.vo.PdMasterBymiAndQt;
|
import org.dromara.patch.domain.vo.PdMasterBymiAndQt;
|
||||||
import org.dromara.patch.service.IPdMasterService;
|
import org.dromara.patch.service.IPdMasterService;
|
||||||
|
import org.dromara.project.service.IBusProjectService;
|
||||||
import org.dromara.system.domain.SysMenu;
|
import org.dromara.system.domain.SysMenu;
|
||||||
|
import org.dromara.system.domain.vo.RouterVo;
|
||||||
import org.dromara.system.mapper.SysRoleMapper;
|
import org.dromara.system.mapper.SysRoleMapper;
|
||||||
import org.dromara.system.service.impl.SysMenuServiceImpl;
|
import org.dromara.system.service.impl.SysMenuServiceImpl;
|
||||||
import org.dromara.system.service.impl.SysUserServiceImpl;
|
import org.dromara.system.service.impl.SysUserServiceImpl;
|
||||||
@ -63,6 +62,7 @@ import java.time.DayOfWeek;
|
|||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 个人首页接口
|
* 个人首页接口
|
||||||
@ -94,10 +94,11 @@ public class PersonalHomeController extends BaseController {
|
|||||||
@Resource
|
@Resource
|
||||||
private IAIChatMemoryService aiChatMemoryService;
|
private IAIChatMemoryService aiChatMemoryService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IBusProjectService projectService;
|
||||||
|
|
||||||
private final SysRoleMapper roleMapper;
|
private final SysRoleMapper roleMapper;
|
||||||
private final SysMenuServiceImpl menuMapper;
|
private final SysMenuServiceImpl sysMenuService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// region AI 模块
|
// region AI 模块
|
||||||
|
|
||||||
@ -170,10 +171,17 @@ public class PersonalHomeController extends BaseController {
|
|||||||
|
|
||||||
// endregion
|
// endregion
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取我的项目信息
|
||||||
|
*/
|
||||||
|
@GetMapping("/getMyProjectInfo")
|
||||||
|
public R<List<MyProjectInfoVo>> getMyProjectInfoList() {
|
||||||
|
return R.ok(projectService.getMyProjectInfo());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 首页待办事项
|
* 首页待办事项
|
||||||
|
*
|
||||||
* @param projectId
|
* @param projectId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -223,6 +231,12 @@ public class PersonalHomeController extends BaseController {
|
|||||||
taskInfoDto.setTotal((long) page.size());
|
taskInfoDto.setTotal((long) page.size());
|
||||||
taskInfoDto.setWeekCount((long) weeklyTasks.size());
|
taskInfoDto.setWeekCount((long) weeklyTasks.size());
|
||||||
|
|
||||||
|
BusPdSjVo busPdSjVo = pdMasterService.queryPageListByDate();
|
||||||
|
BusWjzxSjDateVo busWjzxSjDateVo = busWjzxService.queryWjzx();
|
||||||
|
|
||||||
|
taskInfoDto.setBusWjzxSjDateVo(busWjzxSjDateVo);
|
||||||
|
taskInfoDto.setBusPdSjVo(busPdSjVo);
|
||||||
|
|
||||||
return R.ok(taskInfoDto);
|
return R.ok(taskInfoDto);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -301,9 +315,12 @@ public class PersonalHomeController extends BaseController {
|
|||||||
* 获取部门树
|
* 获取部门树
|
||||||
*/
|
*/
|
||||||
@GetMapping("/deptTree")
|
@GetMapping("/deptTree")
|
||||||
public R<List<SysMenu>> deptTree() {
|
public R<List<RouterVo>> deptTree() {
|
||||||
// SysRole role = roleMapper.selectById(1);
|
// SysRole role = roleMapper.selectById(1);
|
||||||
return R.ok(menuMapper.selectMenuTreeByUserId(SystemConstants.SUPER_ADMIN_ID, null));
|
List<SysMenu> menus = sysMenuService.selectMenuTreeByUserId(LoginHelper.getUserId(), null);
|
||||||
|
// menus = menus.stream().filter(menu -> "2".equals(menu.getMenuSource())).collect(Collectors.toList());
|
||||||
|
menus = menus.stream().filter(menu -> "1".equals(menu.getMenuSource())).collect(Collectors.toList());
|
||||||
|
return R.ok(sysMenuService.buildMenus(menus));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -53,6 +53,7 @@ import java.math.BigDecimal;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -211,6 +212,22 @@ public class ProjectBigScreenController extends BaseController {
|
|||||||
return R.ok(projectBigScreenService.getProjectPeople(projectId));
|
return R.ok(projectBigScreenService.getProjectPeople(projectId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询项目人员情况
|
||||||
|
*/
|
||||||
|
// @SaCheckPermission("project:big:screen")
|
||||||
|
@GetMapping("/ue/people/{projectId}")
|
||||||
|
public R<ProjectPeopleVo> getProjectPeopleUe(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable Long projectId) {
|
||||||
|
final Long tdyq = 1897160897167638529L;
|
||||||
|
final Long tdeq = 1968506669544656898L;
|
||||||
|
if (Objects.equals(projectId, tdeq) || Objects.equals(projectId, tdyq)) {
|
||||||
|
return R.ok(projectBigScreenService.getProjectPeopleTianDong());
|
||||||
|
} else {
|
||||||
|
return R.ok(projectBigScreenService.getProjectPeople(projectId));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询项目形象进度
|
* 查询项目形象进度
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -5,9 +5,10 @@ import jakarta.servlet.http.HttpServletResponse;
|
|||||||
import jakarta.validation.constraints.NotEmpty;
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.dromara.bigscreen.domain.SysRoleWork;
|
||||||
import org.dromara.bigscreen.domain.bo.SysRoleWorkBo;
|
import org.dromara.bigscreen.domain.bo.SysRoleWorkBo;
|
||||||
import org.dromara.bigscreen.domain.vo.SysRoleWorkVo;
|
import org.dromara.bigscreen.domain.vo.SysRoleWorkVo;
|
||||||
import org.dromara.bigscreen.service.ISysRoleWorkService;
|
import org.dromara.bigscreen.service.impl.SysRoleWorkServiceImpl;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.core.validate.AddGroup;
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
import org.dromara.common.core.validate.EditGroup;
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
@ -17,7 +18,10 @@ import org.dromara.common.log.annotation.Log;
|
|||||||
import org.dromara.common.log.enums.BusinessType;
|
import org.dromara.common.log.enums.BusinessType;
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
|
import org.dromara.common.satoken.utils.LoginHelper;
|
||||||
import org.dromara.common.web.core.BaseController;
|
import org.dromara.common.web.core.BaseController;
|
||||||
|
import org.dromara.project.domain.vo.project.BusProjectVo;
|
||||||
|
import org.dromara.system.domain.vo.SysRoleVo;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
@ -35,7 +39,7 @@ import java.util.List;
|
|||||||
@RequestMapping("/bigscreen/roleWork")
|
@RequestMapping("/bigscreen/roleWork")
|
||||||
public class SysRoleWorkController extends BaseController {
|
public class SysRoleWorkController extends BaseController {
|
||||||
|
|
||||||
private final ISysRoleWorkService sysRoleWorkService;
|
private final SysRoleWorkServiceImpl sysRoleWorkService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询角色流程对应列表
|
* 查询角色流程对应列表
|
||||||
@ -103,4 +107,45 @@ public class SysRoleWorkController extends BaseController {
|
|||||||
@PathVariable Long[] ids) {
|
@PathVariable Long[] ids) {
|
||||||
return toAjax(sysRoleWorkService.deleteWithValidByIds(List.of(ids), true));
|
return toAjax(sysRoleWorkService.deleteWithValidByIds(List.of(ids), true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前用户在制定项目下有流程的角色列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/getRoleList/{projectId}")
|
||||||
|
public R<List<SysRoleVo>> getRoleList(@PathVariable("projectId") Long projectId) {
|
||||||
|
return R.ok(sysRoleWorkService.getRoleList(projectId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断当前用户在所有项目下所有角色是否有角色流程
|
||||||
|
*/
|
||||||
|
@GetMapping("/isHaveValue")
|
||||||
|
public R<Boolean> isHaveValue() {
|
||||||
|
return R.ok(sysRoleWorkService.isHaveValue(LoginHelper.getUserId()));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户和项目判断是否有角色流程
|
||||||
|
*/
|
||||||
|
@GetMapping("/getRoleWork/{projectId}")
|
||||||
|
public R<Boolean> getRoleWorkByProject(@PathVariable("projectId") Long projectId) {
|
||||||
|
return R.ok(sysRoleWorkService.isHaveValueByProject(projectId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取角色对应流程 弃用
|
||||||
|
*/
|
||||||
|
@GetMapping("/getRoleToWork/{projectId}")
|
||||||
|
public R<SysRoleWork> getRoleWork(@PathVariable("projectId") Long projectId) {
|
||||||
|
return R.ok(sysRoleWorkService.getRoleWork(projectId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取有对应流程并且包含角色列表的项目列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/getProjectRoles")
|
||||||
|
public R<List<BusProjectVo>> getProjectRoles() {
|
||||||
|
return R.ok(sysRoleWorkService.getProjectRoles());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,58 +0,0 @@
|
|||||||
package org.dromara.bigscreen.domain;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class BusAttendanceByGo {
|
|
||||||
|
|
||||||
private Long id; // 主键ID
|
|
||||||
|
|
||||||
private String userName; // 人员姓名
|
|
||||||
|
|
||||||
private String pacePhoto; // 人脸照
|
|
||||||
|
|
||||||
private Long projectId; // 项目id
|
|
||||||
|
|
||||||
private String createBy; // 创建者
|
|
||||||
|
|
||||||
private String updateBy; // 更新者
|
|
||||||
|
|
||||||
private LocalDateTime createdAt; // 创建时间
|
|
||||||
|
|
||||||
private LocalDateTime updatedAt; // 更新时间
|
|
||||||
|
|
||||||
private LocalDateTime deletedAt; // 删除时间
|
|
||||||
|
|
||||||
private String clockOn; // 上午打卡
|
|
||||||
|
|
||||||
private String clockOff; // 下午打卡
|
|
||||||
|
|
||||||
private String printingDate; // 年月日打卡时间
|
|
||||||
|
|
||||||
private String isPinch; // 1正常,2迟到,3早退,4缺勤,5补卡
|
|
||||||
|
|
||||||
private String openid; // 微信id
|
|
||||||
|
|
||||||
private String pinchOpenId; // 代打id
|
|
||||||
|
|
||||||
private String clockRecord; // 多次打卡时间记录
|
|
||||||
|
|
||||||
private String pinchUserName; // 代打人姓名
|
|
||||||
|
|
||||||
private String commuter; // 上下班(1上班 2下班)
|
|
||||||
|
|
||||||
private String punchRange; // 打卡范围
|
|
||||||
|
|
||||||
private BigDecimal dailyWage; // 日薪
|
|
||||||
|
|
||||||
private String lng; // 经度
|
|
||||||
|
|
||||||
private String lat; // 纬度
|
|
||||||
|
|
||||||
private String location; // 逆编码地址信息
|
|
||||||
|
|
||||||
private LocalDateTime missing; // 缺卡统一处理时间
|
|
||||||
}
|
|
||||||
@ -1,91 +0,0 @@
|
|||||||
package org.dromara.bigscreen.domain;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@TableName("bus_construction_user")
|
|
||||||
public class BusConstructionUser {
|
|
||||||
|
|
||||||
@TableId(type = IdType.AUTO)
|
|
||||||
private Long id; // 主键ID
|
|
||||||
|
|
||||||
private String openid; // 微信id
|
|
||||||
|
|
||||||
private String nickName; // 微信名称
|
|
||||||
|
|
||||||
private Long teamId; // 班组id
|
|
||||||
|
|
||||||
private String headIcon; // 登陆照片
|
|
||||||
|
|
||||||
private String pacePhoto; // 人脸照
|
|
||||||
|
|
||||||
private String userName; // 人员姓名
|
|
||||||
|
|
||||||
private Long projectId; // 项目id
|
|
||||||
|
|
||||||
private String status; // 状态(0在职 1离职)-字典position_status
|
|
||||||
|
|
||||||
private String isPinch; // 是否代打
|
|
||||||
|
|
||||||
private String ifManagement; // 是否班组管理
|
|
||||||
|
|
||||||
private String createBy; // 创建者
|
|
||||||
|
|
||||||
private String updateBy; // 更新者
|
|
||||||
|
|
||||||
private LocalDateTime createdAt; // 创建时间
|
|
||||||
|
|
||||||
private LocalDateTime updatedAt; // 更新时间
|
|
||||||
|
|
||||||
private LocalDateTime deletedAt; // 删除时间
|
|
||||||
|
|
||||||
private String phone; // 电话
|
|
||||||
|
|
||||||
private String sex; // 1:男,2女,3保密
|
|
||||||
|
|
||||||
private String sfzNation; // 身份证民族
|
|
||||||
|
|
||||||
private String sfzNumber; // 身份证号码
|
|
||||||
|
|
||||||
private String sfzStart; // 身份证有效开始期
|
|
||||||
|
|
||||||
private String sfzEnd; // 身份证有效结束期
|
|
||||||
|
|
||||||
private String sfzSite; // 身份证地址
|
|
||||||
|
|
||||||
private String sfzBirth; // 身份证出生日期
|
|
||||||
|
|
||||||
private String nativePlace; // 籍贯
|
|
||||||
|
|
||||||
private String yhkNumber; // 银行卡号
|
|
||||||
|
|
||||||
private String yhkOpeningBank; // 开户行
|
|
||||||
|
|
||||||
private String yhkCardholder; // 持卡人
|
|
||||||
|
|
||||||
private String typeOfWork; // 工种(字典)
|
|
||||||
|
|
||||||
private String clock; // 打卡(1启用打卡 2禁止打卡)
|
|
||||||
|
|
||||||
private Long labourserviceId; // 劳务公司id
|
|
||||||
|
|
||||||
private String entryDate; // 入场时间
|
|
||||||
|
|
||||||
private String leaveDate; // 离场时间
|
|
||||||
|
|
||||||
private BigDecimal salary; // 薪水(为0表示无效)
|
|
||||||
|
|
||||||
private String projectRecord; // 是否开启项目备案(1开启 2不开启)
|
|
||||||
|
|
||||||
private String wxOrPc; // 哪添加的(1表示pc 2表示小程序)
|
|
||||||
|
|
||||||
private String subscription; // 消息订阅状态(1订阅 2无订阅)
|
|
||||||
|
|
||||||
private String devNum; // 安全帽设备标识
|
|
||||||
}
|
|
||||||
@ -1,52 +0,0 @@
|
|||||||
package org.dromara.bigscreen.domain;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 企业大事记
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@TableName("bus_corporate_events")
|
|
||||||
public class BusCorporateEvents {
|
|
||||||
|
|
||||||
@TableId(type = IdType.AUTO)
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 标题
|
|
||||||
*/
|
|
||||||
private String headline;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 内容
|
|
||||||
*/
|
|
||||||
private String content;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建人
|
|
||||||
*/
|
|
||||||
private Long createdBy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新人
|
|
||||||
*/
|
|
||||||
private Long updatedBy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建时间
|
|
||||||
*/
|
|
||||||
private LocalDateTime createdAt;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新时间
|
|
||||||
*/
|
|
||||||
private LocalDateTime updatedAt;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除时间(软删除标记)
|
|
||||||
*/
|
|
||||||
private LocalDateTime deletedAt;
|
|
||||||
}
|
|
||||||
@ -1,31 +0,0 @@
|
|||||||
package org.dromara.bigscreen.domain;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class BusProjectTeamByGo {
|
|
||||||
|
|
||||||
private Long id; // 主键id
|
|
||||||
|
|
||||||
private Long projectId; // 项目id
|
|
||||||
|
|
||||||
private String name; // 班组名称
|
|
||||||
|
|
||||||
private String isClockIn; // 范围内打卡(0范围内打卡 1任何地点打卡)
|
|
||||||
|
|
||||||
private String punchRange; // 打卡范围(id串)
|
|
||||||
|
|
||||||
private String remark; // 备注
|
|
||||||
|
|
||||||
private String createBy; // 创建者
|
|
||||||
|
|
||||||
private String updateBy; // 更新者
|
|
||||||
|
|
||||||
private Long createDept; // 创建部门
|
|
||||||
|
|
||||||
private LocalDateTime createTime; // 创建时间
|
|
||||||
|
|
||||||
private LocalDateTime updateTime; // 更新时间
|
|
||||||
}
|
|
||||||
@ -1,25 +0,0 @@
|
|||||||
package org.dromara.bigscreen.domain;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class BusProjectTeamMemberByGo {
|
|
||||||
|
|
||||||
private Long id; // 主键id
|
|
||||||
|
|
||||||
private Long teamId; // 班组id
|
|
||||||
|
|
||||||
private Long projectId; // 项目id
|
|
||||||
|
|
||||||
private Long memberId; // 施工人员id
|
|
||||||
|
|
||||||
private String postId; // 岗位(0普通员工,1组长)
|
|
||||||
|
|
||||||
private String remark; // 备注
|
|
||||||
|
|
||||||
private LocalDateTime createTime; // 创建时间
|
|
||||||
|
|
||||||
private LocalDateTime updateTime; // 更新时间
|
|
||||||
}
|
|
||||||
@ -37,6 +37,17 @@ public class BusSygj extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
private String gjUrl;
|
private String gjUrl;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 图片id
|
||||||
|
*
|
||||||
|
* */
|
||||||
|
private Long imgId;
|
||||||
|
/**
|
||||||
|
* 图片路径
|
||||||
|
* */
|
||||||
|
private String imgUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 审核标志
|
* 审核标志
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -1,35 +0,0 @@
|
|||||||
package org.dromara.bigscreen.domain;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class BusTour {
|
|
||||||
|
|
||||||
private Long id; // 主键ID
|
|
||||||
|
|
||||||
private Long projectId; // 项目id
|
|
||||||
|
|
||||||
private String tourCategory; // 类别字典(如:无人机识别、监控拍摄)
|
|
||||||
|
|
||||||
private String tourType; // 类型字典(如:安全帽、安全带)
|
|
||||||
|
|
||||||
private String picture; // 图片路径
|
|
||||||
|
|
||||||
private Integer num; // 违规数量
|
|
||||||
|
|
||||||
private String describe; // 故障描述
|
|
||||||
|
|
||||||
private Date createdAt; // 创建时间
|
|
||||||
|
|
||||||
private Date updatedAt; // 更新时间
|
|
||||||
|
|
||||||
private Date deletedAt; // 删除时间
|
|
||||||
|
|
||||||
private String tableName; // 表名
|
|
||||||
|
|
||||||
private Long tableId; // 表id
|
|
||||||
|
|
||||||
private String sxtName; // 摄像头名称
|
|
||||||
}
|
|
||||||
@ -1,34 +0,0 @@
|
|||||||
package org.dromara.bigscreen.domain;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@TableName("sys_project_introduce")
|
|
||||||
public class SysProjectIntroduce {
|
|
||||||
|
|
||||||
@TableId(type = IdType.AUTO)
|
|
||||||
private Long id; // 主键id
|
|
||||||
|
|
||||||
private Long projectId; // 项目id
|
|
||||||
|
|
||||||
private String headline; // 标题
|
|
||||||
|
|
||||||
private String richText; // 富文本
|
|
||||||
|
|
||||||
private String createdBy; // 创建人
|
|
||||||
|
|
||||||
private String updatedBy; // 更新人
|
|
||||||
|
|
||||||
private LocalDateTime createdAt; // 创建时间
|
|
||||||
|
|
||||||
private LocalDateTime updatedAt; // 更新时间
|
|
||||||
|
|
||||||
private LocalDateTime deletedAt; // 删除时间
|
|
||||||
|
|
||||||
private String files; // 附件
|
|
||||||
}
|
|
||||||
@ -33,6 +33,11 @@ public class SysRoleWork extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
private Long roleId;
|
private Long roleId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 绑定项目id
|
||||||
|
*/
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 流程名称
|
* 流程名称
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -27,6 +27,11 @@ public class SysRoleWorkBo extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
private Long roleId;
|
private Long roleId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 绑定项目id
|
||||||
|
*/
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 流程名称
|
* 流程名称
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -36,6 +36,13 @@ public class BusSygjBo extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
private String gjUrl;
|
private String gjUrl;
|
||||||
|
|
||||||
|
private Long imgId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 图片路径
|
||||||
|
* */
|
||||||
|
private String imgUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 审核标志
|
* 审核标志
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
package org.dromara.bigscreen.domain.dto;
|
package org.dromara.bigscreen.domain.dto;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import org.dromara.bigscreen.domain.vo.BusPdSjVo;
|
||||||
|
import org.dromara.bigscreen.domain.vo.BusWjzxSjDateVo;
|
||||||
import org.dromara.workflow.domain.vo.FlowTaskVo;
|
import org.dromara.workflow.domain.vo.FlowTaskVo;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
@ -24,4 +26,14 @@ public class TaskInfoDto implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private Long weekCount;
|
private Long weekCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*知识库上传数据
|
||||||
|
*/
|
||||||
|
private BusWjzxSjDateVo busWjzxSjDateVo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 派单数据
|
||||||
|
*/
|
||||||
|
private BusPdSjVo busPdSjVo;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,19 @@
|
|||||||
|
package org.dromara.bigscreen.domain.vo;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class BusPdSjVo {
|
||||||
|
/**
|
||||||
|
* 我的派单
|
||||||
|
*/
|
||||||
|
private Long wdpdrw;
|
||||||
|
/**
|
||||||
|
* 其他派单
|
||||||
|
*/
|
||||||
|
private Long qtbmpd;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -52,6 +52,13 @@ public class BusSygjVo implements Serializable {
|
|||||||
@ExcelProperty(value = "审核标志")
|
@ExcelProperty(value = "审核标志")
|
||||||
private String auditStatus;
|
private String auditStatus;
|
||||||
|
|
||||||
|
private Long imgId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 图片路径
|
||||||
|
* */
|
||||||
|
private String imgUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工具类型 1内部 ,2外部
|
* 工具类型 1内部 ,2外部
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -0,0 +1,16 @@
|
|||||||
|
package org.dromara.bigscreen.domain.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class BusWjzxSjDateVo {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最近上传
|
||||||
|
*/
|
||||||
|
private Long zjsc;
|
||||||
|
/**
|
||||||
|
* 总数
|
||||||
|
*/
|
||||||
|
private Long zs;
|
||||||
|
}
|
||||||
@ -1,11 +1,8 @@
|
|||||||
package org.dromara.bigscreen.domain.vo;
|
package org.dromara.bigscreen.domain.vo;
|
||||||
|
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
|
||||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
|
||||||
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
|
|
||||||
@ -63,6 +60,11 @@ public class MilestoneVo {
|
|||||||
*/
|
*/
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否为当前节点(0不是 1是)
|
||||||
|
*/
|
||||||
|
private Integer active = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -23,6 +23,11 @@ public class MyProjectInfoVo implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private Long projectId;
|
private Long projectId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 负责人
|
||||||
|
*/
|
||||||
|
private String principal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 项目名称
|
* 项目名称
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -36,6 +36,12 @@ public class SysRoleWorkVo implements Serializable {
|
|||||||
@ExcelProperty(value = "绑定角色ID")
|
@ExcelProperty(value = "绑定角色ID")
|
||||||
private Long roleId;
|
private Long roleId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 绑定项目id
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "绑定项目ID")
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 角色名称
|
* 角色名称
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -41,7 +41,7 @@ public class RedisMessageListener implements MessageListener {
|
|||||||
public void onMessage(Message message, byte[] pattern) {
|
public void onMessage(Message message, byte[] pattern) {
|
||||||
try {
|
try {
|
||||||
// 1. 快速日志记录(证明监听到消息)
|
// 1. 快速日志记录(证明监听到消息)
|
||||||
log.info("【Redis消息监听】收到消息,长度:{}字节,提交异步处理", message.getBody().length);
|
// log.info("【Redis消息监听】收到消息,长度:{}字节,提交异步处理", message.getBody().length);
|
||||||
|
|
||||||
// 2. 提交给异步服务处理(核心:线程分离,监听线程立即返回)
|
// 2. 提交给异步服务处理(核心:线程分离,监听线程立即返回)
|
||||||
asyncMessageHandlerService.handleRedisMessageAsync(message);
|
asyncMessageHandlerService.handleRedisMessageAsync(message);
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
package org.dromara.bigscreen.mapper;
|
package org.dromara.bigscreen.mapper;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Select;
|
||||||
import org.dromara.bigscreen.domain.SysRoleWork;
|
import org.dromara.bigscreen.domain.SysRoleWork;
|
||||||
import org.dromara.bigscreen.domain.vo.SysRoleWorkVo;
|
import org.dromara.bigscreen.domain.vo.SysRoleWorkVo;
|
||||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||||
|
import org.dromara.system.domain.SysUserRole;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 角色流程对应Mapper接口
|
* 角色流程对应Mapper接口
|
||||||
@ -12,4 +16,16 @@ import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
|||||||
*/
|
*/
|
||||||
public interface SysRoleWorkMapper extends BaseMapperPlus<SysRoleWork, SysRoleWorkVo> {
|
public interface SysRoleWorkMapper extends BaseMapperPlus<SysRoleWork, SysRoleWorkVo> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据登录人id和项目ID获取对应角色
|
||||||
|
*/
|
||||||
|
@Select("select * from sys_user_role where user_id = #{userId} and project_id = #{projectId}")
|
||||||
|
List<SysUserRole> getRoleList(Long userId,Long projectId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据登录人id获取所有项目下所有角色
|
||||||
|
*/
|
||||||
|
@Select("select * from sys_user_role where user_id = #{userId}")
|
||||||
|
List<SysUserRole> getAllRoleList(Long userId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package org.dromara.bigscreen.service;
|
package org.dromara.bigscreen.service;
|
||||||
|
|
||||||
import org.dromara.bigscreen.domain.dto.BusWjzxBo;
|
import org.dromara.bigscreen.domain.dto.BusWjzxBo;
|
||||||
|
import org.dromara.bigscreen.domain.vo.BusWjzxSjDateVo;
|
||||||
import org.dromara.bigscreen.domain.vo.BusWjzxVo;
|
import org.dromara.bigscreen.domain.vo.BusWjzxVo;
|
||||||
import org.dromara.bigscreen.domain.BusWjzx;
|
import org.dromara.bigscreen.domain.BusWjzx;
|
||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
@ -33,7 +34,12 @@ public interface IBusWjzxService extends IService<BusWjzx>{
|
|||||||
* @param pageQuery 分页参数
|
* @param pageQuery 分页参数
|
||||||
* @return 文件中心分页列表
|
* @return 文件中心分页列表
|
||||||
*/
|
*/
|
||||||
TableDataInfo<BusWjzxVo> queryPageList(BusWjzxBo bo, PageQuery pageQuery);
|
TableDataInfo<BusWjzxVo> queryPageList(BusWjzxBo bo, PageQuery pageQuery); /**
|
||||||
|
* 分页查询文件中心列表
|
||||||
|
*
|
||||||
|
* @return 文件中心分页列表
|
||||||
|
*/
|
||||||
|
BusWjzxSjDateVo queryWjzx();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询符合条件的文件中心列表
|
* 查询符合条件的文件中心列表
|
||||||
|
|||||||
@ -60,6 +60,13 @@ public interface ProjectBigScreenService {
|
|||||||
*/
|
*/
|
||||||
ProjectPeopleVo getProjectPeople(Long projectId);
|
ProjectPeopleVo getProjectPeople(Long projectId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取项目人员(田东一二期)
|
||||||
|
*
|
||||||
|
* @return 项目人员
|
||||||
|
*/
|
||||||
|
ProjectPeopleVo getProjectPeopleTianDong();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取项目形象进度
|
* 获取项目形象进度
|
||||||
*
|
*
|
||||||
@ -89,6 +96,7 @@ public interface ProjectBigScreenService {
|
|||||||
void setList(GpsEquipmentBo bo);
|
void setList(GpsEquipmentBo bo);
|
||||||
|
|
||||||
List<Map<String, Object>> getClientList(Long projectId);
|
List<Map<String, Object>> getClientList(Long projectId);
|
||||||
|
|
||||||
List<String> getUeClientList();
|
List<String> getUeClientList();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -43,7 +43,7 @@ public class AsyncMessageHandlerServiceImpl implements IAsyncMessageHandlerServi
|
|||||||
try {
|
try {
|
||||||
// 1. 解析消息体(只解析一次,避免重复操作)
|
// 1. 解析消息体(只解析一次,避免重复操作)
|
||||||
byte[] messageBody = message.getBody();
|
byte[] messageBody = message.getBody();
|
||||||
if (messageBody == null || messageBody.length == 0) {
|
if (messageBody.length == 0) {
|
||||||
log.warn("【异步消息处理】消息体为空,忽略处理");
|
log.warn("【异步消息处理】消息体为空,忽略处理");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -76,8 +76,8 @@ public class AsyncMessageHandlerServiceImpl implements IAsyncMessageHandlerServi
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
String key = "";
|
String key;
|
||||||
DroProjectDrone droProjectDrone = null;
|
DroProjectDrone droProjectDrone;
|
||||||
boolean isOsd4 = false;
|
boolean isOsd4 = false;
|
||||||
|
|
||||||
// 5. 根据data字段内容判断key类型,并查询无人机信息
|
// 5. 根据data字段内容判断key类型,并查询无人机信息
|
||||||
@ -143,14 +143,14 @@ public class AsyncMessageHandlerServiceImpl implements IAsyncMessageHandlerServi
|
|||||||
|
|
||||||
private String buildPushMessage(String key, String message, Long projectId) {
|
private String buildPushMessage(String key, String message, Long projectId) {
|
||||||
JSONObject messageObj = new JSONObject();
|
JSONObject messageObj = new JSONObject();
|
||||||
messageObj.put("type", "wrj_DATA_UPDATE");
|
messageObj.set("type", "wrj_DATA_UPDATE");
|
||||||
messageObj.put("projectId",projectId.toString());
|
messageObj.set("projectId", projectId.toString());
|
||||||
messageObj.put("clientId",key);
|
messageObj.set("clientId", key);
|
||||||
// 位置信息
|
// 位置信息
|
||||||
JSONObject locationObj = new JSONObject();
|
JSONObject locationObj = new JSONObject();
|
||||||
locationObj.put("latitude", JSONUtil.parseObj(message).getJSONObject("data").get("latitude").toString()); // 纬度
|
locationObj.set("latitude", JSONUtil.parseObj(message).getJSONObject("data").get("latitude").toString()); // 纬度
|
||||||
locationObj.put("longitude", JSONUtil.parseObj(message).getJSONObject("data").get("longitude").toString()); // 经度
|
locationObj.set("longitude", JSONUtil.parseObj(message).getJSONObject("data").get("longitude").toString()); // 经度
|
||||||
messageObj.put("location", locationObj);
|
messageObj.set("location", locationObj);
|
||||||
return messageObj.toString();
|
return messageObj.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -161,19 +161,19 @@ public class AsyncMessageHandlerServiceImpl implements IAsyncMessageHandlerServi
|
|||||||
private String ueStructureJsonMessage(String message, String modelId) {
|
private String ueStructureJsonMessage(String message, String modelId) {
|
||||||
// 构造消息对象(包含关键信息)
|
// 构造消息对象(包含关键信息)
|
||||||
JSONObject messageObj = new JSONObject();
|
JSONObject messageObj = new JSONObject();
|
||||||
messageObj.put("type", "location"); // 消息类型
|
messageObj.set("type", "location"); // 消息类型
|
||||||
|
|
||||||
JSONObject data = new JSONObject();
|
JSONObject data = new JSONObject();
|
||||||
data.put("id", modelId);
|
data.set("id", modelId);
|
||||||
|
|
||||||
// 位置信息
|
// 位置信息
|
||||||
JSONObject position = new JSONObject();
|
JSONObject position = new JSONObject();
|
||||||
position.put("lat", JSONUtil.parseObj(message).getJSONObject("data").get("latitude")); // 纬度
|
position.set("lat", JSONUtil.parseObj(message).getJSONObject("data").get("latitude")); // 纬度
|
||||||
position.put("lng", JSONUtil.parseObj(message).getJSONObject("data").get("longitude")); // 经度
|
position.set("lng", JSONUtil.parseObj(message).getJSONObject("data").get("longitude")); // 经度
|
||||||
position.put("alt", JSONUtil.parseObj(message).getJSONObject("data").get("height")); // 海拔
|
position.set("alt", JSONUtil.parseObj(message).getJSONObject("data").get("height")); // 海拔
|
||||||
|
|
||||||
data.put("position", position);
|
data.set("position", position);
|
||||||
messageObj.put("data", data); // 设备唯一标识
|
messageObj.set("data", data); // 设备唯一标识
|
||||||
|
|
||||||
// 转换为String类型返回
|
// 转换为String类型返回
|
||||||
return messageObj.toString();
|
return messageObj.toString();
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.dromara.bigscreen.domain.BusWjzx;
|
import org.dromara.bigscreen.domain.BusWjzx;
|
||||||
import org.dromara.bigscreen.domain.dto.BusSygjBo;
|
import org.dromara.bigscreen.domain.dto.BusSygjBo;
|
||||||
|
import org.dromara.bigscreen.domain.vo.BusWjzxVo;
|
||||||
import org.dromara.common.core.domain.event.ProcessDeleteEvent;
|
import org.dromara.common.core.domain.event.ProcessDeleteEvent;
|
||||||
import org.dromara.common.core.domain.event.ProcessEvent;
|
import org.dromara.common.core.domain.event.ProcessEvent;
|
||||||
import org.dromara.common.core.domain.event.ProcessTaskEvent;
|
import org.dromara.common.core.domain.event.ProcessTaskEvent;
|
||||||
@ -15,6 +16,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||||||
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 lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.dromara.system.service.impl.SysOssServiceImpl;
|
||||||
import org.springframework.context.event.EventListener;
|
import org.springframework.context.event.EventListener;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.dromara.bigscreen.domain.vo.BusSygjVo;
|
import org.dromara.bigscreen.domain.vo.BusSygjVo;
|
||||||
@ -22,6 +24,7 @@ import org.dromara.bigscreen.domain.BusSygj;
|
|||||||
import org.dromara.bigscreen.mapper.BusSygjMapper;
|
import org.dromara.bigscreen.mapper.BusSygjMapper;
|
||||||
import org.dromara.bigscreen.service.IBusSygjService;
|
import org.dromara.bigscreen.service.IBusSygjService;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
@ -39,6 +42,8 @@ public class BusSygjServiceImpl extends ServiceImpl<BusSygjMapper, BusSygj> impl
|
|||||||
|
|
||||||
private final BusSygjMapper baseMapper;
|
private final BusSygjMapper baseMapper;
|
||||||
|
|
||||||
|
private final SysOssServiceImpl sysOssService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询实用工具
|
* 查询实用工具
|
||||||
*
|
*
|
||||||
@ -138,6 +143,13 @@ public class BusSygjServiceImpl extends ServiceImpl<BusSygjMapper, BusSygj> impl
|
|||||||
if(isValid){
|
if(isValid){
|
||||||
//TODO 做一些业务上的校验,判断是否需要校验
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ArrayList<Long> temp = new ArrayList<>();
|
||||||
|
for (Long id : ids) {
|
||||||
|
BusSygjVo busSygjVo = baseMapper.selectVoById(id);
|
||||||
|
temp.add(busSygjVo.getImgId());
|
||||||
|
}
|
||||||
|
sysOssService.deleteWithValidByIds(temp, false);
|
||||||
return baseMapper.deleteByIds(ids) > 0;
|
return baseMapper.deleteByIds(ids) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -3,6 +3,7 @@ package org.dromara.bigscreen.service.impl;
|
|||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.dromara.bigscreen.domain.dto.BusWjzxBo;
|
import org.dromara.bigscreen.domain.dto.BusWjzxBo;
|
||||||
|
import org.dromara.bigscreen.domain.vo.BusWjzxSjDateVo;
|
||||||
import org.dromara.common.core.domain.event.ProcessDeleteEvent;
|
import org.dromara.common.core.domain.event.ProcessDeleteEvent;
|
||||||
import org.dromara.common.core.domain.event.ProcessEvent;
|
import org.dromara.common.core.domain.event.ProcessEvent;
|
||||||
import org.dromara.common.core.domain.event.ProcessTaskEvent;
|
import org.dromara.common.core.domain.event.ProcessTaskEvent;
|
||||||
@ -14,6 +15,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||||||
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 lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.dromara.common.satoken.utils.LoginHelper;
|
||||||
import org.dromara.system.service.impl.SysOssServiceImpl;
|
import org.dromara.system.service.impl.SysOssServiceImpl;
|
||||||
import org.dromara.xzd.biddingManagement.biddingDocument.domain.XzdBiddingFileEstimate;
|
import org.dromara.xzd.biddingManagement.biddingDocument.domain.XzdBiddingFileEstimate;
|
||||||
import org.dromara.xzd.biddingManagement.biddingDocument.domain.vo.XzdBiddingFileEstimateVo;
|
import org.dromara.xzd.biddingManagement.biddingDocument.domain.vo.XzdBiddingFileEstimateVo;
|
||||||
@ -24,6 +26,7 @@ import org.dromara.bigscreen.domain.BusWjzx;
|
|||||||
import org.dromara.bigscreen.mapper.BusWjzxMapper;
|
import org.dromara.bigscreen.mapper.BusWjzxMapper;
|
||||||
import org.dromara.bigscreen.service.IBusWjzxService;
|
import org.dromara.bigscreen.service.IBusWjzxService;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@ -68,6 +71,17 @@ public class BusWjzxServiceImpl extends ServiceImpl<BusWjzxMapper, BusWjzx> impl
|
|||||||
return TableDataInfo.build(result);
|
return TableDataInfo.build(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BusWjzxSjDateVo queryWjzx() {
|
||||||
|
BusWjzxSjDateVo busWjzxSjDateVo = new BusWjzxSjDateVo();
|
||||||
|
Long zjsc = baseMapper.selectCount(new LambdaQueryWrapper<BusWjzx>().ge(BusWjzx::getCreateTime, LocalDate.now()));
|
||||||
|
Long zs = this.count();
|
||||||
|
busWjzxSjDateVo.setZs(zs);
|
||||||
|
busWjzxSjDateVo.setZjsc(zjsc);
|
||||||
|
|
||||||
|
return busWjzxSjDateVo;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询符合条件的文件中心列表
|
* 查询符合条件的文件中心列表
|
||||||
*
|
*
|
||||||
|
|||||||
@ -234,6 +234,91 @@ public class ProjectBigScreenServiceImpl implements ProjectBigScreenService {
|
|||||||
return vo;
|
return vo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取项目人员
|
||||||
|
*
|
||||||
|
* @return 项目人员
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public ProjectPeopleVo getProjectPeopleTianDong() {
|
||||||
|
final Long tdyq = 1897160897167638529L;
|
||||||
|
final Long tdeq = 1968506669544656898L;
|
||||||
|
List<Long> ids = List.of(tdeq, tdyq);
|
||||||
|
BusProject project = projectService.getById(tdyq);
|
||||||
|
// 获取大屏数据
|
||||||
|
ProjectPeopleVo vo = new ProjectPeopleVo();
|
||||||
|
// 获取施工人员总数
|
||||||
|
List<SubConstructionUser> list = constructionUserService.lambdaQuery()
|
||||||
|
.in(SubConstructionUser::getProjectId, ids)
|
||||||
|
.eq(SubConstructionUser::getUserRole, "0")
|
||||||
|
.isNotNull(SubConstructionUser::getTeamId).list();
|
||||||
|
List<Long> sysUserIdList = list.stream().map(SubConstructionUser::getSysUserId).toList();
|
||||||
|
int count = list.size();
|
||||||
|
BigDecimal countDec = BigDecimal.valueOf(count);
|
||||||
|
vo.setPeopleCount(countDec);
|
||||||
|
// 获取考勤数据
|
||||||
|
List<Long> attendancePeopleList1 = attendanceService.listAttendancePeopleByProjectId(tdyq);
|
||||||
|
List<Long> attendancePeopleList2 = attendanceService.listAttendancePeopleByProjectId(tdeq);
|
||||||
|
List<Long> attendancePeopleList = new ArrayList<>();
|
||||||
|
attendancePeopleList.addAll(attendancePeopleList1);
|
||||||
|
attendancePeopleList.addAll(attendancePeopleList2);
|
||||||
|
BigDecimal attendanceSize = BigDecimal.valueOf(attendancePeopleList.size());
|
||||||
|
vo.setAttendanceCount(attendanceSize);
|
||||||
|
// 计算考勤率
|
||||||
|
vo.setAttendanceRate(BigDecimalUtil.toPercentage(attendanceSize, countDec));
|
||||||
|
if (count != 0) {
|
||||||
|
// 统计班组人数
|
||||||
|
List<BusProjectTeamMember> memberList = projectTeamMemberService.lambdaQuery()
|
||||||
|
.select(BusProjectTeamMember::getId, BusProjectTeamMember::getTeamId)
|
||||||
|
.in(BusProjectTeamMember::getProjectId, ids)
|
||||||
|
.in(BusProjectTeamMember::getMemberId, sysUserIdList)
|
||||||
|
.list();
|
||||||
|
Map<Long, List<BusProjectTeamMember>> memberMap = memberList.stream()
|
||||||
|
.collect(Collectors.groupingBy(BusProjectTeamMember::getTeamId));
|
||||||
|
// 统计班组考勤数据
|
||||||
|
Map<Long, List<SubConstructionUser>> userTeamMap = new HashMap<>();
|
||||||
|
if (CollUtil.isNotEmpty(attendancePeopleList)) {
|
||||||
|
List<SubConstructionUser> users = constructionUserService.lambdaQuery()
|
||||||
|
.in(SubConstructionUser::getSysUserId, attendancePeopleList)
|
||||||
|
.isNotNull(SubConstructionUser::getTeamId)
|
||||||
|
.list();
|
||||||
|
userTeamMap = users.stream()
|
||||||
|
.collect(Collectors.groupingBy(SubConstructionUser::getTeamId));
|
||||||
|
}
|
||||||
|
List<BusProjectTeam> teamList = projectTeamService.lambdaQuery()
|
||||||
|
.in(BusProjectTeam::getProjectId, ids)
|
||||||
|
.list();
|
||||||
|
String punchRange = project.getPunchRange();
|
||||||
|
String punchTime = "";
|
||||||
|
if (punchRange != null) {
|
||||||
|
String start = punchRange.split(",")[0];
|
||||||
|
punchTime = LocalDate.now() + " ";
|
||||||
|
}
|
||||||
|
List<ProjectTeamAttendanceVo> listVo = new ArrayList<>();
|
||||||
|
for (BusProjectTeam projectTeam : teamList) {
|
||||||
|
ProjectTeamAttendanceVo teamAttendanceVo = new ProjectTeamAttendanceVo();
|
||||||
|
Long id = projectTeam.getId();
|
||||||
|
teamAttendanceVo.setId(id);
|
||||||
|
teamAttendanceVo.setTeamName(projectTeam.getTeamName());
|
||||||
|
teamAttendanceVo.setAttendanceTime(punchTime);
|
||||||
|
BigDecimal allNumber = BigDecimal.ZERO;
|
||||||
|
if (memberMap.containsKey(id)) {
|
||||||
|
allNumber = BigDecimal.valueOf(memberMap.get(id).size());
|
||||||
|
}
|
||||||
|
BigDecimal attendanceNumber = BigDecimal.ZERO;
|
||||||
|
if (CollUtil.isNotEmpty(userTeamMap) && userTeamMap.containsKey(id)) {
|
||||||
|
attendanceNumber = BigDecimal.valueOf(userTeamMap.get(id).size());
|
||||||
|
}
|
||||||
|
teamAttendanceVo.setAttendanceNumber(attendanceNumber);
|
||||||
|
teamAttendanceVo.setAllNumber(allNumber);
|
||||||
|
teamAttendanceVo.setAttendanceRate(BigDecimalUtil.toPercentage(attendanceNumber, allNumber));
|
||||||
|
listVo.add(teamAttendanceVo);
|
||||||
|
}
|
||||||
|
vo.setTeamAttendanceList(listVo);
|
||||||
|
}
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取项目形象进度
|
* 获取项目形象进度
|
||||||
*
|
*
|
||||||
@ -454,18 +539,38 @@ public class ProjectBigScreenServiceImpl implements ProjectBigScreenService {
|
|||||||
return List.of();
|
return List.of();
|
||||||
}
|
}
|
||||||
Long topId = progressCategory.getId();
|
Long topId = progressCategory.getId();
|
||||||
|
final List<String> gfcqName = List.of("场地平整", "桩基成孔", "桩基浇筑", "支架安装", "组件安装");
|
||||||
// 查出所有属于该顶级节点的子孙节点
|
// 查出所有属于该顶级节点的子孙节点
|
||||||
List<PgsProgressCategory> allChildren = progressCategoryService.list(
|
List<PgsProgressCategory> allChildren = progressCategoryService.list(
|
||||||
Wrappers.<PgsProgressCategory>lambdaQuery()
|
Wrappers.<PgsProgressCategory>lambdaQuery()
|
||||||
.and(wrapper -> {
|
.in(progressName.equals("光伏场区"), PgsProgressCategory::getName, gfcqName)
|
||||||
|
.and(wrapper ->
|
||||||
wrapper.like(PgsProgressCategory::getAncestors, "," + topId + ",")
|
wrapper.like(PgsProgressCategory::getAncestors, "," + topId + ",")
|
||||||
.or()
|
.or()
|
||||||
.like(PgsProgressCategory::getAncestors, "," + topId);
|
.like(PgsProgressCategory::getAncestors, "," + topId))
|
||||||
})
|
|
||||||
);
|
);
|
||||||
if (allChildren.isEmpty()) {
|
if (allChildren.isEmpty()) {
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
if (progressName.equals("集电线路")) {
|
||||||
|
Set<Long> parentIds = allChildren.stream()
|
||||||
|
.map(PgsProgressCategory::getParentId)
|
||||||
|
.collect(Collectors.toSet());
|
||||||
|
|
||||||
|
List<PgsProgressCategory> dierList = allChildren.stream()
|
||||||
|
.filter(item -> !parentIds.contains(item.getId()))
|
||||||
|
.toList();
|
||||||
|
return dierList.stream().map(c -> {
|
||||||
|
ProjectImageProgressDetailVo vo = new ProjectImageProgressDetailVo();
|
||||||
|
vo.setId(c.getId());
|
||||||
|
vo.setUnit(c.getUnit());
|
||||||
|
vo.setProgressName(c.getName());
|
||||||
|
vo.setPlanProgress(c.getPlanTotal());
|
||||||
|
vo.setActualProgress(c.getCompleted());
|
||||||
|
vo.setTotalProgress(c.getTotal());
|
||||||
|
return vo;
|
||||||
|
}).toList();
|
||||||
|
}
|
||||||
// 判断层级
|
// 判断层级
|
||||||
Set<Long> parentIds = allChildren.stream()
|
Set<Long> parentIds = allChildren.stream()
|
||||||
.map(PgsProgressCategory::getParentId)
|
.map(PgsProgressCategory::getParentId)
|
||||||
@ -477,6 +582,8 @@ public class ProjectBigScreenServiceImpl implements ProjectBigScreenService {
|
|||||||
if (CollUtil.isEmpty(dierList)) {
|
if (CollUtil.isEmpty(dierList)) {
|
||||||
return allChildren.stream().map(c -> {
|
return allChildren.stream().map(c -> {
|
||||||
ProjectImageProgressDetailVo vo = new ProjectImageProgressDetailVo();
|
ProjectImageProgressDetailVo vo = new ProjectImageProgressDetailVo();
|
||||||
|
vo.setId(c.getId());
|
||||||
|
vo.setUnit(c.getUnit());
|
||||||
vo.setProgressName(c.getName());
|
vo.setProgressName(c.getName());
|
||||||
vo.setPlanProgress(c.getPlanTotal());
|
vo.setPlanProgress(c.getPlanTotal());
|
||||||
vo.setActualProgress(c.getCompleted());
|
vo.setActualProgress(c.getCompleted());
|
||||||
@ -728,38 +835,38 @@ public class ProjectBigScreenServiceImpl implements ProjectBigScreenService {
|
|||||||
if (voList != null && !voList.isEmpty()) {
|
if (voList != null && !voList.isEmpty()) {
|
||||||
for (GpsEquipmentSonVo item : voList) {
|
for (GpsEquipmentSonVo item : voList) {
|
||||||
JSONObject messageObj = new JSONObject();
|
JSONObject messageObj = new JSONObject();
|
||||||
messageObj.put("type", "location"); // 消息类型
|
messageObj.set("type", "location"); // 消息类型
|
||||||
|
|
||||||
JSONObject data = new JSONObject();
|
JSONObject data = new JSONObject();
|
||||||
data.put("id", item.getModelId());
|
data.set("id", item.getModelId());
|
||||||
|
|
||||||
// 位置信息
|
// 位置信息
|
||||||
JSONObject position = new JSONObject();
|
JSONObject position = new JSONObject();
|
||||||
position.put("lat", item.getLocLatitude()); // 纬度
|
position.set("lat", item.getLocLatitude()); // 纬度
|
||||||
position.put("lng", item.getLocLongitude()); // 经度
|
position.set("lng", item.getLocLongitude()); // 经度
|
||||||
position.put("alt", item.getLocAltitude()); // 海拔
|
position.set("alt", item.getLocAltitude()); // 海拔
|
||||||
|
|
||||||
data.put("position", position);
|
data.set("position", position);
|
||||||
messageObj.put("data", data); // 设备唯一标识
|
messageObj.set("data", data); // 设备唯一标识
|
||||||
maps.add(messageObj.toString());
|
maps.add(messageObj.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (appList != null && !appList.isEmpty()) {
|
if (appList != null && !appList.isEmpty()) {
|
||||||
for (GpsEquipmentSonVo item : appList) {
|
for (GpsEquipmentSonVo item : appList) {
|
||||||
JSONObject messageObj = new JSONObject();
|
JSONObject messageObj = new JSONObject();
|
||||||
messageObj.put("type", "location"); // 消息类型
|
messageObj.set("type", "location"); // 消息类型
|
||||||
|
|
||||||
JSONObject data = new JSONObject();
|
JSONObject data = new JSONObject();
|
||||||
data.put("id", item.getModelId());
|
data.set("id", item.getModelId());
|
||||||
|
|
||||||
// 位置信息
|
// 位置信息
|
||||||
JSONObject position = new JSONObject();
|
JSONObject position = new JSONObject();
|
||||||
position.put("lat", item.getLocLatitude()); // 纬度
|
position.set("lat", item.getLocLatitude()); // 纬度
|
||||||
position.put("lng", item.getLocLongitude()); // 经度
|
position.set("lng", item.getLocLongitude()); // 经度
|
||||||
position.put("alt", item.getLocAltitude()); // 海拔
|
position.set("alt", item.getLocAltitude()); // 海拔
|
||||||
|
|
||||||
data.put("position", position);
|
data.set("position", position);
|
||||||
messageObj.put("data", data); // 设备唯一标识
|
messageObj.set("data", data); // 设备唯一标识
|
||||||
maps.add(messageObj.toString());
|
maps.add(messageObj.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -775,19 +882,19 @@ public class ProjectBigScreenServiceImpl implements ProjectBigScreenService {
|
|||||||
if (object != null) {
|
if (object != null) {
|
||||||
JSONObject object1 = JSONUtil.parseObj(object);
|
JSONObject object1 = JSONUtil.parseObj(object);
|
||||||
JSONObject messageObj = new JSONObject();
|
JSONObject messageObj = new JSONObject();
|
||||||
messageObj.put("type", "location"); // 消息类型
|
messageObj.set("type", "location"); // 消息类型
|
||||||
|
|
||||||
JSONObject data = new JSONObject();
|
JSONObject data = new JSONObject();
|
||||||
data.put("id", key.getAirplaneModleId());
|
data.set("id", key.getAirplaneModleId());
|
||||||
|
|
||||||
// 位置信息
|
// 位置信息
|
||||||
JSONObject position = new JSONObject();
|
JSONObject position = new JSONObject();
|
||||||
position.put("lat", object1.getJSONObject("data").get("latitude")); // 纬度
|
position.set("lat", object1.getJSONObject("data").get("latitude")); // 纬度
|
||||||
position.put("lng", object1.getJSONObject("data").get("longitude")); // 经度
|
position.set("lng", object1.getJSONObject("data").get("longitude")); // 经度
|
||||||
position.put("alt", object1.getJSONObject("data").get("height")); // 海拔
|
position.set("alt", object1.getJSONObject("data").get("height")); // 海拔
|
||||||
|
|
||||||
data.put("position", position);
|
data.set("position", position);
|
||||||
messageObj.put("data", data); // 设备唯一标识
|
messageObj.set("data", data); // 设备唯一标识
|
||||||
maps.add(messageObj.toString());
|
maps.add(messageObj.toString());
|
||||||
} else {
|
} else {
|
||||||
Object object2 = stringRedisTemplate.opsForValue().get("wrj:osd3:" + key);
|
Object object2 = stringRedisTemplate.opsForValue().get("wrj:osd3:" + key);
|
||||||
@ -795,19 +902,19 @@ public class ProjectBigScreenServiceImpl implements ProjectBigScreenService {
|
|||||||
JSONObject object3 = JSONUtil.parseObj(object2);
|
JSONObject object3 = JSONUtil.parseObj(object2);
|
||||||
|
|
||||||
JSONObject messageObj = new JSONObject();
|
JSONObject messageObj = new JSONObject();
|
||||||
messageObj.put("type", "location"); // 消息类型
|
messageObj.set("type", "location"); // 消息类型
|
||||||
|
|
||||||
JSONObject data = new JSONObject();
|
JSONObject data = new JSONObject();
|
||||||
data.put("id", key.getDroneModleId());
|
data.set("id", key.getDroneModleId());
|
||||||
|
|
||||||
// 位置信息
|
// 位置信息
|
||||||
JSONObject position = new JSONObject();
|
JSONObject position = new JSONObject();
|
||||||
position.put("lat", object3.getJSONObject("data").get("latitude")); // 纬度
|
position.set("lat", object3.getJSONObject("data").get("latitude")); // 纬度
|
||||||
position.put("lng", object3.getJSONObject("data").get("longitude")); // 经度
|
position.set("lng", object3.getJSONObject("data").get("longitude")); // 经度
|
||||||
position.put("alt", object3.getJSONObject("data").get("height")); // 海拔
|
position.set("alt", object3.getJSONObject("data").get("height")); // 海拔
|
||||||
|
|
||||||
data.put("position", position);
|
data.set("position", position);
|
||||||
messageObj.put("data", data); // 设备唯一标识
|
messageObj.set("data", data); // 设备唯一标识
|
||||||
maps.add(messageObj.toString());
|
maps.add(messageObj.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,6 +14,11 @@ import org.dromara.common.core.utils.MapstructUtils;
|
|||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
|
import org.dromara.common.satoken.utils.LoginHelper;
|
||||||
|
import org.dromara.project.domain.dto.project.BusProjectQueryReq;
|
||||||
|
import org.dromara.project.domain.vo.project.BusProjectVo;
|
||||||
|
import org.dromara.project.service.impl.BusProjectServiceImpl;
|
||||||
|
import org.dromara.system.domain.SysUserRole;
|
||||||
import org.dromara.system.domain.vo.SysRoleVo;
|
import org.dromara.system.domain.vo.SysRoleVo;
|
||||||
import org.dromara.system.service.impl.SysRoleServiceImpl;
|
import org.dromara.system.service.impl.SysRoleServiceImpl;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -37,6 +42,8 @@ public class SysRoleWorkServiceImpl extends ServiceImpl<SysRoleWorkMapper, SysRo
|
|||||||
private final SysRoleWorkMapper baseMapper;
|
private final SysRoleWorkMapper baseMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysRoleServiceImpl roleService;
|
private SysRoleServiceImpl roleService;
|
||||||
|
@Autowired
|
||||||
|
private BusProjectServiceImpl projectService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询角色流程对应
|
* 查询角色流程对应
|
||||||
@ -85,7 +92,7 @@ public class SysRoleWorkServiceImpl extends ServiceImpl<SysRoleWorkMapper, SysRo
|
|||||||
private LambdaQueryWrapper<SysRoleWork> buildQueryWrapper(SysRoleWorkBo bo) {
|
private LambdaQueryWrapper<SysRoleWork> buildQueryWrapper(SysRoleWorkBo bo) {
|
||||||
Map<String, Object> params = bo.getParams();
|
Map<String, Object> params = bo.getParams();
|
||||||
LambdaQueryWrapper<SysRoleWork> lqw = Wrappers.lambdaQuery();
|
LambdaQueryWrapper<SysRoleWork> lqw = Wrappers.lambdaQuery();
|
||||||
lqw.orderByDesc(SysRoleWork::getId);
|
lqw.orderByDesc(SysRoleWork::getCreateTime);
|
||||||
lqw.eq(bo.getRoleId() != null, SysRoleWork::getRoleId, bo.getRoleId());
|
lqw.eq(bo.getRoleId() != null, SysRoleWork::getRoleId, bo.getRoleId());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getLcmc()), SysRoleWork::getLcmc, bo.getLcmc());
|
lqw.eq(StringUtils.isNotBlank(bo.getLcmc()), SysRoleWork::getLcmc, bo.getLcmc());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getLcms()), SysRoleWork::getLcms, bo.getLcms());
|
lqw.eq(StringUtils.isNotBlank(bo.getLcms()), SysRoleWork::getLcms, bo.getLcms());
|
||||||
@ -101,9 +108,11 @@ public class SysRoleWorkServiceImpl extends ServiceImpl<SysRoleWorkMapper, SysRo
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Boolean insertByBo(SysRoleWorkBo bo) {
|
public Boolean insertByBo(SysRoleWorkBo bo) {
|
||||||
LambdaQueryWrapper<SysRoleWork> lqw = buildQueryWrapper(bo);
|
LambdaQueryWrapper<SysRoleWork> lqw = new LambdaQueryWrapper<>();
|
||||||
lqw.eq(SysRoleWork::getRoleId, bo.getRoleId());
|
lqw.eq(SysRoleWork::getRoleId, bo.getRoleId());
|
||||||
if (baseMapper.selectCount(lqw) > 0) {
|
lqw.eq(SysRoleWork::getProjectId, bo.getProjectId());
|
||||||
|
List<SysRoleWork> workVos = list(lqw);
|
||||||
|
if (!workVos.isEmpty()) {
|
||||||
throw new RuntimeException("此角色已绑定流程");
|
throw new RuntimeException("此角色已绑定流程");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -162,4 +171,150 @@ public class SysRoleWorkServiceImpl extends ServiceImpl<SysRoleWorkMapper, SysRo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<SysRoleVo> getRoleList(Long projectId){
|
||||||
|
Long userId = LoginHelper.getUserId();
|
||||||
|
List<SysUserRole> list = baseMapper.getRoleList(userId,projectId);
|
||||||
|
List<SysRoleVo> roleList = new ArrayList<>();
|
||||||
|
for (SysUserRole sysUserRole : list) {
|
||||||
|
|
||||||
|
LambdaQueryWrapper<SysRoleWork> lqw = new LambdaQueryWrapper<>();
|
||||||
|
lqw.eq(SysRoleWork::getRoleId, sysUserRole.getRoleId());
|
||||||
|
lqw.eq(SysRoleWork::getProjectId,projectId);
|
||||||
|
SysRoleWork one = getOne(lqw);
|
||||||
|
|
||||||
|
if (one != null){
|
||||||
|
SysRoleVo sysRoleVo = roleService.selectRoleById(sysUserRole.getRoleId());
|
||||||
|
if (sysRoleVo != null){
|
||||||
|
roleList.add(sysRoleVo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return roleList;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断此角色在所有项目下所有角色是否有流程
|
||||||
|
*/
|
||||||
|
public Boolean isHaveValue(Long userId){
|
||||||
|
List<SysUserRole> allRoleList = baseMapper.getAllRoleList(userId);
|
||||||
|
for (SysUserRole sysUserRole : allRoleList) {
|
||||||
|
LambdaQueryWrapper<SysRoleWork> lqw = new LambdaQueryWrapper<>();
|
||||||
|
lqw.eq(SysRoleWork::getRoleId, sysUserRole.getRoleId());
|
||||||
|
lqw.eq(SysRoleWork::getProjectId,sysUserRole.getProjectId());
|
||||||
|
List<SysRoleWork> list = list(lqw);
|
||||||
|
if (list != null && !list.isEmpty()){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据当前登录人获取角色流程对应
|
||||||
|
*/
|
||||||
|
public SysRoleWork getRoleWork(Long projectId){
|
||||||
|
Long userId = LoginHelper.getUserId();
|
||||||
|
|
||||||
|
List<SysUserRole> roleList = baseMapper.getRoleList(userId,projectId);
|
||||||
|
|
||||||
|
if (roleList == null || roleList.isEmpty()){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (SysUserRole userRole : roleList) {
|
||||||
|
LambdaQueryWrapper<SysRoleWork> lqw = new LambdaQueryWrapper<>();
|
||||||
|
lqw.eq(SysRoleWork::getRoleId, userRole.getRoleId());
|
||||||
|
lqw.eq(SysRoleWork::getProjectId,projectId);
|
||||||
|
SysRoleWork one = getOne(lqw);
|
||||||
|
if (one != null){
|
||||||
|
return one;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前登录人在所有项目下有流程的角色列表
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<BusProjectVo> getProjectRoles(){
|
||||||
|
Long userId = LoginHelper.getUserId();
|
||||||
|
// 获取当前登录用户的所有项目及对应所有角色
|
||||||
|
List<SysUserRole> allRoleList = baseMapper.getAllRoleList(userId);
|
||||||
|
|
||||||
|
//初始化
|
||||||
|
// LambdaQueryWrapper<SysRoleWork> lqw = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
|
List<BusProjectVo> busProjectVoList = new ArrayList<>();
|
||||||
|
|
||||||
|
//获取到该用户所有有流程的项目 说明在该项目下该用户有角色有所属流程
|
||||||
|
for (SysUserRole sysUserRole : allRoleList) {
|
||||||
|
// lqw.clear();
|
||||||
|
// lqw.eq(SysRoleWork::getProjectId,sysUserRole.getProjectId());
|
||||||
|
// lqw.eq(SysRoleWork::getRoleId, sysUserRole.getRoleId());
|
||||||
|
// SysRoleWork one = getOne(lqw);
|
||||||
|
// if (one != null){
|
||||||
|
// //先拿到该项目
|
||||||
|
// BusProjectQueryReq req = new BusProjectQueryReq();
|
||||||
|
// req.setId(sysUserRole.getProjectId());
|
||||||
|
// List<BusProjectVo> vos = projectService.queryList(req);
|
||||||
|
// if (vos != null && !vos.isEmpty()){
|
||||||
|
// if(!busProjectVoList.contains(vos.getFirst())){
|
||||||
|
// busProjectVoList.add(vos.getFirst());
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
BusProjectQueryReq req = new BusProjectQueryReq();
|
||||||
|
req.setId(sysUserRole.getProjectId());
|
||||||
|
List<BusProjectVo> vos = projectService.queryList(req);
|
||||||
|
if (vos != null && !vos.isEmpty()){
|
||||||
|
if(!busProjectVoList.contains(vos.getFirst())){
|
||||||
|
busProjectVoList.add(vos.getFirst());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//遍历
|
||||||
|
List<SysRoleVo> roleVos;
|
||||||
|
for (BusProjectVo projectVo : busProjectVoList) {
|
||||||
|
roleVos = new ArrayList<>();
|
||||||
|
//通过项目查找所有角色
|
||||||
|
LambdaQueryWrapper<SysRoleWork> lqw1 = new LambdaQueryWrapper<>();
|
||||||
|
lqw1.eq(SysRoleWork::getProjectId,projectVo.getId());
|
||||||
|
//获取角色
|
||||||
|
List<SysRoleWork> roleWorkList = list(lqw1);
|
||||||
|
for (SysRoleWork sysRoleWork : roleWorkList) {
|
||||||
|
SysRoleVo sysRoleVo = roleService.selectRoleById(sysRoleWork.getRoleId());
|
||||||
|
if (sysRoleVo != null){
|
||||||
|
roleVos.add(sysRoleVo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
projectVo.setRoleVos(roleVos);
|
||||||
|
}
|
||||||
|
|
||||||
|
return busProjectVoList;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户和项目判断是否有角色流程
|
||||||
|
*/
|
||||||
|
public Boolean isHaveValueByProject(Long projectId){
|
||||||
|
Long userId = LoginHelper.getUserId();
|
||||||
|
List<SysUserRole> roleList = baseMapper.getRoleList(userId, projectId);
|
||||||
|
if (roleList != null && !roleList.isEmpty()){
|
||||||
|
for (SysUserRole userRole : roleList) {
|
||||||
|
LambdaQueryWrapper<SysRoleWork> lqw = new LambdaQueryWrapper<>();
|
||||||
|
lqw.eq(SysRoleWork::getRoleId, userRole.getRoleId());
|
||||||
|
lqw.eq(SysRoleWork::getProjectId,projectId);
|
||||||
|
List<SysRoleWork> list = list(lqw);
|
||||||
|
if (list != null && !list.isEmpty()){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,6 +13,7 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import jakarta.validation.constraints.*;
|
import jakarta.validation.constraints.*;
|
||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import org.dromara.cailiaoshebei.domain.bo.BusMrpBaseReq;
|
||||||
import org.dromara.cailiaoshebei.domain.bo.RemainingReq;
|
import org.dromara.cailiaoshebei.domain.bo.RemainingReq;
|
||||||
import org.dromara.cailiaoshebei.domain.dto.BusMrpDto;
|
import org.dromara.cailiaoshebei.domain.dto.BusMrpDto;
|
||||||
import org.dromara.cailiaoshebei.domain.dto.BusMrpExportDto;
|
import org.dromara.cailiaoshebei.domain.dto.BusMrpExportDto;
|
||||||
@ -75,6 +76,15 @@ public class BusMrpBaseController extends BaseController {
|
|||||||
return busMrpBaseService.queryPageList(bo, pageQuery);
|
return busMrpBaseService.queryPageList(bo, pageQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询物资-批次需求计划基础信息列表
|
||||||
|
*/
|
||||||
|
// @SaCheckPermission("cailiaoshebei:mrpBase:getListByName")
|
||||||
|
@GetMapping("/getListByName")
|
||||||
|
public R<List<BusMrpBaseVo>> getListByName(BusMrpBaseReq req) {
|
||||||
|
return R.ok(busMrpBaseService.getListByName(req));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出物资-批次需求计划基础信息列表
|
* 导出物资-批次需求计划基础信息列表
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -0,0 +1,37 @@
|
|||||||
|
package org.dromara.cailiaoshebei.domain.bo;
|
||||||
|
|
||||||
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.dromara.cailiaoshebei.domain.BusMrpBase;
|
||||||
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物资-批次需求计划基础信息业务对象 bus_mrp_base
|
||||||
|
*
|
||||||
|
* @author Lion Li
|
||||||
|
* @date 2025-08-13
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class BusMrpBaseReq implements Serializable {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目ID
|
||||||
|
*/
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划编号
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
}
|
||||||
@ -146,6 +146,11 @@ public class BusMaterialbatchdemandplanVo implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private BigDecimal tenderQuantity;
|
private BigDecimal tenderQuantity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 已使用数量
|
||||||
|
*/
|
||||||
|
private BigDecimal useQuantity;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -57,4 +57,8 @@ public class BusPlanDocAssociationVo implements Serializable {
|
|||||||
* 需求数量
|
* 需求数量
|
||||||
*/
|
*/
|
||||||
private BigDecimal demandQuantity;
|
private BigDecimal demandQuantity;
|
||||||
|
|
||||||
|
|
||||||
|
private String remark;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package org.dromara.cailiaoshebei.service;
|
package org.dromara.cailiaoshebei.service;
|
||||||
|
|
||||||
|
import org.dromara.cailiaoshebei.domain.bo.BusMrpBaseReq;
|
||||||
import org.dromara.cailiaoshebei.domain.dto.BusMrpDto;
|
import org.dromara.cailiaoshebei.domain.dto.BusMrpDto;
|
||||||
import org.dromara.cailiaoshebei.domain.dto.BusMrpExportDto;
|
import org.dromara.cailiaoshebei.domain.dto.BusMrpExportDto;
|
||||||
import org.dromara.cailiaoshebei.domain.vo.BusMrpBaseVo;
|
import org.dromara.cailiaoshebei.domain.vo.BusMrpBaseVo;
|
||||||
@ -87,4 +88,6 @@ public interface IBusMrpBaseService extends IService<BusMrpBase>{
|
|||||||
* 获取物资已有数量
|
* 获取物资已有数量
|
||||||
*/
|
*/
|
||||||
Map<String, Object> remaining(Long projectId,Long limitListId,Long mrpBaseId);
|
Map<String, Object> remaining(Long projectId,Long limitListId,Long mrpBaseId);
|
||||||
|
|
||||||
|
List<BusMrpBaseVo> getListByName(BusMrpBaseReq req);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,9 +7,11 @@ import jakarta.annotation.Resource;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.dromara.cailiaoshebei.controller.constant;
|
import org.dromara.cailiaoshebei.controller.constant;
|
||||||
import org.dromara.cailiaoshebei.domain.BusCailiaoshebeiPici;
|
import org.dromara.cailiaoshebei.domain.BusCailiaoshebeiPici;
|
||||||
|
import org.dromara.cailiaoshebei.domain.BusPlanDocAssociation;
|
||||||
import org.dromara.cailiaoshebei.domain.bo.BusMaterialbatchdemandplanAddReq;
|
import org.dromara.cailiaoshebei.domain.bo.BusMaterialbatchdemandplanAddReq;
|
||||||
import org.dromara.cailiaoshebei.service.IBusCailiaoshebeiPiciService;
|
import org.dromara.cailiaoshebei.service.IBusCailiaoshebeiPiciService;
|
||||||
import org.dromara.cailiaoshebei.service.IBusMaterialsorderService;
|
import org.dromara.cailiaoshebei.service.IBusMaterialsorderService;
|
||||||
|
import org.dromara.cailiaoshebei.service.IBusPlanDocAssociationService;
|
||||||
import org.dromara.common.core.domain.event.ProcessDeleteEvent;
|
import org.dromara.common.core.domain.event.ProcessDeleteEvent;
|
||||||
import org.dromara.common.core.domain.event.ProcessEvent;
|
import org.dromara.common.core.domain.event.ProcessEvent;
|
||||||
import org.dromara.common.core.domain.event.ProcessTaskEvent;
|
import org.dromara.common.core.domain.event.ProcessTaskEvent;
|
||||||
@ -79,6 +81,9 @@ public class BusMaterialbatchdemandplanServiceImpl extends ServiceImpl<BusMateri
|
|||||||
@Lazy
|
@Lazy
|
||||||
@Autowired
|
@Autowired
|
||||||
private IBusBillofquantitiesLimitListService busBillofquantitiesLimitListService;
|
private IBusBillofquantitiesLimitListService busBillofquantitiesLimitListService;
|
||||||
|
@Lazy
|
||||||
|
@Autowired
|
||||||
|
private IBusPlanDocAssociationService busPlanDocAssociationService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询物资-批次需求计划
|
* 查询物资-批次需求计划
|
||||||
@ -119,18 +124,30 @@ public class BusMaterialbatchdemandplanServiceImpl extends ServiceImpl<BusMateri
|
|||||||
result.getRecords().stream().filter(vo -> {
|
result.getRecords().stream().filter(vo -> {
|
||||||
return hashSet.contains(vo.getSuppliespriceId()); // 仅保留 Set 中存在的数据
|
return hashSet.contains(vo.getSuppliespriceId()); // 仅保留 Set 中存在的数据
|
||||||
}).forEach(item->{
|
}).forEach(item->{
|
||||||
if (map.containsKey(item.getId())) {
|
|
||||||
item.setTenderQuantity(map.get(item.getId()));
|
if (map.containsKey(item.getSuppliespriceId())) {
|
||||||
|
item.setTenderQuantity(map.get(item.getSuppliespriceId()));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
result.getRecords().forEach(vo -> {
|
for (BusMaterialbatchdemandplanVo vo : result.getRecords()) {
|
||||||
|
List<BusPlanDocAssociation> busPlanDocAssociations = busPlanDocAssociationService.getBaseMapper().selectList(new LambdaQueryWrapper<BusPlanDocAssociation>().eq(BusPlanDocAssociation::getPlanId, vo.getId()));
|
||||||
|
BigDecimal useQuantity = BigDecimal.ZERO;
|
||||||
|
if (busPlanDocAssociations != null && !busPlanDocAssociations.isEmpty()) {
|
||||||
|
useQuantity = busPlanDocAssociations.stream()
|
||||||
|
// 提取每个item的demandQuantity,若为null则用0替代
|
||||||
|
.map(item -> Optional.ofNullable(item.getDemandQuantity()).orElse(BigDecimal.ZERO))
|
||||||
|
// 累加:初始值0,累加器为两个BigDecimal相加
|
||||||
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
BigDecimal subtract = vo.getDemandQuantity().subtract(useQuantity);
|
||||||
|
vo.setUseQuantity(subtract.compareTo(BigDecimal.ZERO) >0 ? subtract: BigDecimal.ZERO);
|
||||||
|
}
|
||||||
if (vo.getSuppliespricePid() != null) {
|
if (vo.getSuppliespricePid() != null) {
|
||||||
BusBillofquantitiesLimitList billofquantities = busBillofquantitiesLimitListService.getById(vo.getSuppliespricePid());
|
BusBillofquantitiesLimitList billofquantities = busBillofquantitiesLimitListService.getById(vo.getSuppliespricePid());
|
||||||
vo.setSuppliespricePname(billofquantities.getName());
|
vo.setSuppliespricePname(billofquantities.getName());
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
return TableDataInfo.build(result);
|
return TableDataInfo.build(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -6,13 +6,16 @@ import cn.hutool.core.convert.Convert;
|
|||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.dromara.cailiaoshebei.domain.BusMaterialbatchdemandplan;
|
import org.dromara.cailiaoshebei.domain.BusMaterialbatchdemandplan;
|
||||||
|
import org.dromara.cailiaoshebei.domain.BusPlanDocAssociation;
|
||||||
import org.dromara.cailiaoshebei.domain.bo.BusMaterialbatchdemandplanBo;
|
import org.dromara.cailiaoshebei.domain.bo.BusMaterialbatchdemandplanBo;
|
||||||
|
import org.dromara.cailiaoshebei.domain.bo.BusMrpBaseReq;
|
||||||
import org.dromara.cailiaoshebei.domain.dto.BusMaterialbatchdemandplanExportDto;
|
import org.dromara.cailiaoshebei.domain.dto.BusMaterialbatchdemandplanExportDto;
|
||||||
import org.dromara.cailiaoshebei.domain.dto.BusMrpDto;
|
import org.dromara.cailiaoshebei.domain.dto.BusMrpDto;
|
||||||
import org.dromara.cailiaoshebei.domain.dto.BusMrpExportDto;
|
import org.dromara.cailiaoshebei.domain.dto.BusMrpExportDto;
|
||||||
import org.dromara.cailiaoshebei.domain.vo.BusMaterialbatchdemandplanVo;
|
import org.dromara.cailiaoshebei.domain.vo.BusMaterialbatchdemandplanVo;
|
||||||
import org.dromara.cailiaoshebei.domain.vo.BusMrpVo;
|
import org.dromara.cailiaoshebei.domain.vo.BusMrpVo;
|
||||||
import org.dromara.cailiaoshebei.service.IBusMaterialbatchdemandplanService;
|
import org.dromara.cailiaoshebei.service.IBusMaterialbatchdemandplanService;
|
||||||
|
import org.dromara.cailiaoshebei.service.IBusPlanDocAssociationService;
|
||||||
import org.dromara.common.core.domain.event.ProcessDeleteEvent;
|
import org.dromara.common.core.domain.event.ProcessDeleteEvent;
|
||||||
import org.dromara.common.core.domain.event.ProcessEvent;
|
import org.dromara.common.core.domain.event.ProcessEvent;
|
||||||
import org.dromara.common.core.domain.event.ProcessTaskEvent;
|
import org.dromara.common.core.domain.event.ProcessTaskEvent;
|
||||||
@ -61,6 +64,8 @@ public class BusMrpBaseServiceImpl extends ServiceImpl<BusMrpBaseMapper, BusMrpB
|
|||||||
|
|
||||||
private final IBusMaterialbatchdemandplanService planservice;
|
private final IBusMaterialbatchdemandplanService planservice;
|
||||||
|
|
||||||
|
private final IBusPlanDocAssociationService planDocAssociationService;
|
||||||
|
|
||||||
private final IBusBillofquantitiesLimitListService busBillofquantitiesService;
|
private final IBusBillofquantitiesLimitListService busBillofquantitiesService;
|
||||||
|
|
||||||
private final IBusTenderPlanningLimitListService tenderPlanningLimitListService;
|
private final IBusTenderPlanningLimitListService tenderPlanningLimitListService;
|
||||||
@ -328,6 +333,38 @@ public class BusMrpBaseServiceImpl extends ServiceImpl<BusMrpBaseMapper, BusMrpB
|
|||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<BusMrpBaseVo> getListByName(BusMrpBaseReq req) {
|
||||||
|
if (req.getName() == null || req.getName().isEmpty()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
List<BusMaterialbatchdemandplan> busMaterialbatchdemandplans = planservice.getBaseMapper().selectList(new LambdaQueryWrapper<BusMaterialbatchdemandplan>()
|
||||||
|
.eq(BusMaterialbatchdemandplan::getProjectId, req.getProjectId())
|
||||||
|
.like(BusMaterialbatchdemandplan::getName, req.getName()));
|
||||||
|
Iterator<BusMaterialbatchdemandplan> iterator = busMaterialbatchdemandplans.iterator();
|
||||||
|
Set<Long> mrpIds = new HashSet<>();
|
||||||
|
while (iterator.hasNext()){
|
||||||
|
BusMaterialbatchdemandplan next = iterator.next();
|
||||||
|
List<BusPlanDocAssociation> busPlanDocAssociations = planDocAssociationService.getBaseMapper().selectList(new LambdaQueryWrapper<BusPlanDocAssociation>()
|
||||||
|
.eq(BusPlanDocAssociation::getProjectId, req.getProjectId())
|
||||||
|
.eq(BusPlanDocAssociation::getPlanId, next.getId()));
|
||||||
|
BigDecimal demandQuantity = BigDecimal.ZERO;
|
||||||
|
busPlanDocAssociations.forEach(busPlanDocAssociation -> {
|
||||||
|
demandQuantity.add(busPlanDocAssociation.getDemandQuantity());
|
||||||
|
});
|
||||||
|
if (demandQuantity.compareTo(next.getDemandQuantity()) >= 0) {
|
||||||
|
iterator.remove();
|
||||||
|
}else {
|
||||||
|
mrpIds.add(next.getMrpBaseId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (mrpIds.isEmpty()){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return baseMapper.selectVoList(new LambdaQueryWrapper<BusMrpBase>()
|
||||||
|
.eq(BusMrpBase::getStatus,BusinessStatusEnum.FINISH.getStatus()).in(BusMrpBase::getId,mrpIds));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 总体流程监听(例如: 草稿,撤销,退回,作废,终止,已完成,单任务完成等)
|
* 总体流程监听(例如: 草稿,撤销,退回,作废,终止,已完成,单任务完成等)
|
||||||
* 正常使用只需#processEvent.flowCode=='leave1'
|
* 正常使用只需#processEvent.flowCode=='leave1'
|
||||||
|
|||||||
@ -0,0 +1,14 @@
|
|||||||
|
package org.dromara.common.constant;
|
||||||
|
|
||||||
|
public class RoleIdConstant {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分包管理审核
|
||||||
|
*/
|
||||||
|
public static final Long FB_SH = 6L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 管理审核
|
||||||
|
*/
|
||||||
|
public static final Long SYS_SH = 7L;
|
||||||
|
}
|
||||||
@ -18,6 +18,11 @@ public class IdCoordinatePoint {
|
|||||||
*/
|
*/
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 点位置 107.13162414986301,23.817601041770256
|
* 点位置 107.13162414986301,23.817601041770256
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -0,0 +1,28 @@
|
|||||||
|
package org.dromara.common.domain;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.InputStream;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lilemy
|
||||||
|
* @date 2025-11-18 14:38
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WebpConverterStreamVo {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 图片输入流
|
||||||
|
*/
|
||||||
|
private InputStream inputStream;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 图片长度
|
||||||
|
*/
|
||||||
|
private long length;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 图片类型
|
||||||
|
*/
|
||||||
|
private String contentType;
|
||||||
|
}
|
||||||
@ -17,6 +17,7 @@ import org.dromara.manager.recognizermanager.vo.RecognizeConvertCoordinateResult
|
|||||||
import org.locationtech.jts.geom.*;
|
import org.locationtech.jts.geom.*;
|
||||||
import org.locationtech.jts.index.strtree.STRtree;
|
import org.locationtech.jts.index.strtree.STRtree;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -369,4 +370,15 @@ public class JSTUtil {
|
|||||||
return address;
|
return address;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
String s = "[{\"lng\":108.27080423,\"lat\":30.78111723,\"alt\":0},{\"lng\":108.1121822,\"lat\":28.29520706,\"alt\":0},{\"lng\":104.14552241,\"lat\":25.30970518,\"alt\":0},{\"lng\":109.08566373,\"lat\":22.16157883,\"alt\":0},{\"lng\":113.65236101,\"lat\":23.77537016,\"alt\":0},{\"lng\":114.7759412,\"lat\":27.54339559,\"alt\":0},{\"lng\":112.75195929,\"lat\":30.44798186,\"alt\":0},{\"lng\":109.80548867,\"lat\":31.34953868,\"alt\":0}]";
|
||||||
|
|
||||||
|
List<String> list = new ArrayList<>();
|
||||||
|
list.add(s);
|
||||||
|
List<GeoPoint> matchingRange = findMatchingRange("30.247348", "105.729797", list);
|
||||||
|
System.out.println(matchingRange==null);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
package org.dromara.common.utils;
|
package org.dromara.common.utils;
|
||||||
|
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.dromara.common.domain.IdCoordinatePoint;
|
import org.dromara.common.domain.IdCoordinatePoint;
|
||||||
import org.locationtech.jts.geom.Coordinate;
|
import org.locationtech.jts.geom.Coordinate;
|
||||||
import org.locationtech.jts.geom.GeometryFactory;
|
import org.locationtech.jts.geom.GeometryFactory;
|
||||||
@ -8,8 +10,11 @@ import org.locationtech.jts.geom.Polygon;
|
|||||||
import org.locationtech.jts.util.GeometricShapeFactory;
|
import org.locationtech.jts.util.GeometricShapeFactory;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
public class JtsPointMatcher {
|
public class JtsPointMatcher {
|
||||||
|
|
||||||
private static final GeometryFactory geometryFactory = new GeometryFactory();
|
private static final GeometryFactory geometryFactory = new GeometryFactory();
|
||||||
@ -43,19 +48,30 @@ public class JtsPointMatcher {
|
|||||||
* @param radiusMeter 半径(米)
|
* @param radiusMeter 半径(米)
|
||||||
* @return 匹配到的 pointsB 的 id
|
* @return 匹配到的 pointsB 的 id
|
||||||
*/
|
*/
|
||||||
public static List<Long> matchPoints(List<Coordinate> pointsA, List<IdCoordinatePoint> pointsB, double radiusMeter) {
|
public static Set<Long> matchPoints(List<Coordinate> pointsA, List<IdCoordinatePoint> pointsB, double radiusMeter) {
|
||||||
List<Long> matched = new ArrayList<>();
|
Set<Long> matched = new HashSet<>();
|
||||||
for (Coordinate pA : pointsA) {
|
for (Coordinate pA : pointsA) {
|
||||||
Point pointA = geometryFactory.createPoint(pA);
|
Point pointA = geometryFactory.createPoint(pA);
|
||||||
for (IdCoordinatePoint pvPoint : pointsB) {
|
for (IdCoordinatePoint pvPoint : pointsB) {
|
||||||
// positions 字段 -> Coordinate
|
String positions = pvPoint.getPositions();
|
||||||
String[] posArr = pvPoint.getPositions().split(",");
|
double lon;
|
||||||
double lon = Double.parseDouble(posArr[0]);
|
double lat;
|
||||||
double lat = Double.parseDouble(posArr[1]);
|
if (positions.startsWith("[") && positions.endsWith("]")) {
|
||||||
|
// 是数组形式,例如 [1231515.141,3123123.3123]
|
||||||
|
List<Double> doubles = JSONUtil.toList(positions, Double.class);
|
||||||
|
lon = doubles.get(0);
|
||||||
|
lat = doubles.get(1);
|
||||||
|
} else {
|
||||||
|
// 是单个坐标,例如 1231515.141,3123123.3123
|
||||||
|
String[] posArr = positions.split(",");
|
||||||
|
lon = Double.parseDouble(posArr[0]);
|
||||||
|
lat = Double.parseDouble(posArr[1]);
|
||||||
|
}
|
||||||
Polygon circle = createCircle(lon, lat, radiusMeter);
|
Polygon circle = createCircle(lon, lat, radiusMeter);
|
||||||
|
|
||||||
if (circle.contains(pointA)) {
|
if (circle.contains(pointA)) {
|
||||||
matched.add(pvPoint.getId());
|
matched.add(pvPoint.getId());
|
||||||
|
log.info("匹配到桩点:{}", pvPoint.getName());
|
||||||
break; // 找到一个就够
|
break; // 找到一个就够
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -83,7 +99,7 @@ public class JtsPointMatcher {
|
|||||||
p2.setPositions("107.08827916132982,23.877744707721714"); // 很远
|
p2.setPositions("107.08827916132982,23.877744707721714"); // 很远
|
||||||
listB.add(p2);
|
listB.add(p2);
|
||||||
|
|
||||||
List<Long> result = matchPoints(listA, listB, 4.4);
|
Set<Long> result = matchPoints(listA, listB, 4.4);
|
||||||
|
|
||||||
System.out.println("匹配到的桩点ID:");
|
System.out.println("匹配到的桩点ID:");
|
||||||
for (Long id : result) {
|
for (Long id : result) {
|
||||||
|
|||||||
@ -0,0 +1,187 @@
|
|||||||
|
package org.dromara.common.utils;
|
||||||
|
|
||||||
|
import org.dromara.common.domain.WebpConverterStreamVo;
|
||||||
|
|
||||||
|
import javax.imageio.IIOImage;
|
||||||
|
import javax.imageio.ImageIO;
|
||||||
|
import javax.imageio.ImageWriteParam;
|
||||||
|
import javax.imageio.ImageWriter;
|
||||||
|
import javax.imageio.stream.FileImageOutputStream;
|
||||||
|
import javax.imageio.stream.MemoryCacheImageOutputStream;
|
||||||
|
import java.awt.*;
|
||||||
|
import java.awt.image.BufferedImage;
|
||||||
|
import java.io.ByteArrayInputStream;
|
||||||
|
import java.io.ByteArrayOutputStream;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.URI;
|
||||||
|
import java.net.URISyntaxException;
|
||||||
|
import java.util.Iterator;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lilemy
|
||||||
|
* @date 2025-11-18 14:09
|
||||||
|
*/
|
||||||
|
public class WebpConverterUtil {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将 PNG 图片转换为 WebP
|
||||||
|
*
|
||||||
|
* @param inputFile 输入文件
|
||||||
|
* @param outputFile 输出文件
|
||||||
|
* @param quality 压缩质量(0.0 ~ 1.0)
|
||||||
|
*/
|
||||||
|
public static void convertPngToWebp(File inputFile, File outputFile, float quality) throws IOException {
|
||||||
|
// 读取 PNG 图片
|
||||||
|
BufferedImage image = ImageIO.read(inputFile);
|
||||||
|
// 获取 WebP writer
|
||||||
|
Iterator<ImageWriter> writers = ImageIO.getImageWritersByFormatName("webp");
|
||||||
|
if (!writers.hasNext()) {
|
||||||
|
throw new IllegalStateException("未找到 WebP ImageWriter,检查依赖是否正确!");
|
||||||
|
}
|
||||||
|
ImageWriter writer = writers.next();
|
||||||
|
// 设置压缩质量
|
||||||
|
ImageWriteParam param = writer.getDefaultWriteParam();
|
||||||
|
param.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);
|
||||||
|
String[] types = param.getCompressionTypes();
|
||||||
|
if (types != null && types.length > 0) {
|
||||||
|
param.setCompressionType(types[0]); // 默认一般是 "Lossy"
|
||||||
|
}
|
||||||
|
param.setCompressionQuality(quality); // 0.0 ~ 1.0(越小越压缩)
|
||||||
|
try (FileImageOutputStream output = new FileImageOutputStream(outputFile)) {
|
||||||
|
writer.setOutput(output);
|
||||||
|
writer.write(null, new IIOImage(image, null, null), param);
|
||||||
|
} finally {
|
||||||
|
writer.dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 从 URL 读取图片并转换为 WebP
|
||||||
|
*
|
||||||
|
* @param imageUrl 图片对象存储 URL
|
||||||
|
* @param outputFile 输出文件
|
||||||
|
* @param quality WebP 压缩质量 (0.0 ~ 1.0)
|
||||||
|
*/
|
||||||
|
public static void convertPngUrlToWebp(String imageUrl, File outputFile, float quality) throws IOException, URISyntaxException {
|
||||||
|
// 1. 根据 URL 读取图片
|
||||||
|
BufferedImage image = ImageIO.read(new URI(imageUrl).toURL());
|
||||||
|
if (image == null) {
|
||||||
|
throw new IOException("无法从 URL 加载图片,URL = " + imageUrl);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. 获取 WebP writer
|
||||||
|
Iterator<ImageWriter> writers = ImageIO.getImageWritersByFormatName("webp");
|
||||||
|
if (!writers.hasNext()) {
|
||||||
|
throw new IllegalStateException("未找到 WebP ImageWriter,请检查 TwelveMonkeys 依赖!");
|
||||||
|
}
|
||||||
|
ImageWriter writer = writers.next();
|
||||||
|
|
||||||
|
// 3. 设置压缩质量
|
||||||
|
ImageWriteParam param = writer.getDefaultWriteParam();
|
||||||
|
param.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);
|
||||||
|
String[] types = param.getCompressionTypes();
|
||||||
|
if (types != null && types.length > 0) {
|
||||||
|
param.setCompressionType(types[0]); // 默认一般是 "Lossy"
|
||||||
|
}
|
||||||
|
param.setCompressionQuality(quality);
|
||||||
|
|
||||||
|
// 4. 写出 WebP
|
||||||
|
try (FileImageOutputStream output = new FileImageOutputStream(outputFile)) {
|
||||||
|
writer.setOutput(output);
|
||||||
|
writer.write(null, new IIOImage(image, null, null), param);
|
||||||
|
} finally {
|
||||||
|
writer.dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 从 URL 加载 PNG/JPG 等图片,压缩分辨率后转换为 WebP,并返回 InputStream
|
||||||
|
*
|
||||||
|
* @param imageUrl 图片对象存储 URL
|
||||||
|
* @param quality WebP 压缩质量 (0.0 ~ 1.0)
|
||||||
|
* @param targetWidth 目标宽度(为 0 表示按高度等比例缩放)
|
||||||
|
* @param targetHeight 目标高度(为 0 表示按宽度等比例缩放)
|
||||||
|
*/
|
||||||
|
public static WebpConverterStreamVo convertUrlToWebpStream(
|
||||||
|
String imageUrl,
|
||||||
|
float quality,
|
||||||
|
int targetWidth,
|
||||||
|
int targetHeight
|
||||||
|
) throws IOException, URISyntaxException {
|
||||||
|
|
||||||
|
// 1. 加载 URL 图片
|
||||||
|
BufferedImage original = ImageIO.read(new URI(imageUrl).toURL());
|
||||||
|
if (original == null) {
|
||||||
|
throw new IOException("无法从 URL 加载图片: " + imageUrl);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. 计算目标宽高(支持等比例缩放)
|
||||||
|
int width = original.getWidth();
|
||||||
|
int height = original.getHeight();
|
||||||
|
|
||||||
|
if (targetWidth > 0 && targetHeight > 0) {
|
||||||
|
// 固定分辨率
|
||||||
|
width = targetWidth;
|
||||||
|
height = targetHeight;
|
||||||
|
} else if (targetWidth > 0) {
|
||||||
|
// 高度自适应
|
||||||
|
height = original.getHeight() * targetWidth / original.getWidth();
|
||||||
|
width = targetWidth;
|
||||||
|
} else if (targetHeight > 0) {
|
||||||
|
// 宽度自适应
|
||||||
|
width = original.getWidth() * targetHeight / original.getHeight();
|
||||||
|
height = targetHeight;
|
||||||
|
}
|
||||||
|
// 否则都为 0,则保持原图大小
|
||||||
|
|
||||||
|
// 3. 按分辨率缩放
|
||||||
|
Image scaledInstance = original.getScaledInstance(width, height, Image.SCALE_SMOOTH);
|
||||||
|
BufferedImage resized = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
|
||||||
|
|
||||||
|
Graphics2D g = resized.createGraphics();
|
||||||
|
g.drawImage(scaledInstance, 0, 0, null);
|
||||||
|
g.dispose();
|
||||||
|
|
||||||
|
// 4. 获取 WebP writer
|
||||||
|
Iterator<ImageWriter> writers = ImageIO.getImageWritersByFormatName("webp");
|
||||||
|
if (!writers.hasNext()) {
|
||||||
|
throw new IllegalStateException("未找到 WebP ImageWriter,请确认 TwelveMonkeys 依赖已正确导入!");
|
||||||
|
}
|
||||||
|
ImageWriter writer = writers.next();
|
||||||
|
|
||||||
|
// 5. 设置压缩参数
|
||||||
|
ImageWriteParam param = writer.getDefaultWriteParam();
|
||||||
|
param.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);
|
||||||
|
|
||||||
|
String[] types = param.getCompressionTypes();
|
||||||
|
if (types != null && types.length > 0) {
|
||||||
|
param.setCompressionType(types[0]);
|
||||||
|
}
|
||||||
|
param.setCompressionQuality(quality);
|
||||||
|
|
||||||
|
// 6. 输出到流
|
||||||
|
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||||
|
try (MemoryCacheImageOutputStream output = new MemoryCacheImageOutputStream(baos)) {
|
||||||
|
writer.setOutput(output);
|
||||||
|
writer.write(null, new IIOImage(resized, null, null), param);
|
||||||
|
} finally {
|
||||||
|
writer.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 7. 返回
|
||||||
|
WebpConverterStreamVo vo = new WebpConverterStreamVo();
|
||||||
|
vo.setInputStream(new ByteArrayInputStream(baos.toByteArray()));
|
||||||
|
vo.setLength(baos.size());
|
||||||
|
vo.setContentType("image/webp");
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void main(String[] args) throws Exception {
|
||||||
|
File input = new File("input.jpeg");
|
||||||
|
File output = new File("output.webp");
|
||||||
|
convertPngToWebp(input, output, 0.6f);
|
||||||
|
System.out.println("转换完成!");
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -42,6 +42,7 @@ public class BaiDuFace {
|
|||||||
private static final String FACE_COMPARE_URL = "https://aip.baidubce.com/rest/2.0/face/v3/match?access_token=%s";
|
private static final String FACE_COMPARE_URL = "https://aip.baidubce.com/rest/2.0/face/v3/match?access_token=%s";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 人脸识别+人脸检测
|
* 人脸识别+人脸检测
|
||||||
*
|
*
|
||||||
@ -147,7 +148,6 @@ public class BaiDuFace {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 人脸对比(计算人脸相似度)
|
* 人脸对比(计算人脸相似度)
|
||||||
*
|
*
|
||||||
|
|||||||
@ -211,6 +211,13 @@ public class SubConstructionUserController extends BaseController {
|
|||||||
return toAjax(constructionUserService.batchUpdateStatus(req));
|
return toAjax(constructionUserService.batchUpdateStatus(req));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SaCheckPermission("contractor:constructionUser:updateClock")
|
||||||
|
@PutMapping("updateClockBatch")
|
||||||
|
@RepeatSubmit()
|
||||||
|
public R<Void> updateClockBatch(@Validated(EditGroup.class) @RequestBody updateClockBatchDto dto) {
|
||||||
|
return toAjax(constructionUserService.updateClockBatch(dto));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据项目id批量修改施工人员打卡状态
|
* 根据项目id批量修改施工人员打卡状态
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -0,0 +1,23 @@
|
|||||||
|
package org.dromara.contractor.domain.dto.constructionuser;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class updateClockBatchDto {
|
||||||
|
/**
|
||||||
|
* 用户id
|
||||||
|
*/
|
||||||
|
private List<Long> sysUserIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 打卡(0启用打卡 1禁止打卡)
|
||||||
|
*/
|
||||||
|
@NotNull(message = "打卡状态不能为空")
|
||||||
|
private String clock;
|
||||||
|
|
||||||
|
@NotNull(message = "项目id不能为空")
|
||||||
|
private Long projectId;
|
||||||
|
}
|
||||||
@ -53,4 +53,9 @@ public class SubConstructionUserFileTemplateReq implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private List<Long> userIdList;
|
private List<Long> userIdList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户角色
|
||||||
|
*/
|
||||||
|
private String userRole;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -66,4 +66,9 @@ public class SubConstructionUserAttendanceTotalVo implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private Integer leaveDays;
|
private Integer leaveDays;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 今天是否打卡
|
||||||
|
*/
|
||||||
|
private boolean isClockToday=false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,6 +9,11 @@ import org.dromara.contractor.domain.SubConstructionUser;
|
|||||||
import org.dromara.contractor.domain.dto.constructionuser.*;
|
import org.dromara.contractor.domain.dto.constructionuser.*;
|
||||||
import org.dromara.contractor.domain.exportvo.BusConstructionUserExportVo;
|
import org.dromara.contractor.domain.exportvo.BusConstructionUserExportVo;
|
||||||
import org.dromara.contractor.domain.vo.constructionuser.*;
|
import org.dromara.contractor.domain.vo.constructionuser.*;
|
||||||
|
import org.dromara.project.domain.bo.BusAttendanceBo;
|
||||||
|
import org.dromara.project.domain.dto.attendance.TodayUserDto;
|
||||||
|
import org.dromara.project.domain.dto.attendance.TwoWeekDto;
|
||||||
|
import org.dromara.project.domain.vo.BusAttendanceVo;
|
||||||
|
import org.dromara.project.domain.vo.attendance.AttendanceTodayUserVo;
|
||||||
import org.dromara.system.domain.vo.SysOssVo;
|
import org.dromara.system.domain.vo.SysOssVo;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
@ -109,6 +114,14 @@ public interface ISubConstructionUserService extends IService<SubConstructionUse
|
|||||||
*/
|
*/
|
||||||
Boolean updateClock(SubConstructionUserUpdateClockReq req);
|
Boolean updateClock(SubConstructionUserUpdateClockReq req);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量修改施工人员打卡状态
|
||||||
|
*
|
||||||
|
* @param dto 待修改的主键集合
|
||||||
|
* @return 是否修改成功
|
||||||
|
*/
|
||||||
|
Boolean updateClockBatch(updateClockBatchDto dto);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改施工人员项目(人员迁移)
|
* 修改施工人员项目(人员迁移)
|
||||||
*
|
*
|
||||||
@ -245,4 +258,9 @@ public interface ISubConstructionUserService extends IService<SubConstructionUse
|
|||||||
* @return 施工人员
|
* @return 施工人员
|
||||||
*/
|
*/
|
||||||
SubConstructionUser getByUserId(Long sysUserId);
|
SubConstructionUser getByUserId(Long sysUserId);
|
||||||
|
|
||||||
|
|
||||||
|
TableDataInfo<AttendanceTodayUserVo> todayUserList(TodayUserDto dto, PageQuery pageQuery);
|
||||||
|
|
||||||
|
List<AttendanceTodayUserVo> todayUserList(TodayUserDto dto);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package org.dromara.contractor.service.impl;
|
|||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.io.FileUtil;
|
import cn.hutool.core.io.FileUtil;
|
||||||
|
import cn.hutool.core.util.IdcardUtil;
|
||||||
import cn.hutool.core.util.RandomUtil;
|
import cn.hutool.core.util.RandomUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.core.util.ZipUtil;
|
import cn.hutool.core.util.ZipUtil;
|
||||||
@ -17,6 +18,7 @@ import org.dromara.common.core.utils.DateUtils;
|
|||||||
import org.dromara.common.core.utils.ObjectUtils;
|
import org.dromara.common.core.utils.ObjectUtils;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.dromara.common.core.utils.file.FileUtils;
|
import org.dromara.common.core.utils.file.FileUtils;
|
||||||
|
import org.dromara.common.utils.IdCardEncryptorUtil;
|
||||||
import org.dromara.contractor.constant.SubConstructionUserConstant;
|
import org.dromara.contractor.constant.SubConstructionUserConstant;
|
||||||
import org.dromara.contractor.domain.SubConstructionUser;
|
import org.dromara.contractor.domain.SubConstructionUser;
|
||||||
import org.dromara.contractor.domain.SubConstructionUserFile;
|
import org.dromara.contractor.domain.SubConstructionUserFile;
|
||||||
@ -32,7 +34,6 @@ import org.dromara.project.domain.BusConstructionBlacklist;
|
|||||||
import org.dromara.project.domain.BusProject;
|
import org.dromara.project.domain.BusProject;
|
||||||
import org.dromara.project.service.IBusConstructionBlacklistService;
|
import org.dromara.project.service.IBusConstructionBlacklistService;
|
||||||
import org.dromara.project.service.IBusProjectService;
|
import org.dromara.project.service.IBusProjectService;
|
||||||
import org.dromara.safety.service.IWgzQuestionSavePdfService;
|
|
||||||
import org.dromara.system.domain.vo.SysDictDataVo;
|
import org.dromara.system.domain.vo.SysDictDataVo;
|
||||||
import org.dromara.system.domain.vo.SysOssVo;
|
import org.dromara.system.domain.vo.SysOssVo;
|
||||||
import org.dromara.system.service.ISysDictTypeService;
|
import org.dromara.system.service.ISysDictTypeService;
|
||||||
@ -79,7 +80,7 @@ public class SubConstructionUserFileServiceImpl extends ServiceImpl<SubConstruct
|
|||||||
private ISysOssService ossService;
|
private ISysOssService ossService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private IWgzQuestionSavePdfService wgzQuestionSavePdfService;
|
private IdCardEncryptorUtil idCardEncryptorUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询施工人员文件存储
|
* 查询施工人员文件存储
|
||||||
@ -150,6 +151,7 @@ public class SubConstructionUserFileServiceImpl extends ServiceImpl<SubConstruct
|
|||||||
throw new ServiceException("项目不存在", HttpStatus.BAD_REQUEST);
|
throw new ServiceException("项目不存在", HttpStatus.BAD_REQUEST);
|
||||||
}
|
}
|
||||||
// 2. 查询施工人员列表
|
// 2. 查询施工人员列表
|
||||||
|
req.setUserRole("0");
|
||||||
List<SubConstructionUser> constructionUserList = constructionUserService.list(this.buildTemplateQueryWrapper(req));
|
List<SubConstructionUser> constructionUserList = constructionUserService.list(this.buildTemplateQueryWrapper(req));
|
||||||
// 3. 根目录名称
|
// 3. 根目录名称
|
||||||
String randomString = project.getId() + "_" + RandomUtil.randomString(8);
|
String randomString = project.getId() + "_" + RandomUtil.randomString(8);
|
||||||
@ -164,7 +166,11 @@ public class SubConstructionUserFileServiceImpl extends ServiceImpl<SubConstruct
|
|||||||
zipOut.closeEntry();
|
zipOut.closeEntry();
|
||||||
// 7. 对每个人,创建其文件夹,再在其中创建子文件夹(如“三级安全教育”、“体检报告”...)及文件
|
// 7. 对每个人,创建其文件夹,再在其中创建子文件夹(如“三级安全教育”、“体检报告”...)及文件
|
||||||
for (SubConstructionUser constructionUser : constructionUserList) {
|
for (SubConstructionUser constructionUser : constructionUserList) {
|
||||||
String personFolder = rootFolder + constructionUser.getUserName() + "-" + constructionUser.getSysUserId() + "/";
|
// 获取身份证信息
|
||||||
|
String sfzNumber = constructionUser.getSfzNumber();
|
||||||
|
// 解密
|
||||||
|
String decrypt = idCardEncryptorUtil.decrypt(sfzNumber);
|
||||||
|
String personFolder = rootFolder + constructionUser.getUserName() + "-" + decrypt + "/";
|
||||||
// 7.1. 写入个人文件夹条目
|
// 7.1. 写入个人文件夹条目
|
||||||
zipOut.putNextEntry(new ZipEntry(personFolder));
|
zipOut.putNextEntry(new ZipEntry(personFolder));
|
||||||
zipOut.closeEntry();
|
zipOut.closeEntry();
|
||||||
@ -220,6 +226,22 @@ public class SubConstructionUserFileServiceImpl extends ServiceImpl<SubConstruct
|
|||||||
String destDirPath = basePath + "/" + DateUtils.getDate() + "/" + projectId + "/" + randomStr;
|
String destDirPath = basePath + "/" + DateUtils.getDate() + "/" + projectId + "/" + randomStr;
|
||||||
// 构建需要修改的对象
|
// 构建需要修改的对象
|
||||||
List<SubConstructionUserFile> constructionUserFileList = new ArrayList<>();
|
List<SubConstructionUserFile> constructionUserFileList = new ArrayList<>();
|
||||||
|
// 获取所有身份证对应的用户信息
|
||||||
|
List<SubConstructionUser> allUserList = constructionUserService.lambdaQuery()
|
||||||
|
.select(SubConstructionUser::getId, SubConstructionUser::getSysUserId,
|
||||||
|
SubConstructionUser::getUserName, SubConstructionUser::getSfzNumber)
|
||||||
|
.eq(SubConstructionUser::getProjectId, projectId)
|
||||||
|
.eq( SubConstructionUser::getUserRole, "0")
|
||||||
|
.list();
|
||||||
|
if (CollUtil.isEmpty(allUserList)) {
|
||||||
|
throw new ServiceException("项目下无施工人员");
|
||||||
|
}
|
||||||
|
Map<String, Long> userMap = allUserList.stream()
|
||||||
|
.collect(Collectors.toMap(
|
||||||
|
SubConstructionUser::getSfzNumber,
|
||||||
|
SubConstructionUser::getSysUserId,
|
||||||
|
(oldV, newV) -> newV
|
||||||
|
));
|
||||||
try {
|
try {
|
||||||
// 2. 创建临时文件
|
// 2. 创建临时文件
|
||||||
tempZipFile = File.createTempFile(tempZipFilePath, null);
|
tempZipFile = File.createTempFile(tempZipFilePath, null);
|
||||||
@ -227,56 +249,8 @@ public class SubConstructionUserFileServiceImpl extends ServiceImpl<SubConstruct
|
|||||||
// 3. 解压 zip
|
// 3. 解压 zip
|
||||||
destDir = new File(destDirPath);
|
destDir = new File(destDirPath);
|
||||||
ZipUtil.unzip(tempZipFile, destDir);
|
ZipUtil.unzip(tempZipFile, destDir);
|
||||||
// 4. 遍历最外层文件夹
|
// 4. 递归扫描目录
|
||||||
File[] userFolders = destDir.listFiles();
|
scanUserFolders(destDir, userMap, constructionUserFileList);
|
||||||
if (userFolders != null) {
|
|
||||||
for (File userFolder : userFolders) {
|
|
||||||
if (userFolder.isDirectory()) {
|
|
||||||
String userFolderName = userFolder.getName(); // 李四-1905161272755195006
|
|
||||||
// 5. 解析 userId
|
|
||||||
long userId = Long.parseLong(userFolderName.substring(userFolderName.lastIndexOf("-") + 1));
|
|
||||||
// 6. 继续遍历每个用户子文件夹里的 1_合同, 2_体检报告, ...
|
|
||||||
File[] docFolders = userFolder.listFiles();
|
|
||||||
if (docFolders != null) {
|
|
||||||
for (File docFolder : docFolders) {
|
|
||||||
if (docFolder.isDirectory()) {
|
|
||||||
String docFolderName = docFolder.getName(); // 1_合同
|
|
||||||
String[] docParts = docFolderName.split("_");
|
|
||||||
String fileType = docParts[0];
|
|
||||||
// 7. 获取该文件夹下所有文件
|
|
||||||
File[] filesInDocFolder = docFolder.listFiles();
|
|
||||||
String fileIdStr = null;
|
|
||||||
if (filesInDocFolder != null) {
|
|
||||||
// 遍历文件
|
|
||||||
List<Long> fileIds = new ArrayList<>();
|
|
||||||
for (File file : filesInDocFolder) {
|
|
||||||
if (file.isFile()) {
|
|
||||||
SysOssVo upload = ossService.upload(file);
|
|
||||||
if (upload != null) {
|
|
||||||
fileIds.add(upload.getOssId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 跳过空文件
|
|
||||||
if (fileIds.isEmpty()) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
fileIdStr = fileIds.stream()
|
|
||||||
.map(String::valueOf)
|
|
||||||
.collect(Collectors.joining(","));
|
|
||||||
}
|
|
||||||
// 8. 创建 BusConstructionUserFile 对象
|
|
||||||
SubConstructionUserFile constructionUserFile = new SubConstructionUserFile();
|
|
||||||
constructionUserFile.setUserId(userId);
|
|
||||||
constructionUserFile.setFileType(fileType);
|
|
||||||
constructionUserFile.setPath(fileIdStr);
|
|
||||||
constructionUserFileList.add(constructionUserFile);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new ServiceException("文件上传失败", HttpStatus.ERROR);
|
throw new ServiceException("文件上传失败", HttpStatus.ERROR);
|
||||||
} finally {
|
} finally {
|
||||||
@ -451,6 +425,7 @@ public class SubConstructionUserFileServiceImpl extends ServiceImpl<SubConstruct
|
|||||||
String typeOfWork = req.getTypeOfWork();
|
String typeOfWork = req.getTypeOfWork();
|
||||||
String clock = req.getClock();
|
String clock = req.getClock();
|
||||||
List<Long> userIdList = req.getUserIdList();
|
List<Long> userIdList = req.getUserIdList();
|
||||||
|
String userRole = req.getUserRole();
|
||||||
// 模糊查询
|
// 模糊查询
|
||||||
lqw.like(StringUtils.isNotBlank(userName), SubConstructionUser::getUserName, userName);
|
lqw.like(StringUtils.isNotBlank(userName), SubConstructionUser::getUserName, userName);
|
||||||
// 精确查询
|
// 精确查询
|
||||||
@ -459,9 +434,8 @@ public class SubConstructionUserFileServiceImpl extends ServiceImpl<SubConstruct
|
|||||||
lqw.eq(ObjectUtils.isNotEmpty(teamId), SubConstructionUser::getTeamId, teamId);
|
lqw.eq(ObjectUtils.isNotEmpty(teamId), SubConstructionUser::getTeamId, teamId);
|
||||||
lqw.eq(StringUtils.isNotBlank(typeOfWork), SubConstructionUser::getTypeOfWork, typeOfWork);
|
lqw.eq(StringUtils.isNotBlank(typeOfWork), SubConstructionUser::getTypeOfWork, typeOfWork);
|
||||||
lqw.eq(StringUtils.isNotBlank(clock), SubConstructionUser::getClock, clock);
|
lqw.eq(StringUtils.isNotBlank(clock), SubConstructionUser::getClock, clock);
|
||||||
if (CollUtil.isNotEmpty(userIdList)) {
|
lqw.in(CollUtil.isNotEmpty(userIdList), SubConstructionUser::getId, userIdList);
|
||||||
lqw.in(SubConstructionUser::getId, userIdList);
|
lqw.eq(StringUtils.isNotBlank(userRole), SubConstructionUser::getUserRole, userRole);
|
||||||
}
|
|
||||||
// 根据项目id获取黑名单施工人员
|
// 根据项目id获取黑名单施工人员
|
||||||
List<Long> blacklistUserIdList = constructionBlacklistService.lambdaQuery()
|
List<Long> blacklistUserIdList = constructionBlacklistService.lambdaQuery()
|
||||||
.eq(BusConstructionBlacklist::getProjectId, projectId)
|
.eq(BusConstructionBlacklist::getProjectId, projectId)
|
||||||
@ -495,4 +469,72 @@ public class SubConstructionUserFileServiceImpl extends ServiceImpl<SubConstruct
|
|||||||
}
|
}
|
||||||
return resultMap;
|
return resultMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 递归扫描指定目录,找到 “姓名-Id” 格式的文件夹并解析
|
||||||
|
*/
|
||||||
|
public void scanUserFolders(File root, Map<String, Long> userMap, List<SubConstructionUserFile> resultList) {
|
||||||
|
if (root == null || !root.exists()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
File[] files = root.listFiles();
|
||||||
|
if (files == null) return;
|
||||||
|
for (File file : files) {
|
||||||
|
if (file.isDirectory()) {
|
||||||
|
// 判断是否为 “姓名-身份证号” 格式
|
||||||
|
String folderName = file.getName();
|
||||||
|
int idx = folderName.lastIndexOf("-");
|
||||||
|
if (idx > 0) {
|
||||||
|
String idCard = folderName.substring(idx + 1);
|
||||||
|
// 校验身份证
|
||||||
|
if (IdcardUtil.isValidCard(idCard)) {
|
||||||
|
// 根据身份证获取用户id
|
||||||
|
String encrypt = idCardEncryptorUtil.encrypt(idCard);
|
||||||
|
if (userMap.containsKey(encrypt)) {
|
||||||
|
Long userId = userMap.get(encrypt);
|
||||||
|
parseUserDocFolder(file, userId, resultList);
|
||||||
|
} else {
|
||||||
|
log.warn("未找到身份证为 {} 的施工人员", idCard);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
scanUserFolders(file, userMap, resultList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 解析用户目录下的 1_合同、2_体检报告 等目录
|
||||||
|
*/
|
||||||
|
private void parseUserDocFolder(File userFolder, long userId, List<SubConstructionUserFile> resultList) {
|
||||||
|
File[] docFolders = userFolder.listFiles();
|
||||||
|
if (docFolders == null) return;
|
||||||
|
for (File docFolder : docFolders) {
|
||||||
|
if (!docFolder.isDirectory()) continue;
|
||||||
|
String folderName = docFolder.getName(); // 例如:1_合同
|
||||||
|
String[] parts = folderName.split("_");
|
||||||
|
if (parts.length < 2) continue;
|
||||||
|
String fileType = parts[0];
|
||||||
|
// 获取所有文件
|
||||||
|
File[] files = docFolder.listFiles();
|
||||||
|
if (files == null) continue;
|
||||||
|
List<Long> fileIds = new ArrayList<>();
|
||||||
|
for (File item : files) {
|
||||||
|
if (item.isFile()) {
|
||||||
|
SysOssVo upload = ossService.upload(item);
|
||||||
|
if (upload != null) {
|
||||||
|
fileIds.add(upload.getOssId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (fileIds.isEmpty()) continue;
|
||||||
|
// 生成对象
|
||||||
|
SubConstructionUserFile u = new SubConstructionUserFile();
|
||||||
|
u.setUserId(userId);
|
||||||
|
u.setFileType(fileType);
|
||||||
|
u.setPath(fileIds.stream().map(String::valueOf).collect(Collectors.joining(",")));
|
||||||
|
resultList.add(u);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,10 +3,7 @@ package org.dromara.contractor.service.impl;
|
|||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.io.IoUtil;
|
import cn.hutool.core.io.IoUtil;
|
||||||
import cn.hutool.core.util.DesensitizedUtil;
|
import cn.hutool.core.util.*;
|
||||||
import cn.hutool.core.util.IdcardUtil;
|
|
||||||
import cn.hutool.core.util.PhoneUtil;
|
|
||||||
import cn.hutool.core.util.RandomUtil;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
@ -49,9 +46,12 @@ import org.dromara.contractor.service.ISubConstructionUserFileService;
|
|||||||
import org.dromara.contractor.service.ISubConstructionUserService;
|
import org.dromara.contractor.service.ISubConstructionUserService;
|
||||||
import org.dromara.contractor.service.ISubContractorService;
|
import org.dromara.contractor.service.ISubContractorService;
|
||||||
import org.dromara.project.domain.*;
|
import org.dromara.project.domain.*;
|
||||||
|
import org.dromara.project.domain.dto.attendance.TodayUserDto;
|
||||||
|
import org.dromara.project.domain.dto.attendance.TwoWeekDto;
|
||||||
import org.dromara.project.domain.enums.BusAttendanceClockStatusEnum;
|
import org.dromara.project.domain.enums.BusAttendanceClockStatusEnum;
|
||||||
import org.dromara.project.domain.enums.BusAttendanceCommuterEnum;
|
import org.dromara.project.domain.enums.BusAttendanceCommuterEnum;
|
||||||
import org.dromara.project.domain.enums.BusConstructionUserAttendanceStatusEnum;
|
import org.dromara.project.domain.enums.BusConstructionUserAttendanceStatusEnum;
|
||||||
|
import org.dromara.project.domain.vo.attendance.AttendanceTodayUserVo;
|
||||||
import org.dromara.project.domain.vo.projectteam.BusProjectTeamAppVo;
|
import org.dromara.project.domain.vo.projectteam.BusProjectTeamAppVo;
|
||||||
import org.dromara.project.service.*;
|
import org.dromara.project.service.*;
|
||||||
import org.dromara.system.domain.SysUser;
|
import org.dromara.system.domain.SysUser;
|
||||||
@ -615,6 +615,15 @@ public class SubConstructionUserServiceImpl extends ServiceImpl<SubConstructionU
|
|||||||
return this.updateById(constructionUser);
|
return this.updateById(constructionUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean updateClockBatch(updateClockBatchDto dto) {
|
||||||
|
this.lambdaUpdate().set(SubConstructionUser::getClock, dto.getClock())
|
||||||
|
.eq(SubConstructionUser::getProjectId, dto.getProjectId())
|
||||||
|
.in(CollectionUtil.isNotEmpty(dto.getSysUserIds()), SubConstructionUser::getSysUserId, dto.getSysUserIds())
|
||||||
|
.update();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改施工人员项目(人员迁移)
|
* 修改施工人员项目(人员迁移)
|
||||||
*
|
*
|
||||||
@ -1177,6 +1186,16 @@ public class SubConstructionUserServiceImpl extends ServiceImpl<SubConstructionU
|
|||||||
attendanceLqw.between(BusAttendance::getClockDate, start, end);
|
attendanceLqw.between(BusAttendance::getClockDate, start, end);
|
||||||
Map<Long, List<BusAttendance>> userIdBusAttendanceListMap = attendanceService.list(attendanceLqw)
|
Map<Long, List<BusAttendance>> userIdBusAttendanceListMap = attendanceService.list(attendanceLqw)
|
||||||
.stream().collect(Collectors.groupingBy(BusAttendance::getUserId));
|
.stream().collect(Collectors.groupingBy(BusAttendance::getUserId));
|
||||||
|
//获取今天打卡人员
|
||||||
|
LambdaQueryWrapper<BusAttendance> attendanceWrapper = Wrappers.lambdaQuery(BusAttendance.class)
|
||||||
|
.eq(BusAttendance::getProjectId, projectId)
|
||||||
|
.eq(BusAttendance::getClockDate, LocalDate.now())
|
||||||
|
.in(BusAttendance::getClockStatus, BusAttendanceClockStatusEnum.ATTENDANCE_LIST)
|
||||||
|
.in(BusAttendance::getUserId, userIdList);
|
||||||
|
List<BusAttendance> list = attendanceService.list(attendanceWrapper);
|
||||||
|
List<Long> attendanceUserIdList = list.stream().map(BusAttendance::getUserId).toList();
|
||||||
|
|
||||||
|
|
||||||
// 填充信息
|
// 填充信息
|
||||||
List<SubConstructionUserAttendanceTotalVo> userAttendanceTotalList = constructionUserList.stream().map(constructionUser -> {
|
List<SubConstructionUserAttendanceTotalVo> userAttendanceTotalList = constructionUserList.stream().map(constructionUser -> {
|
||||||
SubConstructionUserAttendanceTotalVo constructionUserAttendanceTotalResp = new SubConstructionUserAttendanceTotalVo();
|
SubConstructionUserAttendanceTotalVo constructionUserAttendanceTotalResp = new SubConstructionUserAttendanceTotalVo();
|
||||||
@ -1234,6 +1253,9 @@ public class SubConstructionUserServiceImpl extends ServiceImpl<SubConstructionU
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(attendanceUserIdList.contains(id)){
|
||||||
|
constructionUserAttendanceTotalResp.setClockToday(true);
|
||||||
|
}
|
||||||
constructionUserAttendanceTotalResp.setAttendanceDays(attendanceDays);
|
constructionUserAttendanceTotalResp.setAttendanceDays(attendanceDays);
|
||||||
constructionUserAttendanceTotalResp.setLateDays(lateDays);
|
constructionUserAttendanceTotalResp.setLateDays(lateDays);
|
||||||
constructionUserAttendanceTotalResp.setLeaveEarlyDays(leaveEarlyDays);
|
constructionUserAttendanceTotalResp.setLeaveEarlyDays(leaveEarlyDays);
|
||||||
@ -1577,4 +1599,90 @@ public class SubConstructionUserServiceImpl extends ServiceImpl<SubConstructionU
|
|||||||
.last("limit 1")
|
.last("limit 1")
|
||||||
.one();
|
.one();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TableDataInfo<AttendanceTodayUserVo> todayUserList(TodayUserDto dto, PageQuery pageQuery) {
|
||||||
|
LambdaQueryWrapper<SubConstructionUser> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
|
wrapper.eq(SubConstructionUser::getUserRole, "0")
|
||||||
|
.eq(SubConstructionUser::getProjectId, dto.getProjectId())
|
||||||
|
.eq(dto.getTeamId() != null, SubConstructionUser::getTeamId, dto.getTeamId())
|
||||||
|
.eq(StrUtil.isNotBlank(dto.getTypeOfWork()), SubConstructionUser::getTypeOfWork, dto.getTypeOfWork())
|
||||||
|
.like(StrUtil.isNotBlank(dto.getUserName()), SubConstructionUser::getUserName, dto.getUserName())
|
||||||
|
.isNotNull(SubConstructionUser::getTeamId);
|
||||||
|
if("1".equals(dto.getType())){
|
||||||
|
wrapper.in(SubConstructionUser::getSysUserId, dto.getUserIds());
|
||||||
|
}else if("2".equals(dto.getType())){
|
||||||
|
if(dto.getIsToday()){
|
||||||
|
wrapper.notIn(CollectionUtil.isNotEmpty(dto.getUserIds()),SubConstructionUser::getSysUserId, dto.getUserIds());
|
||||||
|
}else {
|
||||||
|
wrapper.in(SubConstructionUser::getSysUserId, dto.getUserIds());
|
||||||
|
}
|
||||||
|
|
||||||
|
}else{
|
||||||
|
wrapper.in(SubConstructionUser::getSysUserId, dto.getUserIds());
|
||||||
|
}
|
||||||
|
|
||||||
|
Page<SubConstructionUser> result = this.page(pageQuery.build(), wrapper);
|
||||||
|
|
||||||
|
List<SubConstructionUser> records = result.getRecords();
|
||||||
|
List<Long> list1 = records.stream().map(SubConstructionUser::getTeamId).toList();
|
||||||
|
List<BusProjectTeam> busProjectTeams = projectTeamService.listByIds(list1);
|
||||||
|
Map<Long, String> teamMap = busProjectTeams.stream().collect(Collectors.toMap(BusProjectTeam::getId, BusProjectTeam::getTeamName));
|
||||||
|
|
||||||
|
List<AttendanceTodayUserVo> attendanceTodayUserVos = new ArrayList<>();
|
||||||
|
for (SubConstructionUser constructionUser : records) {
|
||||||
|
AttendanceTodayUserVo attendanceTodayUserVo = new AttendanceTodayUserVo();
|
||||||
|
attendanceTodayUserVo.setUserId(constructionUser.getSysUserId());
|
||||||
|
attendanceTodayUserVo.setUserName(constructionUser.getUserName());
|
||||||
|
attendanceTodayUserVo.setTypeOfWork(constructionUser.getTypeOfWork());
|
||||||
|
attendanceTodayUserVo.setTeamName(teamMap.get(constructionUser.getTeamId()));
|
||||||
|
attendanceTodayUserVos.add(attendanceTodayUserVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new TableDataInfo<>(attendanceTodayUserVos, result.getTotal());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AttendanceTodayUserVo> todayUserList(TodayUserDto dto) {
|
||||||
|
LambdaQueryWrapper<SubConstructionUser> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
|
wrapper.eq(SubConstructionUser::getUserRole, "0")
|
||||||
|
.eq(SubConstructionUser::getProjectId, dto.getProjectId())
|
||||||
|
.eq(dto.getTeamId() != null, SubConstructionUser::getTeamId, dto.getTeamId())
|
||||||
|
.eq(StrUtil.isNotBlank(dto.getTypeOfWork()), SubConstructionUser::getTypeOfWork, dto.getTypeOfWork())
|
||||||
|
.like(StrUtil.isNotBlank(dto.getUserName()), SubConstructionUser::getUserName, dto.getUserName())
|
||||||
|
.isNotNull(SubConstructionUser::getTeamId);
|
||||||
|
if("1".equals(dto.getType())){
|
||||||
|
wrapper.in(SubConstructionUser::getSysUserId, dto.getUserIds());
|
||||||
|
}else if("2".equals(dto.getType())){
|
||||||
|
if(dto.getIsToday()){
|
||||||
|
wrapper.notIn(CollectionUtil.isNotEmpty(dto.getUserIds()),SubConstructionUser::getSysUserId, dto.getUserIds());
|
||||||
|
}else {
|
||||||
|
wrapper.in(SubConstructionUser::getSysUserId, dto.getUserIds());
|
||||||
|
}
|
||||||
|
|
||||||
|
}else{
|
||||||
|
wrapper.in(SubConstructionUser::getSysUserId, dto.getUserIds());
|
||||||
|
}
|
||||||
|
|
||||||
|
List<SubConstructionUser> records = this.list(wrapper);
|
||||||
|
|
||||||
|
List<Long> list1 = records.stream().map(SubConstructionUser::getTeamId).toList();
|
||||||
|
List<BusProjectTeam> busProjectTeams = projectTeamService.listByIds(list1);
|
||||||
|
Map<Long, String> teamMap = busProjectTeams.stream().collect(Collectors.toMap(BusProjectTeam::getId, BusProjectTeam::getTeamName));
|
||||||
|
|
||||||
|
List<AttendanceTodayUserVo> attendanceTodayUserVos = new ArrayList<>();
|
||||||
|
for (SubConstructionUser constructionUser : records) {
|
||||||
|
AttendanceTodayUserVo attendanceTodayUserVo = new AttendanceTodayUserVo();
|
||||||
|
attendanceTodayUserVo.setUserId(constructionUser.getSysUserId());
|
||||||
|
attendanceTodayUserVo.setUserName(constructionUser.getUserName());
|
||||||
|
attendanceTodayUserVo.setTypeOfWork(constructionUser.getTypeOfWork());
|
||||||
|
attendanceTodayUserVo.setTeamName(teamMap.get(constructionUser.getTeamId()));
|
||||||
|
attendanceTodayUserVos.add(attendanceTodayUserVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
return attendanceTodayUserVos;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,7 +14,6 @@ import org.dromara.common.core.utils.ObjectUtils;
|
|||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
import org.dromara.common.satoken.utils.LoginHelper;
|
|
||||||
import org.dromara.contractor.domain.SubConstructionUser;
|
import org.dromara.contractor.domain.SubConstructionUser;
|
||||||
import org.dromara.contractor.domain.SubContractor;
|
import org.dromara.contractor.domain.SubContractor;
|
||||||
import org.dromara.contractor.domain.dto.contractor.SubContractorCreateReq;
|
import org.dromara.contractor.domain.dto.contractor.SubContractorCreateReq;
|
||||||
@ -29,9 +28,12 @@ import org.dromara.contractor.service.ISubContractorService;
|
|||||||
import org.dromara.project.domain.BusProject;
|
import org.dromara.project.domain.BusProject;
|
||||||
import org.dromara.project.domain.enums.SubConstructionUserRoleEnum;
|
import org.dromara.project.domain.enums.SubConstructionUserRoleEnum;
|
||||||
import org.dromara.project.service.IBusProjectService;
|
import org.dromara.project.service.IBusProjectService;
|
||||||
|
import org.dromara.system.domain.SysUser;
|
||||||
|
import org.dromara.system.service.ISysUserService;
|
||||||
import org.dromara.tender.domain.TenderSupplierInput;
|
import org.dromara.tender.domain.TenderSupplierInput;
|
||||||
import org.dromara.tender.service.ITenderSupplierInputService;
|
import org.dromara.tender.service.ITenderSupplierInputService;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
@ -57,6 +59,10 @@ public class SubContractorServiceImpl extends ServiceImpl<SubContractorMapper, S
|
|||||||
@Resource
|
@Resource
|
||||||
private ITenderSupplierInputService supplierInputService;
|
private ITenderSupplierInputService supplierInputService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
@Lazy
|
||||||
|
private ISysUserService userService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询分包单位
|
* 查询分包单位
|
||||||
*
|
*
|
||||||
@ -118,16 +124,19 @@ public class SubContractorServiceImpl extends ServiceImpl<SubContractorMapper, S
|
|||||||
contractor.setFiles(fileMapStr);
|
contractor.setFiles(fileMapStr);
|
||||||
// 数据校验
|
// 数据校验
|
||||||
validEntityBeforeSave(contractor);
|
validEntityBeforeSave(contractor);
|
||||||
String name = req.getName();
|
|
||||||
Long count = this.lambdaQuery().eq(SubContractor::getName, name).count();
|
|
||||||
if (count > 0) {
|
|
||||||
throw new ServiceException("分包单位名称重复", HttpStatus.BAD_REQUEST);
|
|
||||||
}
|
|
||||||
Long projectId = req.getProjectId();
|
Long projectId = req.getProjectId();
|
||||||
BusProject project = projectService.getById(projectId);
|
BusProject project = projectService.getById(projectId);
|
||||||
if (project == null) {
|
if (project == null) {
|
||||||
throw new ServiceException("项目不存在", HttpStatus.NOT_FOUND);
|
throw new ServiceException("项目不存在", HttpStatus.NOT_FOUND);
|
||||||
}
|
}
|
||||||
|
String name = req.getName();
|
||||||
|
Long count = this.lambdaQuery()
|
||||||
|
.eq(SubContractor::getName, name)
|
||||||
|
.eq(SubContractor::getProjectId, projectId)
|
||||||
|
.count();
|
||||||
|
if (count > 0) {
|
||||||
|
throw new ServiceException("分包单位名称重复", HttpStatus.BAD_REQUEST);
|
||||||
|
}
|
||||||
// 操作数据库
|
// 操作数据库
|
||||||
boolean save = this.save(contractor);
|
boolean save = this.save(contractor);
|
||||||
if (!save) {
|
if (!save) {
|
||||||
@ -160,7 +169,10 @@ public class SubContractorServiceImpl extends ServiceImpl<SubContractorMapper, S
|
|||||||
}
|
}
|
||||||
// 判断名称是否重复
|
// 判断名称是否重复
|
||||||
if (!oldContractor.getName().equals(req.getName())) {
|
if (!oldContractor.getName().equals(req.getName())) {
|
||||||
Long count = this.lambdaQuery().eq(SubContractor::getName, req.getName()).count();
|
Long count = this.lambdaQuery()
|
||||||
|
.eq(SubContractor::getName, req.getName())
|
||||||
|
.eq(SubContractor::getProjectId, req.getProjectId())
|
||||||
|
.count();
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
throw new ServiceException("分包单位名称重复", HttpStatus.BAD_REQUEST);
|
throw new ServiceException("分包单位名称重复", HttpStatus.BAD_REQUEST);
|
||||||
}
|
}
|
||||||
@ -355,21 +367,11 @@ public class SubContractorServiceImpl extends ServiceImpl<SubContractorMapper, S
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SubManagerVo> queryManagerListById(Long id) {
|
public List<SubManagerVo> queryManagerListById(Long id) {
|
||||||
SubContractor contractor = this.getById(id);
|
List<SysUser> sysUsers = userService.selectUserListByContractorId(id);
|
||||||
if (contractor == null) {
|
return sysUsers.stream().map(user -> {
|
||||||
throw new ServiceException("分包方不存在", HttpStatus.NOT_FOUND);
|
|
||||||
}
|
|
||||||
List<SubConstructionUser> adminUserList = constructionUserService.lambdaQuery()
|
|
||||||
.eq(SubConstructionUser::getContractorId, id)
|
|
||||||
.eq(SubConstructionUser::getUserRole, SubConstructionUserRoleEnum.ADMIN.getValue())
|
|
||||||
.list();
|
|
||||||
if (CollUtil.isEmpty(adminUserList)) {
|
|
||||||
return List.of();
|
|
||||||
}
|
|
||||||
return adminUserList.stream().map(user -> {
|
|
||||||
SubManagerVo managerVo = new SubManagerVo();
|
SubManagerVo managerVo = new SubManagerVo();
|
||||||
managerVo.setManagerId(user.getSysUserId());
|
managerVo.setManagerId(user.getUserId());
|
||||||
managerVo.setManagerName(user.getUserName());
|
managerVo.setManagerName(user.getNickName());
|
||||||
return managerVo;
|
return managerVo;
|
||||||
}).distinct().toList();
|
}).distinct().toList();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,23 +8,18 @@ import com.alibaba.excel.EasyExcel;
|
|||||||
import com.alibaba.excel.ExcelWriter;
|
import com.alibaba.excel.ExcelWriter;
|
||||||
import com.alibaba.excel.write.metadata.WriteSheet;
|
import com.alibaba.excel.write.metadata.WriteSheet;
|
||||||
import com.alibaba.excel.write.metadata.fill.FillConfig;
|
import com.alibaba.excel.write.metadata.fill.FillConfig;
|
||||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
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;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import jakarta.servlet.ServletException;
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.pdfbox.io.IOUtils;
|
|
||||||
import org.apache.poi.ss.usermodel.Sheet;
|
import org.apache.poi.ss.usermodel.Sheet;
|
||||||
import org.apache.poi.ss.usermodel.Workbook;
|
import org.apache.poi.ss.usermodel.Workbook;
|
||||||
import org.apache.poi.ss.usermodel.WorkbookFactory;
|
import org.apache.poi.ss.usermodel.WorkbookFactory;
|
||||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
||||||
import org.dromara.bigscreen.domain.BusConstructionUser;
|
|
||||||
import org.dromara.common.core.constant.HttpStatus;
|
import org.dromara.common.core.constant.HttpStatus;
|
||||||
import org.dromara.common.core.exception.ServiceException;
|
import org.dromara.common.core.exception.ServiceException;
|
||||||
import org.dromara.common.core.utils.ObjectUtils;
|
import org.dromara.common.core.utils.ObjectUtils;
|
||||||
@ -35,19 +30,15 @@ import org.dromara.common.satoken.utils.LoginHelper;
|
|||||||
import org.dromara.common.utils.IdCardEncryptorUtil;
|
import org.dromara.common.utils.IdCardEncryptorUtil;
|
||||||
import org.dromara.contractor.domain.SubConstructionUser;
|
import org.dromara.contractor.domain.SubConstructionUser;
|
||||||
import org.dromara.contractor.domain.SubUserSalaryDetail;
|
import org.dromara.contractor.domain.SubUserSalaryDetail;
|
||||||
import org.dromara.contractor.domain.SubUserSalaryPeriod;
|
|
||||||
import org.dromara.contractor.domain.dto.constructionuser.SubConstructionUserQueryReq;
|
|
||||||
import org.dromara.contractor.domain.dto.usersalarydetail.SubUserSalaryDetailQueryReq;
|
import org.dromara.contractor.domain.dto.usersalarydetail.SubUserSalaryDetailQueryReq;
|
||||||
import org.dromara.contractor.domain.dto.usersalaryperiod.SubConstructionUserSalaryDto;
|
import org.dromara.contractor.domain.dto.usersalaryperiod.SubConstructionUserSalaryDto;
|
||||||
import org.dromara.contractor.domain.exportvo.BusConstructionUserExportVo;
|
|
||||||
import org.dromara.contractor.domain.vo.constructionuser.SubConstructionUserVo;
|
|
||||||
import org.dromara.contractor.domain.vo.usersalarydetail.SubUserSalaryDetailVo;
|
import org.dromara.contractor.domain.vo.usersalarydetail.SubUserSalaryDetailVo;
|
||||||
import org.dromara.contractor.domain.vo.usersalaryperiod.SubConstructionUserSalaryVo;
|
import org.dromara.contractor.domain.vo.usersalaryperiod.SubConstructionUserSalaryVo;
|
||||||
import org.dromara.contractor.excel.DynamicSalaryData;
|
import org.dromara.contractor.excel.DynamicSalaryData;
|
||||||
|
import org.dromara.contractor.excel.SalaryExcelReader;
|
||||||
import org.dromara.contractor.mapper.SubUserSalaryDetailMapper;
|
import org.dromara.contractor.mapper.SubUserSalaryDetailMapper;
|
||||||
import org.dromara.contractor.service.ISubConstructionUserService;
|
import org.dromara.contractor.service.ISubConstructionUserService;
|
||||||
import org.dromara.contractor.service.ISubUserSalaryDetailService;
|
import org.dromara.contractor.service.ISubUserSalaryDetailService;
|
||||||
import org.dromara.gps.domain.vo.ConstructionUser;
|
|
||||||
import org.dromara.project.domain.BusAttendance;
|
import org.dromara.project.domain.BusAttendance;
|
||||||
import org.dromara.project.domain.BusProject;
|
import org.dromara.project.domain.BusProject;
|
||||||
import org.dromara.project.domain.BusProjectTeam;
|
import org.dromara.project.domain.BusProjectTeam;
|
||||||
@ -57,7 +48,6 @@ import org.dromara.project.service.IBusAttendanceService;
|
|||||||
import org.dromara.project.service.IBusProjectService;
|
import org.dromara.project.service.IBusProjectService;
|
||||||
import org.dromara.project.service.IBusProjectTeamService;
|
import org.dromara.project.service.IBusProjectTeamService;
|
||||||
import org.dromara.project.service.IBusWorkWageService;
|
import org.dromara.project.service.IBusWorkWageService;
|
||||||
import org.dromara.project.service.impl.BusProjectTeamServiceImpl;
|
|
||||||
import org.dromara.system.domain.vo.SysUserVo;
|
import org.dromara.system.domain.vo.SysUserVo;
|
||||||
import org.dromara.system.service.ISysUserService;
|
import org.dromara.system.service.ISysUserService;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
@ -66,7 +56,6 @@ import org.springframework.scheduling.annotation.Async;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import software.amazon.awssdk.utils.CollectionUtils;
|
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
@ -78,7 +67,6 @@ import java.time.format.DateTimeFormatter;
|
|||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import org.dromara.contractor.excel.SalaryExcelReader;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 员工每日工资Service业务层处理
|
* 员工每日工资Service业务层处理
|
||||||
|
|||||||
@ -0,0 +1,49 @@
|
|||||||
|
package org.dromara.dataTransmission.clarityPm.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 违规行为实体类
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ViolationRecord implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 摄像头设备序列号
|
||||||
|
*/
|
||||||
|
private String deviceSerial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 摄像头名称
|
||||||
|
*/
|
||||||
|
private String deviceName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 违规类型
|
||||||
|
* 1.未戴安全帽
|
||||||
|
* 2.未穿反光衣
|
||||||
|
* 3.吸烟
|
||||||
|
* 4.非授权人员闯入箱变/配电箱区域
|
||||||
|
*/
|
||||||
|
private String violationsType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 违规行为描述【几人未戴安全帽、几人抽烟 。。。】
|
||||||
|
*/
|
||||||
|
private String violationsInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 违规时间【yyyy-MM-dd HH:mm:ss】
|
||||||
|
*/
|
||||||
|
private String createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 违规图片【http地址,1张图片】
|
||||||
|
*/
|
||||||
|
private String imgPath;
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,15 +1,23 @@
|
|||||||
package org.dromara.dataTransmission.clarityPm.method;
|
package org.dromara.dataTransmission.clarityPm.method;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||||
|
import cn.hutool.core.lang.TypeReference;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
|
import org.dromara.common.core.utils.DateUtils;
|
||||||
import org.dromara.common.utils.IdCardEncryptorUtil;
|
import org.dromara.common.utils.IdCardEncryptorUtil;
|
||||||
import org.dromara.contractor.domain.SubConstructionUser;
|
import org.dromara.contractor.domain.SubConstructionUser;
|
||||||
import org.dromara.contractor.service.ISubConstructionUserFileService;
|
import org.dromara.contractor.service.ISubConstructionUserFileService;
|
||||||
import org.dromara.contractor.service.ISubConstructionUserService;
|
import org.dromara.contractor.service.ISubConstructionUserService;
|
||||||
import org.dromara.dataTransmission.clarityPm.dto.AttendanceRecord;
|
import org.dromara.dataTransmission.clarityPm.dto.AttendanceRecord;
|
||||||
import org.dromara.dataTransmission.clarityPm.dto.RealUser;
|
import org.dromara.dataTransmission.clarityPm.dto.RealUser;
|
||||||
|
import org.dromara.dataTransmission.clarityPm.dto.ViolationRecord;
|
||||||
|
import org.dromara.manager.recognizermanager.enums.RecognizerTypeEnum;
|
||||||
import org.dromara.project.domain.BusAttendance;
|
import org.dromara.project.domain.BusAttendance;
|
||||||
import org.dromara.project.service.IBusProjectTeamMemberService;
|
import org.dromara.project.service.IBusProjectTeamMemberService;
|
||||||
|
import org.dromara.safety.domain.HseRecognizeRecord;
|
||||||
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;
|
||||||
import org.springframework.context.annotation.Lazy;
|
import org.springframework.context.annotation.Lazy;
|
||||||
@ -20,7 +28,6 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
public class ClarityPmAsyncMethod {
|
public class ClarityPmAsyncMethod {
|
||||||
|
|
||||||
@ -118,6 +125,49 @@ public class ClarityPmAsyncMethod {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void transmitViolationRecord(List<HseRecognizeRecord> recognizeRecords) {
|
||||||
|
List<ViolationRecord> records = new ArrayList<>();
|
||||||
|
for (HseRecognizeRecord record : recognizeRecords) {
|
||||||
|
String violationType = record.getViolationType();
|
||||||
|
String[] typeList = violationType.split(",");
|
||||||
|
for (String type : typeList) {
|
||||||
|
ViolationRecord violationRecord = new ViolationRecord();
|
||||||
|
violationRecord.setDeviceSerial(record.getDeviceSerial());
|
||||||
|
violationRecord.setDeviceName(record.getDeviceName());
|
||||||
|
String violationsType = null;
|
||||||
|
switch (type) {
|
||||||
|
case "2", "3":
|
||||||
|
violationsType = "1";
|
||||||
|
break;
|
||||||
|
case "4":
|
||||||
|
violationsType = "2";
|
||||||
|
break;
|
||||||
|
case "5":
|
||||||
|
violationsType = "3";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
}
|
||||||
|
if(StrUtil.isBlank(violationsType)){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
violationRecord.setViolationsType(violationsType);
|
||||||
|
String description = RecognizerTypeEnum.fromCode(violationsType).getText();
|
||||||
|
violationRecord.setViolationsInfo(description);
|
||||||
|
violationRecord.setCreateTime(DateUtils.formatDateTime(record.getCreateTime()));
|
||||||
|
violationRecord.setImgPath(record.getPicture());
|
||||||
|
records.add(violationRecord);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CollectionUtil.isNotEmpty(records)) {
|
||||||
|
try {
|
||||||
|
ClarityPmClient.batchInsertViolationRecord(records);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import cn.hutool.json.JSONUtil;
|
|||||||
import org.dromara.dataTransmission.TokenUtils;
|
import org.dromara.dataTransmission.TokenUtils;
|
||||||
import org.dromara.dataTransmission.clarityPm.dto.AttendanceRecord;
|
import org.dromara.dataTransmission.clarityPm.dto.AttendanceRecord;
|
||||||
import org.dromara.dataTransmission.clarityPm.dto.RealUser;
|
import org.dromara.dataTransmission.clarityPm.dto.RealUser;
|
||||||
|
import org.dromara.dataTransmission.clarityPm.dto.ViolationRecord;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import cn.hutool.http.HttpUtil;
|
import cn.hutool.http.HttpUtil;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
@ -24,9 +25,7 @@ public class ClarityPmClient {
|
|||||||
|
|
||||||
private static final String INSERT_ATTENDANCE_RECORD_URL = "https://claritypm.powerchina.cn/neSmartsite-api/realUser/tiandong/insertAttendance";
|
private static final String INSERT_ATTENDANCE_RECORD_URL = "https://claritypm.powerchina.cn/neSmartsite-api/realUser/tiandong/insertAttendance";
|
||||||
|
|
||||||
|
private static final String INSERT_VIOLATION_RECORD_URL = "https://claritypm.powerchina.cn/neSmartsite-api/remote/violations/info/add/tiandong";
|
||||||
@Autowired
|
|
||||||
private TokenUtils tokenUtils; // 依赖之前的Token获取服务
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量新增实名制用户信息
|
* 批量新增实名制用户信息
|
||||||
@ -129,4 +128,58 @@ public class ClarityPmClient {
|
|||||||
throw new RuntimeException("批量新增考勤失败:" + msg + "(状态码:" + code + ")");
|
throw new RuntimeException("批量新增考勤失败:" + msg + "(状态码:" + code + ")");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量新增违规信息
|
||||||
|
* @param records 违规信息列表(建议单次不超过10条)
|
||||||
|
* @throws Exception 调用异常
|
||||||
|
*/
|
||||||
|
public static void batchInsertViolationRecord(List<ViolationRecord> records) throws Exception {
|
||||||
|
// 1. 校验列表大小(建议不超过10条)
|
||||||
|
if (records == null || records.isEmpty()) {
|
||||||
|
throw new IllegalArgumentException("违规列表不能为空");
|
||||||
|
}
|
||||||
|
if (records.size() > 10) {
|
||||||
|
throw new IllegalArgumentException("单次批量新增不能超过10条数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. 获取Token(从之前的TokenService获取)
|
||||||
|
String token = TokenUtils.getToken(TokenUtils.CLARITYPM);
|
||||||
|
if ( token.trim().isEmpty()) {
|
||||||
|
throw new RuntimeException("获取Token失败,无法调用接口");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. 构建请求头(包含Token认证)
|
||||||
|
Map<String, String> headers = new HashMap<>();
|
||||||
|
headers.put("Content-Type", "application/json; charset=UTF-8");
|
||||||
|
headers.put("User-Agent", "Mozilla/5.0");
|
||||||
|
headers.put("Accept", "application/json");
|
||||||
|
headers.put("Origin", "https://claritypm.powerchina.cn");
|
||||||
|
headers.put("Referer", "https://claritypm.powerchina.cn/");
|
||||||
|
headers.put("Authorization", "Bearer " + token); // 假设接口使用Bearer Token认证
|
||||||
|
|
||||||
|
// 4. 构建请求体(JSONArray格式)
|
||||||
|
JSONArray requestBody = JSONArray.parseArray(JSON.toJSONString(records));
|
||||||
|
String jsonBody = requestBody.toJSONString();
|
||||||
|
System.out.println("批量新增违规请求体:" + jsonBody);
|
||||||
|
|
||||||
|
// 5. 发送POST请求
|
||||||
|
String response = HttpUtil.createPost(INSERT_VIOLATION_RECORD_URL)
|
||||||
|
.addHeaders(headers)
|
||||||
|
.body(jsonBody)
|
||||||
|
.execute()
|
||||||
|
.body();
|
||||||
|
System.out.println("批量新增违规响应:" + response);
|
||||||
|
|
||||||
|
// 6. 解析响应(根据实际响应结构调整,此处假设与登录接口类似)
|
||||||
|
JSONObject responseJson = JSONUtil.parseObj(response);
|
||||||
|
int code = responseJson.getInt("code");
|
||||||
|
String msg = responseJson.getStr("msg");
|
||||||
|
if (code != 200) {
|
||||||
|
throw new RuntimeException("批量新增违规失败:" + msg + "(状态码:" + code + ")");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -384,13 +384,13 @@ public class DesTechnicalStandardServiceImpl extends ServiceImpl<DesTechnicalSta
|
|||||||
List<Tree<Long>> treeList = CollUtil.newArrayList();
|
List<Tree<Long>> treeList = CollUtil.newArrayList();
|
||||||
for (DesTechnicalStandard d : documentList) {
|
for (DesTechnicalStandard d : documentList) {
|
||||||
Long parentId = d.getPid();
|
Long parentId = d.getPid();
|
||||||
DesTechnicalStandard document = StreamUtils.findFirst(documentList, it -> Objects.equals(it.getId(), parentId));
|
DesTechnicalStandard document = StreamUtils.findFirst(documentList, it -> Objects.equals(it.getId(), parentId)).orElse(null);
|
||||||
if (ObjectUtil.isNull(document)) {
|
if (ObjectUtil.isNull(document)) {
|
||||||
List<Tree<Long>> trees = TreeBuildUtils.build(documentList, parentId, (desTechnicalStandard, tree) ->
|
List<Tree<Long>> trees = TreeBuildUtils.build(documentList, parentId, (desTechnicalStandard, tree) ->
|
||||||
tree.setId(desTechnicalStandard.getId())
|
tree.setId(desTechnicalStandard.getId())
|
||||||
.setParentId(desTechnicalStandard.getPid())
|
.setParentId(desTechnicalStandard.getPid())
|
||||||
.setName(desTechnicalStandard.getFileName()));
|
.setName(desTechnicalStandard.getFileName()));
|
||||||
Tree<Long> tree = StreamUtils.findFirst(trees, it -> Objects.equals(it.getId(), d.getId()));
|
Tree<Long> tree = StreamUtils.findFirst(trees, it -> Objects.equals(it.getId(), d.getId())).orElse(null);
|
||||||
treeList.add(tree);
|
treeList.add(tree);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,32 +1,33 @@
|
|||||||
package org.dromara.drone.controller;
|
package org.dromara.drone.controller;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
import jakarta.validation.constraints.*;
|
|
||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import org.dromara.common.log.annotation.Log;
|
import lombok.RequiredArgsConstructor;
|
||||||
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.domain.R;
|
||||||
import org.dromara.common.core.validate.AddGroup;
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
import org.dromara.common.core.validate.EditGroup;
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
import org.dromara.common.log.enums.BusinessType;
|
|
||||||
import org.dromara.common.excel.utils.ExcelUtil;
|
import org.dromara.common.excel.utils.ExcelUtil;
|
||||||
import org.dromara.drone.domain.vo.DroDroneBigPictureVo;
|
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||||
import org.dromara.drone.domain.bo.DroDroneBigPictureBo;
|
import org.dromara.common.log.annotation.Log;
|
||||||
import org.dromara.drone.service.IDroDroneBigPictureService;
|
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.mybatis.core.page.TableDataInfo;
|
||||||
|
import org.dromara.common.web.core.BaseController;
|
||||||
|
import org.dromara.drone.domain.bo.DroDroneBigPictureBo;
|
||||||
|
import org.dromara.drone.domain.vo.DroDroneBigPictureVo;
|
||||||
|
import org.dromara.drone.service.IDroDroneBigPictureService;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 无人机大图信息
|
* 无人机大图信息
|
||||||
*
|
*
|
||||||
* @author lilemy
|
* @author lilemy
|
||||||
* @date 2025-09-17
|
* @date 2025-11-15
|
||||||
*/
|
*/
|
||||||
@Validated
|
@Validated
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@ -90,6 +91,20 @@ public class DroDroneBigPictureController extends BaseController {
|
|||||||
return toAjax(droDroneBigPictureService.updateByBo(bo));
|
return toAjax(droDroneBigPictureService.updateByBo(bo));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建识别进度
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("drone:droneBigPicture:add")
|
||||||
|
@Log(title = "无人机大图信息", businessType = BusinessType.OTHER)
|
||||||
|
@RepeatSubmit
|
||||||
|
@PostMapping("/createProgressRecognize/{id}")
|
||||||
|
public R<Void> createProgressRecognize(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable Long id) {
|
||||||
|
return toAjax(droDroneBigPictureService.createProgressRecognize(id));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除无人机大图信息
|
* 删除无人机大图信息
|
||||||
*
|
*
|
||||||
@ -100,6 +115,6 @@ public class DroDroneBigPictureController extends BaseController {
|
|||||||
@DeleteMapping("/{ids}")
|
@DeleteMapping("/{ids}")
|
||||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
@PathVariable Long[] ids) {
|
@PathVariable Long[] ids) {
|
||||||
return toAjax(droDroneBigPictureService.deleteWithValidByIds(List.of(ids), true));
|
return toAjax(droDroneBigPictureService.deleteByIds(List.of(ids)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,20 +3,21 @@ package org.dromara.drone.domain;
|
|||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 无人机大图信息对象 dro_drone_big_picture
|
* 无人机大图信息对象 dro_drone_big_picture
|
||||||
*
|
*
|
||||||
* @author lilemy
|
* @author lilemy
|
||||||
* @date 2025-09-17
|
* @date 2025-11-15
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@TableName("dro_drone_big_picture")
|
@TableName("dro_drone_big_picture")
|
||||||
public class DroDroneBigPicture implements Serializable {
|
public class DroDroneBigPicture extends BaseEntity {
|
||||||
|
|
||||||
@Serial
|
@Serial
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@ -32,44 +33,54 @@ public class DroDroneBigPicture implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private Long projectId;
|
private Long projectId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务ID
|
||||||
|
*/
|
||||||
|
private String taskId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务名称
|
||||||
|
*/
|
||||||
|
private String taskName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小图片列表
|
||||||
|
*/
|
||||||
|
private String smallPic;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 压缩图片
|
||||||
|
*/
|
||||||
|
private String compressPic;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 大图
|
* 大图
|
||||||
*/
|
*/
|
||||||
private Long bigPic;
|
private String bigPic;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 识别结果图片
|
* 识别结果图片
|
||||||
*/
|
*/
|
||||||
private Long recognizePic;
|
private Long recognizePic;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 识别结果
|
||||||
|
*/
|
||||||
|
private String recognizeResult;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* tif文件
|
* tif文件
|
||||||
*/
|
*/
|
||||||
private Long tifFile;
|
private String tifFile;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 识别信息
|
* 状态
|
||||||
*/
|
*/
|
||||||
private String recognizeMessage;
|
private String status;
|
||||||
|
|
||||||
/**
|
|
||||||
* 坐标信息
|
|
||||||
*/
|
|
||||||
private String coordinateMessage;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建时间
|
|
||||||
*/
|
|
||||||
private Date createTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新时间
|
|
||||||
*/
|
|
||||||
private Date updateTime;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,26 +1,30 @@
|
|||||||
package org.dromara.drone.domain.bo;
|
package org.dromara.drone.domain.bo;
|
||||||
|
|
||||||
import io.github.linpeilie.annotations.AutoMapper;
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
import org.dromara.common.core.validate.EditGroup;
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
import org.dromara.drone.domain.DroDroneBigPicture;
|
import org.dromara.drone.domain.DroDroneBigPicture;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 无人机大图信息业务对象 dro_drone_big_picture
|
* 无人机大图信息业务对象 dro_drone_big_picture
|
||||||
*
|
*
|
||||||
* @author lilemy
|
* @author lilemy
|
||||||
* @date 2025-09-17
|
* @date 2025-11-15
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@AutoMapper(target = DroDroneBigPicture.class, reverseConvertGenerate = false)
|
@AutoMapper(target = DroDroneBigPicture.class, reverseConvertGenerate = false)
|
||||||
public class DroDroneBigPictureBo implements Serializable {
|
public class DroDroneBigPictureBo extends BaseEntity {
|
||||||
|
|
||||||
@Serial
|
@Serial
|
||||||
private static final long serialVersionUID = -2648698305265339936L;
|
private static final long serialVersionUID = 1498586685367891721L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主键ID
|
* 主键ID
|
||||||
@ -31,9 +35,50 @@ public class DroDroneBigPictureBo implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 项目ID
|
* 项目ID
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "项目ID不能为空", groups = {EditGroup.class})
|
@NotNull(message = "项目ID不能为空", groups = {AddGroup.class})
|
||||||
private Long projectId;
|
private Long projectId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务ID
|
||||||
|
*/
|
||||||
|
private String taskId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务名称
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "任务名称不能为空", groups = {AddGroup.class})
|
||||||
|
private String taskName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小图片列表
|
||||||
|
*/
|
||||||
|
private String smallPic;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 压缩图片
|
||||||
|
*/
|
||||||
|
private String compressPic;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 大图
|
||||||
|
*/
|
||||||
|
private String bigPic;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 识别结果图片
|
||||||
|
*/
|
||||||
|
private Long recognizePic;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* tif文件
|
||||||
|
*/
|
||||||
|
private String tifFile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -0,0 +1,27 @@
|
|||||||
|
package org.dromara.drone.domain.bo;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lilemy
|
||||||
|
* @date 2025-11-17 19:59
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class DroDroneBigPictureProgressVo {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 进度
|
||||||
|
*/
|
||||||
|
private BigDecimal progress;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
}
|
||||||
@ -1,26 +1,23 @@
|
|||||||
package org.dromara.drone.domain.vo;
|
package org.dromara.drone.domain.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
|
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 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.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 无人机大图信息视图对象 dro_drone_big_picture
|
* 无人机大图信息视图对象 dro_drone_big_picture
|
||||||
*
|
*
|
||||||
* @author lilemy
|
* @author lilemy
|
||||||
* @date 2025-09-17
|
* @date 2025-11-15
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@ExcelIgnoreUnannotated
|
@ExcelIgnoreUnannotated
|
||||||
@ -42,28 +39,58 @@ public class DroDroneBigPictureVo implements Serializable {
|
|||||||
@ExcelProperty(value = "项目ID")
|
@ExcelProperty(value = "项目ID")
|
||||||
private Long projectId;
|
private Long projectId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务ID
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "任务ID")
|
||||||
|
private String taskId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务名称
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "任务名称")
|
||||||
|
private String taskName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 压缩图片
|
||||||
|
*/
|
||||||
|
private String compressPic;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小图片列表 Url
|
||||||
|
*/
|
||||||
|
@Translation(type = TransConstant.OSS_ID_TO_URL, mapper = "compressPic")
|
||||||
|
private String compressPicList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小图片列表
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "小图片列表")
|
||||||
|
private String smallPic;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小图片列表 Url
|
||||||
|
*/
|
||||||
|
@Translation(type = TransConstant.OSS_ID_TO_URL, mapper = "smallPic")
|
||||||
|
private String smallPicList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 大图
|
* 大图
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "大图")
|
@ExcelProperty(value = "大图")
|
||||||
private String bigPic;
|
private String bigPic;
|
||||||
|
|
||||||
/**
|
|
||||||
* 大图Url
|
|
||||||
*/
|
|
||||||
@Translation(type = TransConstant.OSS_ID_TO_URL, mapper = "bigPic")
|
|
||||||
private String bigPicUrl;
|
|
||||||
/**
|
/**
|
||||||
* 识别结果图片
|
* 识别结果图片
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "识别结果图片")
|
@ExcelProperty(value = "识别结果图片")
|
||||||
private String recognizePic;
|
private Long recognizePic;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 识别结果图片Url
|
* 识别结果
|
||||||
*/
|
*/
|
||||||
@Translation(type = TransConstant.OSS_ID_TO_URL, mapper = "recognizePic")
|
private String recognizeResult;
|
||||||
private String recognizePicUrl;
|
|
||||||
/**
|
/**
|
||||||
* tif文件
|
* tif文件
|
||||||
*/
|
*/
|
||||||
@ -71,16 +98,10 @@ public class DroDroneBigPictureVo implements Serializable {
|
|||||||
private String tifFile;
|
private String tifFile;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 识别信息
|
* 状态
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "识别信息")
|
@ExcelProperty(value = "状态")
|
||||||
private String recognizeMessage;
|
private String status;
|
||||||
|
|
||||||
/**
|
|
||||||
* 坐标信息
|
|
||||||
*/
|
|
||||||
@ExcelProperty(value = "坐标信息")
|
|
||||||
private String coordinateMessage;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
@ -88,5 +109,9 @@ public class DroDroneBigPictureVo implements Serializable {
|
|||||||
@ExcelProperty(value = "备注")
|
@ExcelProperty(value = "备注")
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 进度
|
||||||
|
*/
|
||||||
|
private BigDecimal progress;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,7 +8,7 @@ import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
|||||||
* 无人机大图信息Mapper接口
|
* 无人机大图信息Mapper接口
|
||||||
*
|
*
|
||||||
* @author lilemy
|
* @author lilemy
|
||||||
* @date 2025-09-17
|
* @date 2025-11-15
|
||||||
*/
|
*/
|
||||||
public interface DroDroneBigPictureMapper extends BaseMapperPlus<DroDroneBigPicture, DroDroneBigPictureVo> {
|
public interface DroDroneBigPictureMapper extends BaseMapperPlus<DroDroneBigPicture, DroDroneBigPictureVo> {
|
||||||
|
|
||||||
|
|||||||
@ -5,16 +5,18 @@ import org.dromara.common.mybatis.core.page.PageQuery;
|
|||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
import org.dromara.drone.domain.DroDroneBigPicture;
|
import org.dromara.drone.domain.DroDroneBigPicture;
|
||||||
import org.dromara.drone.domain.bo.DroDroneBigPictureBo;
|
import org.dromara.drone.domain.bo.DroDroneBigPictureBo;
|
||||||
|
import org.dromara.drone.domain.bo.DroDroneBigPictureProgressVo;
|
||||||
import org.dromara.drone.domain.vo.DroDroneBigPictureVo;
|
import org.dromara.drone.domain.vo.DroDroneBigPictureVo;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 无人机大图信息Service接口
|
* 无人机大图信息Service接口
|
||||||
*
|
*
|
||||||
* @author lilemy
|
* @author lilemy
|
||||||
* @date 2025-09-17
|
* @date 2025-11-15
|
||||||
*/
|
*/
|
||||||
public interface IDroDroneBigPictureService extends IService<DroDroneBigPicture> {
|
public interface IDroDroneBigPictureService extends IService<DroDroneBigPicture> {
|
||||||
|
|
||||||
@ -60,11 +62,58 @@ public interface IDroDroneBigPictureService extends IService<DroDroneBigPicture>
|
|||||||
Boolean updateByBo(DroDroneBigPictureBo bo);
|
Boolean updateByBo(DroDroneBigPictureBo bo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验并批量删除无人机大图信息信息
|
* 创建识别进度
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
* @return 是否创建成功
|
||||||
|
*/
|
||||||
|
Boolean createProgressRecognize(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除无人机大图信息信息
|
||||||
*
|
*
|
||||||
* @param ids 待删除的主键集合
|
* @param ids 待删除的主键集合
|
||||||
* @param isValid 是否进行有效性校验
|
|
||||||
* @return 是否删除成功
|
* @return 是否删除成功
|
||||||
*/
|
*/
|
||||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
Boolean deleteByIds(Collection<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否合成完成
|
||||||
|
*
|
||||||
|
* @param picture 大图信息
|
||||||
|
*/
|
||||||
|
DroDroneBigPictureProgressVo isSynthesisCompleted(DroDroneBigPicture picture);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否合成完成
|
||||||
|
*
|
||||||
|
* @param pictureVo 大图信息
|
||||||
|
*/
|
||||||
|
DroDroneBigPictureProgressVo isSynthesisCompleted(DroDroneBigPictureVo pictureVo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 压缩图片
|
||||||
|
*
|
||||||
|
* @param ossIds 图片对象存储Ids
|
||||||
|
* @param compressPicIds 压缩后图片Ids
|
||||||
|
* @return 是否成功
|
||||||
|
*/
|
||||||
|
Boolean compressPicture(String ossIds, List<Long> compressPicIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 异步添加压缩图片
|
||||||
|
*
|
||||||
|
* @param smallPic 压缩图片
|
||||||
|
* @return 是否成功
|
||||||
|
*/
|
||||||
|
CompletableFuture<Boolean> asyncAddCompressPicture(String smallPic, List<Long> compressPicIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 异步更新压缩图片
|
||||||
|
*
|
||||||
|
* @param pic 图片
|
||||||
|
* @param oldPic 旧图片
|
||||||
|
* @return 是否成功
|
||||||
|
*/
|
||||||
|
CompletableFuture<Boolean> asyncUpdateCompressPicture(DroDroneBigPicture pic, DroDroneBigPicture oldPic);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,34 +1,76 @@
|
|||||||
package org.dromara.drone.service.impl;
|
package org.dromara.drone.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.convert.Convert;
|
||||||
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;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.dromara.common.core.exception.ServiceException;
|
||||||
import org.dromara.common.core.utils.MapstructUtils;
|
import org.dromara.common.core.utils.MapstructUtils;
|
||||||
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
|
import org.dromara.common.domain.WebpConverterStreamVo;
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
|
import org.dromara.common.oss.core.OssClient;
|
||||||
|
import org.dromara.common.oss.factory.OssFactory;
|
||||||
|
import org.dromara.common.utils.WebpConverterUtil;
|
||||||
import org.dromara.drone.domain.DroDroneBigPicture;
|
import org.dromara.drone.domain.DroDroneBigPicture;
|
||||||
import org.dromara.drone.domain.bo.DroDroneBigPictureBo;
|
import org.dromara.drone.domain.bo.DroDroneBigPictureBo;
|
||||||
|
import org.dromara.drone.domain.bo.DroDroneBigPictureProgressVo;
|
||||||
import org.dromara.drone.domain.vo.DroDroneBigPictureVo;
|
import org.dromara.drone.domain.vo.DroDroneBigPictureVo;
|
||||||
import org.dromara.drone.mapper.DroDroneBigPictureMapper;
|
import org.dromara.drone.mapper.DroDroneBigPictureMapper;
|
||||||
import org.dromara.drone.service.IDroDroneBigPictureService;
|
import org.dromara.drone.service.IDroDroneBigPictureService;
|
||||||
|
import org.dromara.manager.dronemanager.DroneManager;
|
||||||
|
import org.dromara.manager.dronemanager.vo.DroneImgMergeProgressVo;
|
||||||
|
import org.dromara.manager.dronemanager.vo.DroneImgMergeUrlVo;
|
||||||
|
import org.dromara.progress.domain.dto.progressplandetail.PgsProgressPlanDetailAINumberReq;
|
||||||
|
import org.dromara.progress.service.IPgsProgressPlanDetailService;
|
||||||
|
import org.dromara.system.domain.vo.SysOssVo;
|
||||||
|
import org.dromara.system.service.ISysOssService;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.context.annotation.Lazy;
|
||||||
|
import org.springframework.scheduling.annotation.Async;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.io.IOException;
|
||||||
import java.util.List;
|
import java.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
|
import java.net.URISyntaxException;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 无人机大图信息Service业务层处理
|
* 无人机大图信息Service业务层处理
|
||||||
*
|
*
|
||||||
* @author lilemy
|
* @author lilemy
|
||||||
* @date 2025-09-17
|
* @date 2025-11-15
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@Service
|
@Service
|
||||||
public class DroDroneBigPictureServiceImpl extends ServiceImpl<DroDroneBigPictureMapper, DroDroneBigPicture>
|
public class DroDroneBigPictureServiceImpl extends ServiceImpl<DroDroneBigPictureMapper, DroDroneBigPicture>
|
||||||
implements IDroDroneBigPictureService {
|
implements IDroDroneBigPictureService {
|
||||||
|
|
||||||
|
@Lazy
|
||||||
|
@Resource
|
||||||
|
private IPgsProgressPlanDetailService progressPlanDetailService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private DroneManager droneManager;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ISysOssService ossService;
|
||||||
|
|
||||||
|
@Lazy
|
||||||
|
@Resource
|
||||||
|
private IDroDroneBigPictureService self;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询无人机大图信息
|
* 查询无人机大图信息
|
||||||
*
|
*
|
||||||
@ -37,7 +79,24 @@ public class DroDroneBigPictureServiceImpl extends ServiceImpl<DroDroneBigPictur
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public DroDroneBigPictureVo queryById(Long id) {
|
public DroDroneBigPictureVo queryById(Long id) {
|
||||||
return baseMapper.selectVoById(id);
|
DroDroneBigPictureVo pictureVo = baseMapper.selectVoById(id);
|
||||||
|
if (pictureVo != null) {
|
||||||
|
try {
|
||||||
|
DroDroneBigPictureProgressVo progressVo = this.isSynthesisCompleted(pictureVo);
|
||||||
|
if (progressVo != null) {
|
||||||
|
if (StringUtils.isNotBlank(progressVo.getStatus())) {
|
||||||
|
pictureVo.setStatus(progressVo.getStatus());
|
||||||
|
}
|
||||||
|
BigDecimal p = progressVo.getProgress()
|
||||||
|
.multiply(new BigDecimal("100"));
|
||||||
|
pictureVo.setProgress(p.compareTo(BigDecimal.valueOf(100)) == 0 ?
|
||||||
|
BigDecimal.valueOf(100) : p.setScale(4, RoundingMode.HALF_UP));
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("查询图片合成进度异常", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return pictureVo;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -51,6 +110,29 @@ public class DroDroneBigPictureServiceImpl extends ServiceImpl<DroDroneBigPictur
|
|||||||
public TableDataInfo<DroDroneBigPictureVo> queryPageList(DroDroneBigPictureBo bo, PageQuery pageQuery) {
|
public TableDataInfo<DroDroneBigPictureVo> queryPageList(DroDroneBigPictureBo bo, PageQuery pageQuery) {
|
||||||
LambdaQueryWrapper<DroDroneBigPicture> lqw = buildQueryWrapper(bo);
|
LambdaQueryWrapper<DroDroneBigPicture> lqw = buildQueryWrapper(bo);
|
||||||
Page<DroDroneBigPictureVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
Page<DroDroneBigPictureVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
|
List<DroDroneBigPictureVo> records = result.getRecords();
|
||||||
|
if (CollUtil.isNotEmpty(records)) {
|
||||||
|
// 处理数据,判断合成中的图片是否完成合成
|
||||||
|
for (DroDroneBigPictureVo pictureVo : records) {
|
||||||
|
try {
|
||||||
|
DroDroneBigPictureProgressVo progressVo = this.isSynthesisCompleted(pictureVo);
|
||||||
|
if (progressVo != null) {
|
||||||
|
if (StringUtils.isNotBlank(progressVo.getStatus())) {
|
||||||
|
pictureVo.setStatus(progressVo.getStatus());
|
||||||
|
}
|
||||||
|
BigDecimal p = progressVo.getProgress()
|
||||||
|
.multiply(new BigDecimal("100"));
|
||||||
|
pictureVo.setProgress(p.compareTo(BigDecimal.valueOf(100)) == 0 ?
|
||||||
|
BigDecimal.valueOf(100) : p.setScale(4, RoundingMode.HALF_UP));
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
pictureVo.setStatus("4");
|
||||||
|
pictureVo.setRemark(e.getMessage());
|
||||||
|
log.error("查询图片合成进度异常", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
result.setRecords(records);
|
||||||
return TableDataInfo.build(result);
|
return TableDataInfo.build(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -70,6 +152,12 @@ public class DroDroneBigPictureServiceImpl extends ServiceImpl<DroDroneBigPictur
|
|||||||
LambdaQueryWrapper<DroDroneBigPicture> lqw = Wrappers.lambdaQuery();
|
LambdaQueryWrapper<DroDroneBigPicture> lqw = Wrappers.lambdaQuery();
|
||||||
lqw.orderByDesc(DroDroneBigPicture::getId);
|
lqw.orderByDesc(DroDroneBigPicture::getId);
|
||||||
lqw.eq(bo.getProjectId() != null, DroDroneBigPicture::getProjectId, bo.getProjectId());
|
lqw.eq(bo.getProjectId() != null, DroDroneBigPicture::getProjectId, bo.getProjectId());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getTaskName()), DroDroneBigPicture::getTaskName, bo.getTaskName());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getSmallPic()), DroDroneBigPicture::getSmallPic, bo.getSmallPic());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getBigPic()), DroDroneBigPicture::getBigPic, bo.getBigPic());
|
||||||
|
lqw.eq(bo.getRecognizePic() != null, DroDroneBigPicture::getRecognizePic, bo.getRecognizePic());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getTifFile()), DroDroneBigPicture::getTifFile, bo.getTifFile());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), DroDroneBigPicture::getStatus, bo.getStatus());
|
||||||
return lqw;
|
return lqw;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,12 +170,33 @@ public class DroDroneBigPictureServiceImpl extends ServiceImpl<DroDroneBigPictur
|
|||||||
@Override
|
@Override
|
||||||
public Boolean insertByBo(DroDroneBigPictureBo bo) {
|
public Boolean insertByBo(DroDroneBigPictureBo bo) {
|
||||||
DroDroneBigPicture add = MapstructUtils.convert(bo, DroDroneBigPicture.class);
|
DroDroneBigPicture add = MapstructUtils.convert(bo, DroDroneBigPicture.class);
|
||||||
validEntityBeforeSave(add);
|
if (add == null) {
|
||||||
boolean flag = baseMapper.insert(add) > 0;
|
return false;
|
||||||
if (flag) {
|
|
||||||
bo.setId(add.getId());
|
|
||||||
}
|
}
|
||||||
return flag;
|
boolean save = this.save(add);
|
||||||
|
if (!save) {
|
||||||
|
throw new ServiceException("新增无人机大图信息失败");
|
||||||
|
}
|
||||||
|
// 压缩图片
|
||||||
|
String smallPic = add.getSmallPic();
|
||||||
|
if (StringUtils.isNotBlank(smallPic)) {
|
||||||
|
List<Long> compressPictureIds = new ArrayList<>();
|
||||||
|
// 异步执行数据同步
|
||||||
|
self.asyncAddCompressPicture(smallPic, compressPictureIds)
|
||||||
|
.thenAccept(result -> {
|
||||||
|
String ossIds = compressPictureIds.stream()
|
||||||
|
.map(String::valueOf)
|
||||||
|
.collect(Collectors.joining(","));
|
||||||
|
DroDroneBigPicture update = new DroDroneBigPicture();
|
||||||
|
update.setId(add.getId());
|
||||||
|
update.setCompressPic(ossIds);
|
||||||
|
this.updateById(update);
|
||||||
|
}).exceptionally(ex -> {
|
||||||
|
log.error("无人机大图信息[{}]异步执行压缩图片失败", add.getTaskName(), ex);
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -97,31 +206,314 @@ public class DroDroneBigPictureServiceImpl extends ServiceImpl<DroDroneBigPictur
|
|||||||
* @return 是否修改成功
|
* @return 是否修改成功
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean updateByBo(DroDroneBigPictureBo bo) {
|
public Boolean updateByBo(DroDroneBigPictureBo bo) {
|
||||||
DroDroneBigPicture update = MapstructUtils.convert(bo, DroDroneBigPicture.class);
|
DroDroneBigPicture update = MapstructUtils.convert(bo, DroDroneBigPicture.class);
|
||||||
validEntityBeforeSave(update);
|
if (update == null) {
|
||||||
return baseMapper.updateById(update) > 0;
|
return false;
|
||||||
|
}
|
||||||
|
// 更新数据
|
||||||
|
boolean b = this.updateById(update);
|
||||||
|
if (!b) {
|
||||||
|
throw new ServiceException("修改无人机大图信息失败");
|
||||||
|
}
|
||||||
|
// 获取老数据
|
||||||
|
DroDroneBigPicture old = this.getById(update.getId());
|
||||||
|
self.asyncUpdateCompressPicture(update, old)
|
||||||
|
.thenAccept(result -> log.info("无人机大图信息[{}]异步执行压缩图片成功", update.getTaskName()))
|
||||||
|
.exceptionally(ex -> {
|
||||||
|
log.error("无人机大图信息[{}]异步执行压缩图片失败", update.getTaskName(), ex);
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存前的数据校验
|
* 创建识别进度
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
* @return 是否创建成功
|
||||||
*/
|
*/
|
||||||
private void validEntityBeforeSave(DroDroneBigPicture entity) {
|
@Override
|
||||||
//TODO 做一些数据校验,如唯一约束
|
public Boolean createProgressRecognize(Long id) {
|
||||||
|
DroDroneBigPicture bigPicture = this.getById(id);
|
||||||
|
if (bigPicture == null) {
|
||||||
|
throw new ServiceException("无人机大图数据不存在");
|
||||||
|
}
|
||||||
|
// 判断当前状态是否可以进行识别
|
||||||
|
String status = bigPicture.getStatus();
|
||||||
|
if (!"3".equals(status) && !"7".equals(status)) {
|
||||||
|
throw new ServiceException("当前状态无法进行识别");
|
||||||
|
}
|
||||||
|
String fileUrl;
|
||||||
|
String tifUrl;
|
||||||
|
String taskId = bigPicture.getTaskId();
|
||||||
|
// 获取识别图片地址
|
||||||
|
if (StringUtils.isNotBlank(taskId)) {
|
||||||
|
DroneImgMergeUrlVo mergeUrlVo = droneManager.getMergedFileUrl(taskId);
|
||||||
|
fileUrl = mergeUrlVo.getPngUrl();
|
||||||
|
tifUrl = mergeUrlVo.getTifUrl();
|
||||||
|
} else {
|
||||||
|
fileUrl = bigPicture.getBigPic();
|
||||||
|
tifUrl = bigPicture.getTifFile();
|
||||||
|
}
|
||||||
|
// 创建进度识别
|
||||||
|
PgsProgressPlanDetailAINumberReq ai = new PgsProgressPlanDetailAINumberReq();
|
||||||
|
ai.setFileUrl(fileUrl);
|
||||||
|
ai.setTifUrl(tifUrl);
|
||||||
|
ai.setProjectId(bigPicture.getProjectId());
|
||||||
|
Boolean b = progressPlanDetailService.insertNumberDetailByAI(ai, bigPicture);
|
||||||
|
if (!b) {
|
||||||
|
throw new ServiceException("创建识别进度失败");
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验并批量删除无人机大图信息信息
|
* 批量删除无人机大图信息信息
|
||||||
*
|
*
|
||||||
* @param ids 待删除的主键集合
|
* @param ids 待删除的主键集合
|
||||||
* @param isValid 是否进行有效性校验
|
|
||||||
* @return 是否删除成功
|
* @return 是否删除成功
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
@Transactional(rollbackFor = Exception.class)
|
||||||
if (isValid) {
|
public Boolean deleteByIds(Collection<Long> ids) {
|
||||||
//TODO 做一些业务上的校验,判断是否需要校验
|
if (CollUtil.isEmpty(ids)) {
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
return baseMapper.deleteByIds(ids) > 0;
|
// 获取待删除数据
|
||||||
|
List<DroDroneBigPicture> list = this.listByIds(ids);
|
||||||
|
if (CollUtil.isEmpty(list)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// 获取所有待删除的文件
|
||||||
|
Set<Long> smallPics = list.stream()
|
||||||
|
.map(DroDroneBigPicture::getSmallPic)
|
||||||
|
.filter(StringUtils::isNotBlank)
|
||||||
|
.flatMap(str -> Arrays.stream(StringUtils.split(str, ",")))
|
||||||
|
.filter(StringUtils::isNotBlank)
|
||||||
|
.map(String::trim)
|
||||||
|
.map(Long::valueOf)
|
||||||
|
.collect(Collectors.toSet());
|
||||||
|
Set<Long> compressPics = list.stream()
|
||||||
|
.map(DroDroneBigPicture::getCompressPic)
|
||||||
|
.filter(StringUtils::isNotBlank)
|
||||||
|
.flatMap(str -> Arrays.stream(StringUtils.split(str, ",")))
|
||||||
|
.filter(StringUtils::isNotBlank)
|
||||||
|
.map(String::trim)
|
||||||
|
.map(Long::valueOf)
|
||||||
|
.collect(Collectors.toSet());
|
||||||
|
Set<Long> recognizePics = list.stream()
|
||||||
|
.map(DroDroneBigPicture::getRecognizePic)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.collect(Collectors.toSet());
|
||||||
|
Set<Long> allPics = new HashSet<>();
|
||||||
|
allPics.addAll(smallPics);
|
||||||
|
allPics.addAll(compressPics);
|
||||||
|
allPics.addAll(recognizePics);
|
||||||
|
if (CollUtil.isNotEmpty(allPics)) {
|
||||||
|
Boolean b = ossService.deleteWithValidByIds(allPics, false);
|
||||||
|
if (!b) {
|
||||||
|
throw new ServiceException("图片删除异常");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return this.removeBatchByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否合成完成
|
||||||
|
*
|
||||||
|
* @param picture 大图信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public DroDroneBigPictureProgressVo isSynthesisCompleted(DroDroneBigPicture picture) {
|
||||||
|
DroDroneBigPictureProgressVo vo = new DroDroneBigPictureProgressVo();
|
||||||
|
String newStatus = "";
|
||||||
|
vo.setProgress(BigDecimal.ZERO);
|
||||||
|
vo.setStatus(newStatus);
|
||||||
|
String status = picture.getStatus();
|
||||||
|
String taskId = picture.getTaskId();
|
||||||
|
if (status.equals("3") || status.equals("7") || status.equals("5") || status.equals("6")) {
|
||||||
|
vo.setProgress(BigDecimal.ONE);
|
||||||
|
}
|
||||||
|
if (taskId == null) {
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
if (!status.equals("2")) {
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
DroneImgMergeProgressVo imgMergeProgress = droneManager.getImgMergeProgress(taskId);
|
||||||
|
if (imgMergeProgress == null) {
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
vo.setProgress(imgMergeProgress.getMsg());
|
||||||
|
BigDecimal msg = imgMergeProgress.getMsg();
|
||||||
|
if (msg != null && msg.compareTo(BigDecimal.ONE) == 0) {
|
||||||
|
newStatus = "3";
|
||||||
|
picture.setStatus(newStatus);
|
||||||
|
} else if (msg != null && msg.compareTo(BigDecimal.ZERO) >= 0 && msg.compareTo(BigDecimal.ONE) < 0) {
|
||||||
|
return vo;
|
||||||
|
} else {
|
||||||
|
newStatus = "4";
|
||||||
|
picture.setStatus(newStatus);
|
||||||
|
}
|
||||||
|
// 修改状态
|
||||||
|
boolean b = this.updateById(picture);
|
||||||
|
if (!b) {
|
||||||
|
log.error("修改无人机大图信息状态失败");
|
||||||
|
}
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否合成完成
|
||||||
|
*
|
||||||
|
* @param pictureVo 大图信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public DroDroneBigPictureProgressVo isSynthesisCompleted(DroDroneBigPictureVo pictureVo) {
|
||||||
|
DroDroneBigPicture picture = new DroDroneBigPicture();
|
||||||
|
BeanUtils.copyProperties(pictureVo, picture);
|
||||||
|
return this.isSynthesisCompleted(picture);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 压缩图片
|
||||||
|
*
|
||||||
|
* @param ossIds 图片对象存储Ids
|
||||||
|
* @param compressPicIds 压缩后图片Ids
|
||||||
|
* @return 是否成功
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean compressPicture(String ossIds, List<Long> compressPicIds) {
|
||||||
|
if (StringUtils.isBlank(ossIds)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// 获取图片地址
|
||||||
|
List<Long> ids = StringUtils.splitTo(ossIds, Convert::toLong);
|
||||||
|
List<SysOssVo> ossVos = ossService.listByIds(ids);
|
||||||
|
// 根据图片地址压缩图片
|
||||||
|
final float quality = 0.6f;
|
||||||
|
for (SysOssVo ossVo : ossVos) {
|
||||||
|
try {
|
||||||
|
OssClient ossClient = OssFactory.instance(ossVo.getService());
|
||||||
|
String filePath = ossClient.getPath(null, ".webp");
|
||||||
|
// 压缩图片
|
||||||
|
WebpConverterStreamVo fileStream = WebpConverterUtil.convertUrlToWebpStream(ossVo.getUrl(), quality,
|
||||||
|
1080, 0);
|
||||||
|
// 上传图片
|
||||||
|
SysOssVo upload = ossService.upload(fileStream.getInputStream(),
|
||||||
|
filePath, fileStream.getContentType(), fileStream.getLength());
|
||||||
|
compressPicIds.add(upload.getOssId());
|
||||||
|
} catch (IOException | URISyntaxException e) {
|
||||||
|
log.error("压缩图片失败", e);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 异步添加压缩图片
|
||||||
|
*
|
||||||
|
* @param smallPic 待压缩图片
|
||||||
|
* @param compressPicIds 压缩后的图片
|
||||||
|
* @return 是否成功
|
||||||
|
*/
|
||||||
|
@Async
|
||||||
|
@Override
|
||||||
|
public CompletableFuture<Boolean> asyncAddCompressPicture(String smallPic, List<Long> compressPicIds) {
|
||||||
|
int maxRetry = 3; // 最大重试次数
|
||||||
|
long delayMillis = 1000; // 每次重试间隔(1秒)
|
||||||
|
for (int attempt = 1; attempt <= maxRetry; attempt++) {
|
||||||
|
try {
|
||||||
|
Boolean success = this.compressPicture(smallPic, compressPicIds);
|
||||||
|
if (Boolean.TRUE.equals(success)) {
|
||||||
|
return CompletableFuture.completedFuture(true);
|
||||||
|
}
|
||||||
|
log.warn("压缩失败,第 {} 次重试...", attempt);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("压缩异常,第 {} 次重试,error={}", attempt, e.getMessage());
|
||||||
|
}
|
||||||
|
// 不是最后一次则等待
|
||||||
|
if (attempt < maxRetry) {
|
||||||
|
try {
|
||||||
|
Thread.sleep(delayMillis);
|
||||||
|
} catch (InterruptedException ignored) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
log.error("压缩图片最终失败,smallPic={}, compressPicIds={}", smallPic, compressPicIds);
|
||||||
|
return CompletableFuture.completedFuture(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 异步更新压缩图片
|
||||||
|
*
|
||||||
|
* @param pic 图片
|
||||||
|
* @param oldPic 旧图片
|
||||||
|
* @return 是否成功
|
||||||
|
*/
|
||||||
|
@Async
|
||||||
|
@Override
|
||||||
|
public CompletableFuture<Boolean> asyncUpdateCompressPicture(DroDroneBigPicture pic, DroDroneBigPicture oldPic) {
|
||||||
|
String smallPic = pic.getSmallPic();
|
||||||
|
String oldSmallPic = oldPic.getSmallPic();
|
||||||
|
if (StringUtils.isNotBlank(oldSmallPic) && StringUtils.isNotBlank(smallPic)) {
|
||||||
|
if (!this.isSameIds(oldSmallPic, smallPic)) {
|
||||||
|
List<Long> list = StringUtils.splitTo(oldPic.getCompressPic(), Convert::toLong);
|
||||||
|
Boolean b = ossService.deleteWithValidByIds(list, false);
|
||||||
|
if (!b) {
|
||||||
|
throw new ServiceException("图片删除异常");
|
||||||
|
}
|
||||||
|
List<Long> compressPictureIds = new ArrayList<>();
|
||||||
|
b = this.compressPicture(smallPic, compressPictureIds);
|
||||||
|
if (!b) {
|
||||||
|
throw new ServiceException("图片压缩异常");
|
||||||
|
}
|
||||||
|
String result = compressPictureIds.stream()
|
||||||
|
.map(String::valueOf)
|
||||||
|
.collect(Collectors.joining(","));
|
||||||
|
pic.setCompressPic(result);
|
||||||
|
}
|
||||||
|
} else if (StringUtils.isNotBlank(smallPic) && StringUtils.isBlank(oldSmallPic)) {
|
||||||
|
List<Long> compressPictureIds = new ArrayList<>();
|
||||||
|
Boolean b = this.compressPicture(smallPic, compressPictureIds);
|
||||||
|
if (!b) {
|
||||||
|
throw new ServiceException("图片压缩异常");
|
||||||
|
}
|
||||||
|
String result = compressPictureIds.stream()
|
||||||
|
.map(String::valueOf)
|
||||||
|
.collect(Collectors.joining(","));
|
||||||
|
pic.setCompressPic(result);
|
||||||
|
} else if (StringUtils.isBlank(smallPic) && StringUtils.isNotBlank(oldSmallPic)) {
|
||||||
|
List<Long> list = StringUtils.splitTo(oldPic.getCompressPic(), Convert::toLong);
|
||||||
|
Boolean b = ossService.deleteWithValidByIds(list, false);
|
||||||
|
if (!b) {
|
||||||
|
throw new ServiceException("图片删除异常");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 更新数据
|
||||||
|
boolean b = this.updateById(pic);
|
||||||
|
return CompletableFuture.completedFuture(b);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断两个Ids是否相同
|
||||||
|
*
|
||||||
|
* @param ids1 ids1
|
||||||
|
* @param ids2 ids2
|
||||||
|
* @return 是否相同
|
||||||
|
*/
|
||||||
|
private boolean isSameIds(String ids1, String ids2) {
|
||||||
|
Set<String> set1 = Arrays.stream(ids1.split(","))
|
||||||
|
.map(String::trim)
|
||||||
|
.filter(s -> !s.isEmpty())
|
||||||
|
.collect(Collectors.toSet());
|
||||||
|
Set<String> set2 = Arrays.stream(ids2.split(","))
|
||||||
|
.map(String::trim)
|
||||||
|
.filter(s -> !s.isEmpty())
|
||||||
|
.collect(Collectors.toSet());
|
||||||
|
return set1.equals(set2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,6 +16,7 @@ import org.dromara.progress.domain.PgsProgressCategory;
|
|||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设施-光伏板立柱Service接口
|
* 设施-光伏板立柱Service接口
|
||||||
@ -123,5 +124,5 @@ public interface IFacPhotovoltaicPanelColumnService extends IService<FacPhotovol
|
|||||||
* @param projectIds 项目id列表
|
* @param projectIds 项目id列表
|
||||||
* @param matchPoints 匹配的坐标点id
|
* @param matchPoints 匹配的坐标点id
|
||||||
*/
|
*/
|
||||||
void updateFinishNumberByCoordinate(List<Long> projectIds, List<Long> matchPoints);
|
void updateFinishNumberByCoordinate(List<Long> projectIds, Set<Long> matchPoints);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import org.dromara.facility.domain.dto.photovoltaicpanelparts.FacPhotovoltaicPan
|
|||||||
import org.dromara.facility.domain.dto.photovoltaicpanelparts.FacPhotovoltaicPanelPartsQueryReq;
|
import org.dromara.facility.domain.dto.photovoltaicpanelparts.FacPhotovoltaicPanelPartsQueryReq;
|
||||||
import org.dromara.facility.domain.vo.photovoltaicpanelparts.FacPhotovoltaicPanelPartsByPanelNameVo;
|
import org.dromara.facility.domain.vo.photovoltaicpanelparts.FacPhotovoltaicPanelPartsByPanelNameVo;
|
||||||
import org.dromara.manager.recognizermanager.vo.RecognizeConvertCoordinateResult;
|
import org.dromara.manager.recognizermanager.vo.RecognizeConvertCoordinateResult;
|
||||||
|
import org.dromara.progress.domain.vo.progressplandetail.PgsProgressPlanDetailRecognizerVo;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@ -108,6 +109,5 @@ public interface IFacPhotovoltaicPanelPartsService {
|
|||||||
* @param coordinateList 识别结果
|
* @param coordinateList 识别结果
|
||||||
* @param type 类型
|
* @param type 类型
|
||||||
*/
|
*/
|
||||||
void updateFinishNumberByCoordinate(List<Long> projectIds, List<RecognizeConvertCoordinateResult> coordinateList, String type);
|
List<PgsProgressPlanDetailRecognizerVo> updateFinishNumberByCoordinate(List<Long> projectIds, List<RecognizeConvertCoordinateResult> coordinateList, String type);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,6 +16,7 @@ import org.dromara.progress.domain.PgsProgressCategory;
|
|||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设施-光伏板桩点Service接口
|
* 设施-光伏板桩点Service接口
|
||||||
@ -123,5 +124,5 @@ public interface IFacPhotovoltaicPanelPointService extends IService<FacPhotovolt
|
|||||||
* @param projectIds 项目id列表
|
* @param projectIds 项目id列表
|
||||||
* @param matchPoints 匹配的坐标点id
|
* @param matchPoints 匹配的坐标点id
|
||||||
*/
|
*/
|
||||||
void updateFinishNumberByCoordinate(List<Long> projectIds, List<Long> matchPoints);
|
void updateFinishNumberByCoordinate(List<Long> projectIds, Set<Long> matchPoints);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,6 +13,7 @@ import org.dromara.facility.domain.dto.photovoltaicpanel.FacPhotovoltaicPanelUpd
|
|||||||
import org.dromara.facility.domain.vo.photovoltaicpanel.FacPhotovoltaicPanelVo;
|
import org.dromara.facility.domain.vo.photovoltaicpanel.FacPhotovoltaicPanelVo;
|
||||||
import org.dromara.manager.recognizermanager.vo.RecognizeConvertCoordinateResult;
|
import org.dromara.manager.recognizermanager.vo.RecognizeConvertCoordinateResult;
|
||||||
import org.dromara.progress.domain.PgsProgressCategory;
|
import org.dromara.progress.domain.PgsProgressCategory;
|
||||||
|
import org.dromara.progress.domain.vo.progressplandetail.PgsProgressPlanDetailRecognizerVo;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -134,6 +135,9 @@ public interface IFacPhotovoltaicPanelService extends IService<FacPhotovoltaicPa
|
|||||||
*
|
*
|
||||||
* @param projectIds 项目id列表
|
* @param projectIds 项目id列表
|
||||||
* @param coordinateList 坐标列表
|
* @param coordinateList 坐标列表
|
||||||
|
* @param type 类型
|
||||||
*/
|
*/
|
||||||
void updateFinishNumberByCoordinate(List<Long> projectIds, List<RecognizeConvertCoordinateResult> coordinateList);
|
List<PgsProgressPlanDetailRecognizerVo> updateFinishNumberByCoordinate(List<Long> projectIds,
|
||||||
|
List<RecognizeConvertCoordinateResult> coordinateList,
|
||||||
|
String type);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,6 +16,7 @@ import org.dromara.progress.domain.PgsProgressCategory;
|
|||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设施-光伏板支架Service接口
|
* 设施-光伏板支架Service接口
|
||||||
@ -123,5 +124,5 @@ public interface IFacPhotovoltaicPanelSupportService extends IService<FacPhotovo
|
|||||||
* @param projectIds 项目id列表
|
* @param projectIds 项目id列表
|
||||||
* @param matchPoints 匹配的坐标点id
|
* @param matchPoints 匹配的坐标点id
|
||||||
*/
|
*/
|
||||||
void updateFinishNumberByCoordinate(List<Long> projectIds, List<Long> matchPoints);
|
void updateFinishNumberByCoordinate(List<Long> projectIds, Set<Long> matchPoints);
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user