Compare commits
1 Commits
dev
...
flowUpdate
| Author | SHA1 | Date | |
|---|---|---|---|
| f6e01abe0e |
1
xinnengyuan/.gitignore
vendored
1
xinnengyuan/.gitignore
vendored
@ -54,4 +54,3 @@ docs
|
||||
/file
|
||||
.idea/
|
||||
chat-memory/
|
||||
queries/
|
||||
|
||||
@ -49,7 +49,7 @@
|
||||
<!-- 面向运行时的D-ORM依赖 -->
|
||||
<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>
|
||||
@ -86,15 +86,6 @@
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>menu</id>
|
||||
<properties>
|
||||
<profiles.active>menu</profiles.active>
|
||||
<logging.level>info</logging.level>
|
||||
<monitor.username>ruoyi</monitor.username>
|
||||
<monitor.password>123456</monitor.password>
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>prod</id>
|
||||
<properties>
|
||||
|
||||
@ -5,8 +5,6 @@ import cn.hutool.captcha.AbstractCaptcha;
|
||||
import cn.hutool.captcha.generator.CodeGenerator;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@ -78,7 +76,7 @@ public class CaptchaController {
|
||||
SmsResponse smsResponse = smsBlend.sendMessage(phonenumber, map);
|
||||
if (!smsResponse.isSuccess()) {
|
||||
log.error("验证码短信发送异常 => {}", smsResponse);
|
||||
return R.fail(parseData(smsResponse));
|
||||
return R.fail(smsResponse.getData().toString());
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
@ -142,35 +140,4 @@ public class CaptchaController {
|
||||
return R.ok(captchaVo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public static String parseData(SmsResponse smsResponse ) {
|
||||
try {
|
||||
JSONObject json = JSONUtil.parseObj(smsResponse.getData());
|
||||
// 核心:用 JsonUtil 解析 data,通过键路径 "Response.SendStatusSet[0].Code" 提取字段
|
||||
// 键路径规则:层级用 "." 分隔,列表索引用 "[0]" 表示(第 1 个元素)
|
||||
String code = json.getByPath("Response.SendStatusSet[0].Code", String.class);
|
||||
System.out.println("错误码:" + code); // 输出:FailedOperation.InsufficientBalanceInSmsPackage
|
||||
return convert(code);
|
||||
} catch (Exception e) {
|
||||
return "短信发送未知错误";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static String convert(String code) {
|
||||
return switch (code) {
|
||||
case "FailedOperation.InsufficientBalanceInSmsPackage" -> "套餐包余量不足,请购买套餐包";
|
||||
case "InternalError.SendAndRecvFail" -> "短信收发超时,请检查您的网络是否有波动";
|
||||
case "InvalidParameterValue.IncorrectPhoneNumber" -> "手机号格式错误";
|
||||
case "LimitExceeded.AppCountryOrRegionDailyLimit" -> "业务短信国家/地区日下发条数超过设定的上限";
|
||||
case "LimitExceeded.AppDailyLimit" -> "业务短信日下发条数超过设定的上限";
|
||||
case "LimitExceeded.PhoneNumberDailyLimit" -> "单个手机号日下发短信条数超过设定的上限";
|
||||
case "UnauthorizedOperation.ServiceSuspendDueToArrears" -> "欠费被停止服务";
|
||||
case "UnsupportedOperation.UnsupportedRegion" -> "不支持该地区短信下发";
|
||||
default -> "短信发送未知错误";
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -41,7 +41,7 @@ spring:
|
||||
api-key: sk-8d8df92fcbac4bd2922edba30b0bb8fa
|
||||
chat:
|
||||
options:
|
||||
model: qwen3-max
|
||||
model: qwen-plus
|
||||
datasource:
|
||||
type: com.zaxxer.hikari.HikariDataSource
|
||||
# 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content
|
||||
@ -59,14 +59,14 @@ spring:
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
# jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
|
||||
# rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
|
||||
url: jdbc:mysql://192.168.110.2:13386/xinnengyuandev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: xinnengyuandev
|
||||
password: StRWCZdZirysNSs2
|
||||
url: jdbc:mysql://192.168.110.2:13386/xinnengyuandev-update?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: xinnengyuandev-update
|
||||
password: cp7cAbWLZnRc6wyp
|
||||
# url: jdbc:mysql://192.168.110.2:13386/xinnengyuan?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
# username: xinnengyuan
|
||||
# password: mEZPC5Sdf3r2HENi
|
||||
# 从库数据源
|
||||
# slave:
|
||||
# slave:
|
||||
# lazy: true
|
||||
# type: ${spring.datasource.type}
|
||||
# driverClassName: com.mysql.cj.jdbc.Driver
|
||||
@ -368,14 +368,3 @@ drone:
|
||||
chat:
|
||||
server:
|
||||
port: 19099
|
||||
# rabbitmq 配置
|
||||
rabbitmq:
|
||||
exchange-name: dev-normal-exchange
|
||||
queue-name: dev-normal-queue
|
||||
routing-key: dev.normal.routing.key
|
||||
delay-exchange-name: dev-delay-queue
|
||||
delay-queue-name: dev-delay-exchange
|
||||
delay-routing-key: dev.delay.routing.key
|
||||
dead-letter-exchange: dev-dlx-exchange
|
||||
dead-letter-queue: dev-dlx-queue
|
||||
dead-letter-routing-key: dev.dlx.routing.key
|
||||
|
||||
@ -41,10 +41,10 @@ snail-job:
|
||||
spring:
|
||||
ai:
|
||||
dashscope:
|
||||
api-key: sk-8d8df92fcbac4bd2922edba30b0bb8fa
|
||||
api-key: xxx
|
||||
chat:
|
||||
options:
|
||||
model: qwen3-max
|
||||
model: qwen-plus
|
||||
datasource:
|
||||
type: com.zaxxer.hikari.HikariDataSource
|
||||
# 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content
|
||||
@ -343,14 +343,3 @@ drone:
|
||||
chat:
|
||||
server:
|
||||
port: 18088
|
||||
# rabbitmq 配置
|
||||
rabbitmq:
|
||||
exchange-name: local-normal-exchange
|
||||
queue-name: local-normal-queue
|
||||
routing-key: local.normal.routing.key
|
||||
delay-exchange-name: local-delay-queue
|
||||
delay-queue-name: local-delay-exchange
|
||||
delay-routing-key: local.delay.routing.key
|
||||
dead-letter-exchange: local-dlx-exchange
|
||||
dead-letter-queue: local-dlx-queue
|
||||
dead-letter-routing-key: local.dlx.routing.key
|
||||
|
||||
@ -1,356 +0,0 @@
|
||||
# 开发环境配置
|
||||
server:
|
||||
# 服务器的HTTP端口,默认为8080
|
||||
port: 9528
|
||||
--- # 临时文件存储位置 避免临时文件被系统清理报错
|
||||
spring.servlet.multipart.location: /ruoyi/server/temp
|
||||
|
||||
--- # 监控中心配置
|
||||
spring.boot.admin.client:
|
||||
# 增加客户端开关
|
||||
enabled: false
|
||||
url: http://localhost:9090/admin
|
||||
instance:
|
||||
service-host-type: IP
|
||||
metadata:
|
||||
username: ${spring.boot.admin.client.username}
|
||||
userpassword: ${spring.boot.admin.client.password}
|
||||
username: @monitor.username@
|
||||
password: @monitor.password@
|
||||
|
||||
--- # snail-job 配置
|
||||
snail-job:
|
||||
enabled: false
|
||||
# 需要在 SnailJob 后台组管理创建对应名称的组,然后创建任务的时候选择对应的组,才能正确分派任务
|
||||
group: "ruoyi_group"
|
||||
# SnailJob 接入验证令牌 详见 script/sql/ry_job.sql `sj_group_config`表
|
||||
token: "SJ_cKqBTPzCsWA3VyuCfFoccmuIEGXjr5KT"
|
||||
server:
|
||||
host: 127.0.0.1
|
||||
port: 17888
|
||||
# 命名空间UUID 详见 script/sql/ry_job.sql `sj_namespace`表`unique_id`字段
|
||||
namespace: ${spring.profiles.active}
|
||||
# 随主应用端口漂移
|
||||
port: 2${server.port}
|
||||
# 客户端ip指定
|
||||
host:
|
||||
# RPC类型: netty, grpc
|
||||
rpc-type: grpc
|
||||
|
||||
--- # 数据源配置
|
||||
spring:
|
||||
ai:
|
||||
dashscope:
|
||||
api-key: sk-8d8df92fcbac4bd2922edba30b0bb8fa
|
||||
chat:
|
||||
options:
|
||||
model: qwen3-max
|
||||
datasource:
|
||||
type: com.zaxxer.hikari.HikariDataSource
|
||||
# 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content
|
||||
dynamic:
|
||||
# 性能分析插件(有性能损耗 不建议生产环境使用)
|
||||
p6spy: false
|
||||
# 设置默认的数据源或者数据源组,默认值即为 master
|
||||
primary: master
|
||||
# 严格模式 匹配不到数据源则报错
|
||||
strict: true
|
||||
datasource:
|
||||
# 主库数据源
|
||||
master:
|
||||
type: ${spring.datasource.type}
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
# jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
|
||||
# rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
|
||||
url: jdbc:mysql://192.168.110.2:13386/xinnengyuanmenu?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
||||
username: xinnengyuanmenu
|
||||
password: 2RkXFG8ZE6r5LL7B
|
||||
# # 从库数据源
|
||||
# slave:
|
||||
# lazy: true
|
||||
# type: ${spring.datasource.type}
|
||||
# driverClassName: com.mysql.cj.jdbc.Driver
|
||||
# url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
||||
# username:
|
||||
# password:
|
||||
# oracle:
|
||||
# type: ${spring.datasource.type}
|
||||
# driverClassName: oracle.jdbc.OracleDriver
|
||||
# url: jdbc:oracle:thin:@//localhost:1521/XE
|
||||
# username: ROOT
|
||||
# password: root
|
||||
# postgres:
|
||||
# type: ${spring.datasource.type}
|
||||
# driverClassName: org.postgresql.Driver
|
||||
# url: jdbc:postgresql://localhost:5432/postgres?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
|
||||
# username: root
|
||||
# password: root
|
||||
# sqlserver:
|
||||
# type: ${spring.datasource.type}
|
||||
# driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
# url: jdbc:sqlserver://localhost:1433;DatabaseName=tempdb;SelectMethod=cursor;encrypt=false;rewriteBatchedStatements=true
|
||||
# username: SA
|
||||
# password: root
|
||||
hikari:
|
||||
# 最大连接池数量
|
||||
maxPoolSize: 20
|
||||
# 最小空闲线程数量
|
||||
minIdle: 10
|
||||
# 配置获取连接等待超时的时间
|
||||
connectionTimeout: 30000
|
||||
# 校验超时时间
|
||||
validationTimeout: 5000
|
||||
# 空闲连接存活最大时间,默认10分钟
|
||||
idleTimeout: 600000
|
||||
# 此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认30分钟
|
||||
maxLifetime: 1800000
|
||||
# 多久检查一次连接的活性
|
||||
keepaliveTime: 30000
|
||||
|
||||
--- # redis 单机配置(单机与集群只能开启一个另一个需要注释掉)
|
||||
spring.data:
|
||||
redis:
|
||||
# 地址
|
||||
host: 192.168.110.2
|
||||
# 端口,默认为6379
|
||||
port: 9287
|
||||
# 数据库索引
|
||||
database: 21
|
||||
# redis 密码必须配置
|
||||
password: syar23rdsaagdrsa
|
||||
# 连接超时时间
|
||||
timeout: 10s
|
||||
# 是否开启ssl
|
||||
ssl.enabled: false
|
||||
|
||||
# redisson 配置
|
||||
redisson:
|
||||
# redis key前缀
|
||||
keyPrefix:
|
||||
# 线程池数量
|
||||
threads: 16
|
||||
# Netty线程池数量
|
||||
nettyThreads: 32
|
||||
# 单节点配置
|
||||
singleServerConfig:
|
||||
# 客户端名称
|
||||
clientName: ${ruoyi.name}
|
||||
# 最小空闲连接数
|
||||
connectionMinimumIdleSize: 32
|
||||
# 连接池大小
|
||||
connectionPoolSize: 64
|
||||
# 连接空闲超时,单位:毫秒
|
||||
idleConnectionTimeout: 10000
|
||||
# 命令等待超时,单位:毫秒
|
||||
timeout: 3000
|
||||
# 发布和订阅连接池大小
|
||||
subscriptionConnectionPoolSize: 50
|
||||
|
||||
--- # mail 邮件发送
|
||||
mail:
|
||||
enabled: false
|
||||
host: smtp.163.com
|
||||
port: 465
|
||||
# 是否需要用户名密码验证
|
||||
auth: true
|
||||
# 发送方,遵循RFC-822标准
|
||||
from: xxx@163.com
|
||||
# 用户名(注意:如果使用foxmail邮箱,此处user为qq号)
|
||||
user: xxx@163.com
|
||||
# 密码(注意,某些邮箱需要为SMTP服务单独设置密码,详情查看相关帮助)
|
||||
pass: xxxxxxxxxx
|
||||
# 使用 STARTTLS安全连接,STARTTLS是对纯文本通信协议的扩展。
|
||||
starttlsEnable: true
|
||||
# 使用SSL安全连接
|
||||
sslEnable: true
|
||||
# SMTP超时时长,单位毫秒,缺省值不超时
|
||||
timeout: 0
|
||||
# Socket连接超时值,单位毫秒,缺省值不超时
|
||||
connectionTimeout: 0
|
||||
|
||||
--- # sms 短信 支持 阿里云 腾讯云 云片 等等各式各样的短信服务商
|
||||
# https://sms4j.com/doc3/ 差异配置文档地址 支持单厂商多配置,可以配置多个同时使用
|
||||
sms:
|
||||
# 配置源类型用于标定配置来源(interface,yaml)
|
||||
config-type: yaml
|
||||
# 用于标定yml中的配置是否开启短信拦截,接口配置不受此限制
|
||||
restricted: false
|
||||
# 短信拦截限制单手机号每分钟最大发送,只对开启了拦截的配置有效
|
||||
minute-max: 1
|
||||
# 短信拦截限制单手机号每日最大发送量,只对开启了拦截的配置有效
|
||||
account-max: 30
|
||||
# 以下配置来自于 org.dromara.sms4j.provider.config.BaseConfig类中
|
||||
blends:
|
||||
# 唯一ID 用于发送短信寻找具体配置 随便定义别用中文即可
|
||||
# 可以同时存在两个相同厂商 例如: ali1 ali2 两个不同的阿里短信账号 也可用于区分租户
|
||||
config1:
|
||||
# 框架定义的厂商名称标识,标定此配置是哪个厂商,详细请看厂商标识介绍部分
|
||||
supplier: alibaba
|
||||
# 有些称为accessKey有些称之为apiKey,也有称为sdkKey或者appId。
|
||||
access-key-id: 您的accessKey
|
||||
# 称为accessSecret有些称之为apiSecret
|
||||
access-key-secret: 您的accessKeySecret
|
||||
signature: 您的短信签名
|
||||
sdk-app-id: 您的sdkAppId
|
||||
config2:
|
||||
# 登录
|
||||
supplier: tencent
|
||||
access-key-id: AKIDb3JK5dx4wa0DCxWqvxlKejvysZ3ITVJv
|
||||
access-key-secret: c5LPFsJI8k7GDxTkoeFj4A1ukQr66rPi
|
||||
signature: 重庆远界大数据研究院
|
||||
sdk-app-id: 1401018866
|
||||
template-id: 2491779
|
||||
config3:
|
||||
# 注册
|
||||
supplier: tencent
|
||||
access-key-id: AKIDb3JK5dx4wa0DCxWqvxlKejvysZ3ITVJv
|
||||
access-key-secret: c5LPFsJI8k7GDxTkoeFj4A1ukQr66rPi
|
||||
signature: 重庆远界大数据研究院
|
||||
sdk-app-id: 1401018866
|
||||
template-id: 2491776
|
||||
config4:
|
||||
# 质量工单逾期
|
||||
supplier: tencent
|
||||
access-key-id: AKIDb3JK5dx4wa0DCxWqvxlKejvysZ3ITVJv
|
||||
access-key-secret: c5LPFsJI8k7GDxTkoeFj4A1ukQr66rPi
|
||||
signature: 重庆远界大数据研究院
|
||||
sdk-app-id: 1401018866
|
||||
template-id: 2534747
|
||||
config5:
|
||||
# 设计图纸
|
||||
supplier: tencent
|
||||
access-key-id: AKIDb3JK5dx4wa0DCxWqvxlKejvysZ3ITVJv
|
||||
access-key-secret: c5LPFsJI8k7GDxTkoeFj4A1ukQr66rPi
|
||||
signature: 重庆远界大数据研究院
|
||||
sdk-app-id: 1401018866
|
||||
template-id: 2534750
|
||||
config6:
|
||||
# 安全工单
|
||||
supplier: tencent
|
||||
access-key-id: AKIDb3JK5dx4wa0DCxWqvxlKejvysZ3ITVJv
|
||||
access-key-secret: c5LPFsJI8k7GDxTkoeFj4A1ukQr66rPi
|
||||
signature: 重庆远界大数据研究院
|
||||
sdk-app-id: 1401018866
|
||||
template-id: 2534848
|
||||
|
||||
--- # 三方授权
|
||||
justauth:
|
||||
# 前端外网访问地址
|
||||
address: http://localhost:80
|
||||
type:
|
||||
maxkey:
|
||||
# maxkey 服务器地址
|
||||
# 注意 如下均配置均不需要修改 maxkey 已经内置好了数据
|
||||
server-url: http://sso.maxkey.top
|
||||
client-id: 876892492581044224
|
||||
client-secret: x1Y5MTMwNzIwMjMxNTM4NDc3Mzche8
|
||||
redirect-uri: ${justauth.address}/social-callback?source=maxkey
|
||||
topiam:
|
||||
# topiam 服务器地址
|
||||
server-url: http://127.0.0.1:1989/api/v1/authorize/y0q************spq***********8ol
|
||||
client-id: 449c4*********937************759
|
||||
client-secret: ac7***********1e0************28d
|
||||
redirect-uri: ${justauth.address}/social-callback?source=topiam
|
||||
scopes: [ openid, email, phone, profile ]
|
||||
qq:
|
||||
client-id: 10**********6
|
||||
client-secret: 1f7d08**********5b7**********29e
|
||||
redirect-uri: ${justauth.address}/social-callback?source=qq
|
||||
union-id: false
|
||||
weibo:
|
||||
client-id: 10**********6
|
||||
client-secret: 1f7d08**********5b7**********29e
|
||||
redirect-uri: ${justauth.address}/social-callback?source=weibo
|
||||
gitee:
|
||||
client-id: 91436b7940090d09c72c7daf85b959cfd5f215d67eea73acbf61b6b590751a98
|
||||
client-secret: 02c6fcfd70342980cd8dd2f2c06c1a350645d76c754d7a264c4e125f9ba915ac
|
||||
redirect-uri: ${justauth.address}/social-callback?source=gitee
|
||||
dingtalk:
|
||||
client-id: 10**********6
|
||||
client-secret: 1f7d08**********5b7**********29e
|
||||
redirect-uri: ${justauth.address}/social-callback?source=dingtalk
|
||||
baidu:
|
||||
client-id: 10**********6
|
||||
client-secret: 1f7d08**********5b7**********29e
|
||||
redirect-uri: ${justauth.address}/social-callback?source=baidu
|
||||
csdn:
|
||||
client-id: 10**********6
|
||||
client-secret: 1f7d08**********5b7**********29e
|
||||
redirect-uri: ${justauth.address}/social-callback?source=csdn
|
||||
coding:
|
||||
client-id: 10**********6
|
||||
client-secret: 1f7d08**********5b7**********29e
|
||||
redirect-uri: ${justauth.address}/social-callback?source=coding
|
||||
coding-group-name: xx
|
||||
oschina:
|
||||
client-id: 10**********6
|
||||
client-secret: 1f7d08**********5b7**********29e
|
||||
redirect-uri: ${justauth.address}/social-callback?source=oschina
|
||||
alipay_wallet:
|
||||
client-id: 10**********6
|
||||
client-secret: 1f7d08**********5b7**********29e
|
||||
redirect-uri: ${justauth.address}/social-callback?source=alipay_wallet
|
||||
alipay-public-key: MIIB**************DAQAB
|
||||
wechat_open:
|
||||
client-id: 10**********6
|
||||
client-secret: 1f7d08**********5b7**********29e
|
||||
redirect-uri: ${justauth.address}/social-callback?source=wechat_open
|
||||
wechat_mp:
|
||||
client-id: 10**********6
|
||||
client-secret: 1f7d08**********5b7**********29e
|
||||
redirect-uri: ${justauth.address}/social-callback?source=wechat_mp
|
||||
wechat_enterprise:
|
||||
client-id: 10**********6
|
||||
client-secret: 1f7d08**********5b7**********29e
|
||||
redirect-uri: ${justauth.address}/social-callback?source=wechat_enterprise
|
||||
agent-id: 1000002
|
||||
gitlab:
|
||||
client-id: 10**********6
|
||||
client-secret: 1f7d08**********5b7**********29e
|
||||
redirect-uri: ${justauth.address}/social-callback?source=gitlab
|
||||
# 和风天气 https://dev.qweather.com/
|
||||
weather:
|
||||
key-id: T65EAABUXC
|
||||
project-id: 2JTHPUQ5YY
|
||||
private-key: MC4CAQAwBQYDK2VwBCIEIMAglX7IsxYiTeM+FXXnvCUsIggajeP4s8gAllewm6BN
|
||||
api-host: n35rk53njv.re.qweatherapi.com
|
||||
# dxf转 geojson 执行文件名
|
||||
dxf2GeoJson:
|
||||
file-name: main
|
||||
ys7:
|
||||
app-key: xxx
|
||||
app-secret: xxx
|
||||
job:
|
||||
capture-enabled: false # 控制是否启用萤石抓拍任务
|
||||
device-sync-enabled: false # 控制是否同步萤石设备
|
||||
# 斯巴达算法
|
||||
sparta:
|
||||
url: http://119.3.204.120:8040
|
||||
client-id: test
|
||||
client-secret: 115fcb08fa6742a1b086d9bb80a6ad59
|
||||
# 身份证加密密钥(32 位)
|
||||
id-card:
|
||||
encrypt-key: 7ae260d150a14027d2238a1cf80a48ef
|
||||
recognizer:
|
||||
url: http://192.168.110.5:50071
|
||||
|
||||
qrCode:
|
||||
url: http://xny.yj-3d.com:7788
|
||||
# 无人机大图
|
||||
drone:
|
||||
url: http://192.168.110.2:9512
|
||||
# 聊天服务
|
||||
chat:
|
||||
server:
|
||||
port: 18088
|
||||
# rabbitmq 配置
|
||||
rabbitmq:
|
||||
exchange-name: local-normal-exchange
|
||||
queue-name: local-normal-queue
|
||||
routing-key: local.normal.routing.key
|
||||
delay-exchange-name: local-delay-queue
|
||||
delay-queue-name: local-delay-exchange
|
||||
delay-routing-key: local.delay.routing.key
|
||||
dead-letter-exchange: local-dlx-exchange
|
||||
dead-letter-queue: local-dlx-queue
|
||||
dead-letter-routing-key: local.dlx.routing.key
|
||||
@ -358,14 +358,3 @@ drone:
|
||||
chat:
|
||||
server:
|
||||
port: 19099
|
||||
# rabbitmq 配置
|
||||
rabbitmq:
|
||||
exchange-name: prod-normal-exchange
|
||||
queue-name: prod-normal-queue
|
||||
routing-key: prod.normal.routing.key
|
||||
delay-exchange-name: prod-delay-queue
|
||||
delay-queue-name: prod-delay-exchange
|
||||
delay-routing-key: prod.delay.routing.key
|
||||
dead-letter-exchange: prod-dlx-exchange
|
||||
dead-letter-queue: prod-dlx-queue
|
||||
dead-letter-routing-key: prod.dlx.routing.key
|
||||
|
||||
@ -76,9 +76,9 @@ spring:
|
||||
servlet:
|
||||
multipart:
|
||||
# 单个文件大小
|
||||
max-file-size: 1024MB
|
||||
max-file-size: 200MB
|
||||
# 设置总上传的文件大小
|
||||
max-request-size: 1024MB
|
||||
max-request-size: 200MB
|
||||
mvc:
|
||||
# 设置静态资源路径 防止所有请求都去查静态资源
|
||||
static-path-pattern: /static/**
|
||||
@ -95,13 +95,7 @@ spring:
|
||||
deserialization:
|
||||
# 允许对象忽略json中不存在的属性
|
||||
fail_on_unknown_properties: false
|
||||
rabbitmq:
|
||||
host: 192.168.110.2
|
||||
port: 5672
|
||||
username: admin
|
||||
password: yuanjiexny
|
||||
publisher-returns: true
|
||||
publisher-confirm-type: correlated
|
||||
|
||||
# Sa-Token配置
|
||||
sa-token:
|
||||
# token名称 (同时也是cookie名称)
|
||||
@ -115,7 +109,7 @@ sa-token:
|
||||
# token有效期,单位s 默认30天, -1代表永不过期
|
||||
timeout: 2592000
|
||||
# token临时有效期 (指定时间内无操作就视为token过期) 单位: 秒
|
||||
active-timeout: 2592000
|
||||
active-timeout: 86400
|
||||
# 同一账号最大登录数量,-1代表不限
|
||||
max-login-count: -1
|
||||
|
||||
@ -182,7 +176,7 @@ mybatis-plus:
|
||||
# 数据加密
|
||||
mybatis-encryptor:
|
||||
# 是否开启加密
|
||||
enable: true
|
||||
enable: false
|
||||
# 默认加密算法
|
||||
algorithm: BASE64
|
||||
# 编码方式 BASE64/HEX。默认BASE64
|
||||
@ -311,12 +305,6 @@ springdoc:
|
||||
packages-to-scan: org.dromara.ai
|
||||
- group: 31.投标管理模块
|
||||
packages-to-scan: org.dromara.bidding
|
||||
- group: 32.设备模块
|
||||
packages-to-scan: org.dromara.device
|
||||
- group: 33.摄像头模块
|
||||
packages-to-scan: org.dromara.other
|
||||
- group: 34.机械模块
|
||||
packages-to-scan: org.dromara.mechanical
|
||||
# knife4j的增强配置,不需要增强可以不配
|
||||
knife4j:
|
||||
enable: true
|
||||
|
||||
@ -1,23 +1,14 @@
|
||||
package org.dromara.test;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.manager.recognizermanager.RecognizerManager;
|
||||
import org.dromara.manager.recognizermanager.enums.RecognizerTypeEnum;
|
||||
import org.dromara.manager.recognizermanager.vo.RecognizeVo;
|
||||
import org.dromara.progress.domain.PgsProgressPlanDetail;
|
||||
import org.dromara.progress.domain.vo.progressplandetail.PgsProgressPlanDetailFinishedVo;
|
||||
import org.dromara.progress.service.IPgsProgressPlanDetailService;
|
||||
import org.dromara.progress.service.IPgsProgressPlanService;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author lilemy
|
||||
@ -30,12 +21,6 @@ public class RecognizerTest {
|
||||
@Resource
|
||||
private RecognizerManager recognizerManager;
|
||||
|
||||
@Resource
|
||||
private IPgsProgressPlanDetailService progressPlanDetailService;
|
||||
|
||||
@Resource
|
||||
private IPgsProgressPlanService progressPlanService;
|
||||
|
||||
@Test
|
||||
void test() {
|
||||
RecognizeVo recognize = recognizerManager.recognize("http://xny.yj-3d.com:7363/file/tif/20250625160218orthophoto.png", List.of(RecognizerTypeEnum.PANEL));
|
||||
@ -46,39 +31,4 @@ public class RecognizerTest {
|
||||
void testChange() {
|
||||
recognizerManager.convertCoordinate("http://xny.yj-3d.com:9000/xinnengyuan-dev/2025/11/11/d48767a62bc04867a552e06ba6712004.tif", List.of());
|
||||
}
|
||||
|
||||
@Test
|
||||
void checkNumber() {
|
||||
List<PgsProgressPlanDetail> detailList = progressPlanDetailService.list();
|
||||
List<PgsProgressPlanDetail> planDetailList = detailList.stream()
|
||||
.filter(detail -> StringUtils.isNotBlank(detail.getFinishedDetail()))
|
||||
.toList();
|
||||
Map<String, List<PgsProgressPlanDetail>> collect = planDetailList.stream()
|
||||
.collect(Collectors.groupingBy(PgsProgressPlanDetail::getFinishedDetail));
|
||||
// 遍历分组结果,输出重复项
|
||||
for (Map.Entry<String, List<PgsProgressPlanDetail>> entry : collect.entrySet()) {
|
||||
String fieldValue = entry.getKey();
|
||||
List<PgsProgressPlanDetail> duplicates = entry.getValue();
|
||||
if (duplicates.size() > 1) { // 筛选出有重复的字段值
|
||||
PgsProgressPlanDetail first = duplicates.getFirst();
|
||||
Long id = first.getId();
|
||||
Long planId = first.getProgressPlanId();
|
||||
progressPlanService.removeById(planId);
|
||||
progressPlanDetailService.removeById(id);
|
||||
System.out.println("重复对象的对象:" + duplicates.stream().map(PgsProgressPlanDetail::getId).toList());
|
||||
}
|
||||
}
|
||||
for (PgsProgressPlanDetail detail : detailList) {
|
||||
BigDecimal aiFill = detail.getFinishedNumber();
|
||||
String finishedDetail = detail.getFinishedDetail();
|
||||
if (StringUtils.isBlank(finishedDetail)) {
|
||||
continue;
|
||||
}
|
||||
// log.info("id: {}, finishedDetail: {}", detail.getId(), finishedDetail);
|
||||
List<PgsProgressPlanDetailFinishedVo> finishedVos = JSONUtil.toList(finishedDetail, PgsProgressPlanDetailFinishedVo.class);
|
||||
if (aiFill.compareTo(BigDecimal.valueOf(finishedVos.size())) != 0) {
|
||||
log.info("数量异常:{}:{}", detail.getId(), detail.getProgressCategoryId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -59,18 +59,6 @@ public class AsyncConfig implements AsyncConfigurer {
|
||||
return executor;
|
||||
}
|
||||
|
||||
// 解压线程池(大文件操作,不需要太多线程)
|
||||
@Bean("unzipExecutor")
|
||||
public Executor unzipExecutor() {
|
||||
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||
executor.setCorePoolSize(2);
|
||||
executor.setMaxPoolSize(4);
|
||||
executor.setQueueCapacity(10);
|
||||
executor.setThreadNamePrefix("unzip-");
|
||||
executor.initialize();
|
||||
return executor;
|
||||
}
|
||||
|
||||
/**
|
||||
* 异步执行异常处理
|
||||
*/
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
@ -30,11 +31,21 @@ public class StartProcessDTO implements Serializable {
|
||||
*/
|
||||
private String flowCode;
|
||||
|
||||
/**
|
||||
* 办理人(可不填 用于覆盖当前节点办理人)
|
||||
*/
|
||||
private String handler;
|
||||
|
||||
/**
|
||||
* 流程变量,前端会提交一个元素{'entity': {业务详情数据对象}}
|
||||
*/
|
||||
private Map<String, Object> variables;
|
||||
|
||||
/**
|
||||
* 流程业务扩展信息
|
||||
*/
|
||||
private FlowInstanceBizExtDTO bizExt;
|
||||
|
||||
public Map<String, Object> getVariables() {
|
||||
if (variables == null) {
|
||||
return new HashMap<>(16);
|
||||
@ -42,4 +53,11 @@ public class StartProcessDTO implements Serializable {
|
||||
variables.entrySet().removeIf(entry -> Objects.isNull(entry.getValue()));
|
||||
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(
|
||||
List<T> sourceList,
|
||||
Function<T, Long> storageId,
|
||||
Function<T, String> storageId,
|
||||
Function<T, String> handlerCode,
|
||||
Function<T, String> handlerName,
|
||||
Function<T, Long> groupName,
|
||||
Function<T, String> groupName,
|
||||
Function<T, Date> createTimeMapper) {
|
||||
return sourceList.stream()
|
||||
.map(item -> new TaskHandler(
|
||||
String.valueOf(storageId.apply(item)),
|
||||
storageId.apply(item),
|
||||
handlerCode.apply(item),
|
||||
handlerName.apply(item),
|
||||
groupName != null ? String.valueOf(groupName.apply(item)) : null,
|
||||
groupName.apply(item),
|
||||
createTimeMapper.apply(item)
|
||||
)).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
|
||||
@ -62,4 +62,10 @@ public class ProcessEvent implements Serializable {
|
||||
*/
|
||||
private Boolean submit;
|
||||
|
||||
/**
|
||||
* 实例id
|
||||
*/
|
||||
private Long instanceId;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 流程办理监听
|
||||
@ -56,4 +57,14 @@ public class ProcessTaskEvent implements Serializable {
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 实例id
|
||||
*/
|
||||
private Long instanceId;
|
||||
|
||||
|
||||
/**
|
||||
* 办理参数
|
||||
*/
|
||||
private Map<String, Object> params;
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package org.dromara.common.core.exception;
|
||||
|
||||
import cn.hutool.core.text.StrFormatter;
|
||||
import lombok.*;
|
||||
|
||||
import java.io.Serial;
|
||||
@ -56,4 +57,8 @@ public final class ServiceException extends RuntimeException {
|
||||
this.detailMessage = detailMessage;
|
||||
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);
|
||||
*
|
||||
* @param completeTask 参数
|
||||
* @return 结果
|
||||
*/
|
||||
boolean completeTask(CompleteTaskDTO completeTask);
|
||||
|
||||
@ -90,6 +91,15 @@ public interface WorkflowService {
|
||||
*
|
||||
* @param taskId 任务ID
|
||||
* @param message 办理意见
|
||||
* @return 结果
|
||||
*/
|
||||
boolean completeTask(Long taskId, String message);
|
||||
|
||||
/**
|
||||
* 启动流程并办理第一个任务
|
||||
*
|
||||
* @param startProcess 参数
|
||||
* @return 结果
|
||||
*/
|
||||
boolean startCompleteTask(StartProcessDTO startProcess);
|
||||
}
|
||||
|
||||
@ -1,6 +0,0 @@
|
||||
package org.dromara.common.core.service;
|
||||
|
||||
public interface XzdSjContractInfoService {
|
||||
|
||||
String selectNameByIds(String ids);
|
||||
}
|
||||
@ -7,7 +7,6 @@ import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.stream.Collectors;
|
||||
@ -31,8 +30,10 @@ public class StreamUtils {
|
||||
if (CollUtil.isEmpty(collection)) {
|
||||
return CollUtil.newArrayList();
|
||||
}
|
||||
return collection.stream()
|
||||
.filter(function)
|
||||
// 注意此处不要使用 .toList() 新语法 因为返回的是不可变List 会导致序列化问题
|
||||
return collection.stream().filter(function).collect(Collectors.toList());
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -40,13 +41,26 @@ public class StreamUtils {
|
||||
*
|
||||
* @param collection 需要查询的集合
|
||||
* @param function 过滤方法
|
||||
* @return 找到符合条件的第一个元素,没有则返回null
|
||||
* @return 找到符合条件的第一个元素,没有则返回 Optional.empty()
|
||||
*/
|
||||
public static <E> E findFirst(Collection<E> collection, Predicate<E> function) {
|
||||
public static <E> Optional<E> findFirst(Collection<E> collection, Predicate<E> function) {
|
||||
if (CollUtil.isEmpty(collection)) {
|
||||
return null;
|
||||
return Optional.empty();
|
||||
}
|
||||
return collection.stream().filter(function).findFirst().orElse(null);
|
||||
return collection.stream()
|
||||
.filter(function)
|
||||
.findFirst();
|
||||
}
|
||||
|
||||
/**
|
||||
* 找到流中满足条件的第一个元素值
|
||||
*
|
||||
* @param collection 需要查询的集合
|
||||
* @param function 过滤方法
|
||||
* @return 找到符合条件的第一个元素,没有则返回 null
|
||||
*/
|
||||
public static <E> E findFirstValue(Collection<E> collection, Predicate<E> function) {
|
||||
return findFirst(collection,function).orElse(null);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -54,13 +68,26 @@ public class StreamUtils {
|
||||
*
|
||||
* @param collection 需要查询的集合
|
||||
* @param function 过滤方法
|
||||
* @return 找到符合条件的任意一个元素,没有则返回null
|
||||
* @return 找到符合条件的任意一个元素,没有则返回 Optional.empty()
|
||||
*/
|
||||
public static <E> Optional<E> findAny(Collection<E> collection, Predicate<E> function) {
|
||||
if (CollUtil.isEmpty(collection)) {
|
||||
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)) {
|
||||
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)) {
|
||||
return CollUtil.newArrayList();
|
||||
}
|
||||
return collection.stream()
|
||||
.filter(Objects::nonNull)
|
||||
.sorted(comparing)
|
||||
// 注意此处不要使用 .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)) {
|
||||
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)) {
|
||||
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)) {
|
||||
return MapUtil.newHashMap();
|
||||
}
|
||||
return collection
|
||||
.stream().filter(Objects::nonNull)
|
||||
return collection.stream()
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.groupingBy(key, LinkedHashMap::new, Collectors.toList()));
|
||||
}
|
||||
|
||||
@ -175,8 +228,8 @@ public class StreamUtils {
|
||||
if (CollUtil.isEmpty(collection)) {
|
||||
return MapUtil.newHashMap();
|
||||
}
|
||||
return collection
|
||||
.stream().filter(Objects::nonNull)
|
||||
return collection.stream()
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.groupingBy(key1, LinkedHashMap::new, Collectors.groupingBy(key2, LinkedHashMap::new, Collectors.toList())));
|
||||
}
|
||||
|
||||
@ -193,11 +246,11 @@ public class StreamUtils {
|
||||
* @return 分类后的map
|
||||
*/
|
||||
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 collection
|
||||
.stream().filter(Objects::nonNull)
|
||||
return collection.stream()
|
||||
.filter(Objects::nonNull)
|
||||
.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)) {
|
||||
return CollUtil.newArrayList();
|
||||
}
|
||||
return collection
|
||||
.stream()
|
||||
return collection.stream()
|
||||
.map(function)
|
||||
.filter(Objects::nonNull)
|
||||
// 注意此处不要使用 .toList() 新语法 因为返回的是不可变List 会导致序列化问题
|
||||
@ -234,11 +286,10 @@ public class StreamUtils {
|
||||
* @return 转化后的Set
|
||||
*/
|
||||
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 collection
|
||||
.stream()
|
||||
return collection.stream()
|
||||
.map(function)
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toSet());
|
||||
@ -258,26 +309,20 @@ public class StreamUtils {
|
||||
* @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) {
|
||||
if (MapUtil.isEmpty(map1) && MapUtil.isEmpty(map2)) {
|
||||
if (CollUtil.isEmpty(map1) && CollUtil.isEmpty(map2)) {
|
||||
// 如果两个 map 都为空,则直接返回空的 map
|
||||
return MapUtil.newHashMap();
|
||||
} else if (MapUtil.isEmpty(map1)) {
|
||||
map1 = MapUtil.newHashMap();
|
||||
} else if (MapUtil.isEmpty(map2)) {
|
||||
map2 = MapUtil.newHashMap();
|
||||
} else if (CollUtil.isEmpty(map1)) {
|
||||
// 如果 map1 为空,则直接处理返回 map2
|
||||
return toMap(map2.entrySet(), Map.Entry::getKey, entry -> merge.apply(null, entry.getValue()));
|
||||
} 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<>();
|
||||
key.addAll(map1.keySet());
|
||||
key.addAll(map2.keySet());
|
||||
Map<K, V> map = new HashMap<>();
|
||||
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;
|
||||
Set<K> keySet = new HashSet<>();
|
||||
keySet.addAll(map1.keySet());
|
||||
keySet.addAll(map2.keySet());
|
||||
return toMap(keySet, key -> key, key -> merge.apply(map1.get(key), map2.get(key)));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -351,4 +351,14 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
|
||||
return noSpaces.matches("\\d+");
|
||||
}
|
||||
|
||||
/**
|
||||
* 将可迭代对象中的元素使用逗号拼接成字符串
|
||||
*
|
||||
* @param iterable 可迭代对象,如 List、Set 等
|
||||
* @return 拼接后的字符串
|
||||
*/
|
||||
public static String joinComma(Iterable<?> iterable) {
|
||||
return StringUtils.join(iterable, SEPARATOR);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,146 +0,0 @@
|
||||
package org.dromara.common.core.utils;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.TimeZone;
|
||||
|
||||
/**
|
||||
* 时间戳转换工具类(包含时分秒提取)
|
||||
*/
|
||||
public class TimestampUtils {
|
||||
|
||||
// 默认时区(东八区)
|
||||
private static final TimeZone DEFAULT_TIME_ZONE = TimeZone.getTimeZone("GMT+8");
|
||||
|
||||
// 完整日期格式
|
||||
private static final String FULL_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";
|
||||
|
||||
// 时分秒格式
|
||||
private static final String TIME_FORMAT = "HH:mm:ss";
|
||||
|
||||
// 日期格式
|
||||
private static final String DATE_FORMAT = "yyyy-MM-dd";
|
||||
|
||||
/**
|
||||
* 将日期字符串转为秒级时间戳(优化版)
|
||||
* 支持格式:"2025-12-03 23:59:59"、"2025-12-03"等
|
||||
* @param dateStr 日期字符串
|
||||
* @return 秒级时间戳
|
||||
*/
|
||||
public static Long parseDateToTimestamp(String dateStr) {
|
||||
if (StrUtil.isBlank(dateStr)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 使用Hutool的DateUtil进行智能解析(推荐)
|
||||
try {
|
||||
Date date = DateUtil.parse(dateStr);
|
||||
return date.getTime() / 1000L; // 转为秒级时间戳
|
||||
} catch (Exception e) {
|
||||
throw new IllegalArgumentException(
|
||||
String.format("日期格式错误:%s,支持格式:yyyy-MM-dd HH:mm:ss、yyyy-MM-dd等", dateStr)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 将时间戳转换为完整日期格式(yyyy-MM-dd HH:mm:ss)
|
||||
*/
|
||||
public static String formatTimestamp(Object timestamp) {
|
||||
if (timestamp == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
String timestampStr = timestamp.toString().trim();
|
||||
if (StrUtil.isBlank(timestampStr)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Long time = parseToMilliseconds(timestampStr);
|
||||
SimpleDateFormat sdf = new SimpleDateFormat(FULL_DATE_FORMAT);
|
||||
sdf.setTimeZone(DEFAULT_TIME_ZONE);
|
||||
return sdf.format(new Date(time));
|
||||
}
|
||||
|
||||
/**
|
||||
* 提取时间戳中的时分秒部分(HH:mm:ss)
|
||||
*/
|
||||
public static String extractTime(Object timestamp) {
|
||||
if (timestamp == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
String timestampStr = timestamp.toString().trim();
|
||||
if (StrUtil.isBlank(timestampStr)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Long time = parseToMilliseconds(timestampStr);
|
||||
SimpleDateFormat sdf = new SimpleDateFormat(TIME_FORMAT);
|
||||
sdf.setTimeZone(DEFAULT_TIME_ZONE);
|
||||
return sdf.format(new Date(time));
|
||||
}
|
||||
|
||||
/**
|
||||
* 提取时间戳中的日期部分(yyyy-MM-dd)
|
||||
*/
|
||||
public static String extractDate(Object timestamp) {
|
||||
if (timestamp == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
String timestampStr = timestamp.toString().trim();
|
||||
if (StrUtil.isBlank(timestampStr)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Long time = parseToMilliseconds(timestampStr);
|
||||
SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT);
|
||||
sdf.setTimeZone(DEFAULT_TIME_ZONE);
|
||||
return sdf.format(new Date(time));
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析时间戳字符串为毫秒级时间戳
|
||||
*/
|
||||
private static Long parseToMilliseconds(String timestampStr) {
|
||||
try {
|
||||
Long time = Long.parseLong(timestampStr);
|
||||
// 10位秒级时间戳转为13位毫秒级
|
||||
if (timestampStr.length() == 10) {
|
||||
time = time * 1000;
|
||||
}
|
||||
return time;
|
||||
} catch (NumberFormatException e) {
|
||||
throw new IllegalArgumentException("时间戳格式错误:" + timestampStr);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取时间戳对应的小时
|
||||
*/
|
||||
public static int getHour(Object timestamp) {
|
||||
String timeStr = extractTime(timestamp);
|
||||
return Integer.parseInt(timeStr.split(":")[0]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取时间戳对应的分钟
|
||||
*/
|
||||
public static int getMinute(Object timestamp) {
|
||||
String timeStr = extractTime(timestamp);
|
||||
return Integer.parseInt(timeStr.split(":")[1]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取时间戳对应的秒
|
||||
*/
|
||||
public static int getSecond(Object timestamp) {
|
||||
String timeStr = extractTime(timestamp);
|
||||
return Integer.parseInt(timeStr.split(":")[2]);
|
||||
}
|
||||
}
|
||||
@ -110,6 +110,15 @@ public class SpringDocConfig {
|
||||
}
|
||||
PlusPaths newPaths = new PlusPaths();
|
||||
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);
|
||||
};
|
||||
}
|
||||
|
||||
@ -91,7 +91,7 @@ public class PlusDataPermissionHandler {
|
||||
DataPermissionHelper.setVariable("user", currentUser);
|
||||
}
|
||||
// 如果是超级管理员或租户管理员,则不过滤数据
|
||||
if (LoginHelper.isSuperAdmin()) {
|
||||
if (LoginHelper.isSuperAdmin() || LoginHelper.isTenantAdmin()) {
|
||||
return where;
|
||||
}
|
||||
// 构造数据过滤条件的 SQL 片段
|
||||
|
||||
@ -82,10 +82,5 @@ public interface TransConstant {
|
||||
*/
|
||||
String XZD_CBYS_ZJHCB_ID_TO_NAME = "xzd_cbys_zjhcb_id_to_name";
|
||||
|
||||
/**
|
||||
* 新中大-设计合同信息id转name
|
||||
*/
|
||||
String XZD_SJ_CONTRACT_INFO_ID_TO_NAME = "xzd_sj_contract_info_id_to_name";
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,24 +0,0 @@
|
||||
package org.dromara.common.translation.core.impl;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.dromara.common.core.service.XzdSjContractInfoService;
|
||||
import org.dromara.common.core.service.XzdSupplierOpenBankService;
|
||||
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_SJ_CONTRACT_INFO_ID_TO_NAME)
|
||||
public class XzdSjContractInfoImpl implements TranslationInterface<String> {
|
||||
|
||||
private final XzdSjContractInfoService xzdSjContractInfoService;
|
||||
@Override
|
||||
public String translation(Object key, String other) {
|
||||
if (key instanceof String ids) {
|
||||
return xzdSjContractInfoService.selectNameByIds(ids);
|
||||
} else if (key instanceof Long id) {
|
||||
return xzdSjContractInfoService.selectNameByIds(id.toString());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -14,4 +14,3 @@ 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
|
||||
org.dromara.common.translation.core.impl.XzdSjContractInfoImpl
|
||||
|
||||
@ -29,10 +29,6 @@
|
||||
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-amqp</artifactId>
|
||||
</dependency>
|
||||
<!-- TwelveMonkeys ImageIO 扩展 -->
|
||||
<dependency>
|
||||
<groupId>com.twelvemonkeys.imageio</groupId>
|
||||
|
||||
@ -25,7 +25,7 @@ import java.util.concurrent.CompletableFuture;
|
||||
public class DashScopeChat {
|
||||
|
||||
@Resource
|
||||
private DashScopeSimpleChat dashScopeSimpleChat;
|
||||
private SimpleChat simpleChat;
|
||||
|
||||
@Resource
|
||||
private IAIChatMemoryService chatMemoryService;
|
||||
@ -66,8 +66,10 @@ public class DashScopeChat {
|
||||
.collectList()
|
||||
.flatMapMany(tokens -> {
|
||||
String aiResponse = String.join("", tokens);
|
||||
if (isFirst) {
|
||||
// 异步生成标题
|
||||
generateChatTitleAsync(chatId, message, aiResponse, userId);
|
||||
}
|
||||
// 返回完整的流结果
|
||||
return Flux.fromIterable(tokens);
|
||||
});
|
||||
@ -98,7 +100,7 @@ public class DashScopeChat {
|
||||
用户:%s
|
||||
AI:%s
|
||||
""", userMessage, aiResponse);
|
||||
String title = dashScopeSimpleChat.doChat(prompt);
|
||||
String title = simpleChat.doChat(prompt);
|
||||
log.info("用户:{} 生成标题成功:{} -> {}", userId, chatId, title);
|
||||
// 保存对话数据
|
||||
AIChatMemory memory = new AIChatMemory();
|
||||
|
||||
@ -9,11 +9,11 @@ import org.springframework.stereotype.Component;
|
||||
* @date 2025-11-04 15:26
|
||||
*/
|
||||
@Component
|
||||
public class DashScopeSimpleChat {
|
||||
public class SimpleChat {
|
||||
|
||||
private final ChatClient dashScopeChatClient;
|
||||
|
||||
public DashScopeSimpleChat(ChatClient.Builder chatClientBuilder) {
|
||||
public SimpleChat(ChatClient.Builder chatClientBuilder) {
|
||||
this.dashScopeChatClient = chatClientBuilder
|
||||
// 设置 ChatClient 中 ChatModel 的 Options 参数
|
||||
.defaultOptions(
|
||||
@ -1,66 +0,0 @@
|
||||
package org.dromara.bigscreen.controller;
|
||||
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.bigscreen.domain.bo.DpznglBo;
|
||||
import org.dromara.bigscreen.domain.vo.DpznglAqyVo;
|
||||
import org.dromara.bigscreen.domain.vo.DpznglVo;
|
||||
import org.dromara.bigscreen.service.DpzaglService;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 大屏-质安管理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-05
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/dpzagl")
|
||||
public class DpzaglController {
|
||||
|
||||
private final DpzaglService dpzaglService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询大屏-质安管理-站班会,巡检工单,整改情况
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public R<DpznglVo> list(DpznglBo bo) {
|
||||
return R.ok(dpzaglService.queryList(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询大屏-质安管理-站班会
|
||||
*/
|
||||
@GetMapping("/listByzbh")
|
||||
public R<DpznglVo> listByzbh(DpznglBo bo) {
|
||||
return R.ok(dpzaglService.listByzbh(bo));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询大屏-质安管理-安全员分布情况
|
||||
*/
|
||||
@GetMapping("/listByAqy")
|
||||
public R<List<DpznglAqyVo>> listByAqy(DpznglBo bo) {
|
||||
return R.ok(dpzaglService.listByAqy(bo));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1,133 +0,0 @@
|
||||
package org.dromara.bigscreen.controller;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.bigscreen.domain.vo.*;
|
||||
import org.dromara.bigscreen.service.IMaterialsManagementService;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusPurchaseDocVo;
|
||||
import org.dromara.cailiaoshebei.service.IBusMrpBaseService;
|
||||
import org.dromara.cailiaoshebei.service.IBusPurchaseDocService;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.manager.ys7manager.Ys7Manager;
|
||||
import org.dromara.materials.domain.vo.materials.MatMaterialsUseDetailVo;
|
||||
import org.dromara.materials.service.IMatMaterialsService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 物资管理
|
||||
*/
|
||||
@Validated
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/materialsManagement")
|
||||
public class MaterialsManagementController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IMaterialsManagementService materialsManagementService;
|
||||
@Autowired
|
||||
private IBusPurchaseDocService busPurchaseDocService;
|
||||
@Autowired
|
||||
private IBusMrpBaseService busMrpBaseService;
|
||||
@Autowired
|
||||
private IMatMaterialsService materialsService;
|
||||
@Resource
|
||||
private Ys7Manager ys7Manager;
|
||||
|
||||
/**
|
||||
* 库存结构分析
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/inventoryStructureAnalysis")
|
||||
public R<InventoryStructureAnalysisVo> inventoryStructureAnalysis(Long projectId) {
|
||||
return R.ok(materialsManagementService.inventoryStructureAnalysis(projectId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 采购单
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/purchaseNote")
|
||||
public R<List<BusPurchaseDocVo>> purchaseNote(Long projectId) {
|
||||
return R.ok(busPurchaseDocService.purchaseNote(projectId));
|
||||
}
|
||||
/**
|
||||
* 获取采购单详情
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/purchaseNoteDetail")
|
||||
public R<BusPurchaseDocVo> purchaseNoteDetail(Long id) {
|
||||
return R.ok(busPurchaseDocService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取采购单详情PDF
|
||||
*/
|
||||
@GetMapping("/purchaseNoteDetailPdf")
|
||||
public R<String> purchaseNoteDetailPdf(Long id) {
|
||||
return R.ok(busPurchaseDocService.queryPicBase64ById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 设计量与到货量对比
|
||||
*/
|
||||
@GetMapping("/designAndArrivalComparison")
|
||||
public R<List<designAndArrivalComparisonVo>> designAndArrivalComparison(Long projectId) {
|
||||
return R.ok(busMrpBaseService.designAndArrivalComparison(projectId));
|
||||
}
|
||||
/**
|
||||
* 物资需求与实际到货对比
|
||||
*/
|
||||
@GetMapping("/wzxqysjdhdb")
|
||||
public R<List<wzxqysjdhdbVo>> wzxqysjdhdb(Long projectId) {
|
||||
return R.ok(busMrpBaseService.wzxqysjdhdb(projectId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 消耗趋势对比
|
||||
*/
|
||||
@GetMapping("/xhqsdb")
|
||||
public R<List<xhqsdbVo>> xhqsdb(Long projectId) {
|
||||
return R.ok(materialsManagementService.xhqsdb(projectId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取材料使用详情列表
|
||||
*/
|
||||
@GetMapping("/listUseDetail")
|
||||
public R<List<MatMaterialsUseDetailVo>> listUseDetail(Long projectId) {
|
||||
return R.ok(materialsService.listUseDetail(projectId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 仓库实时监控
|
||||
*/
|
||||
@GetMapping("/warehouseMonitoring")
|
||||
public R<List<WarehouseMonitoringVo>> warehouseMonitoring(Long projectId) {
|
||||
return R.ok(materialsManagementService.warehouseMonitoring(projectId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 监控以及仓库出入库详情
|
||||
*/
|
||||
@GetMapping("/warehouseInAndOutDetail")
|
||||
public R<List<StockInAndStockOutRecordVo>> warehouseInAndOutDetail(Long projectId, Long warehouseId) {
|
||||
return R.ok(materialsManagementService.warehouseInAndOutDetail(projectId, warehouseId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取YS7摄像头token
|
||||
*/
|
||||
@GetMapping("/get/token")
|
||||
public R<String> getToken() {
|
||||
return R.ok("操作成功", ys7Manager.getToken());
|
||||
}
|
||||
|
||||
}
|
||||
@ -41,6 +41,7 @@ import org.dromara.patch.service.IPdMasterService;
|
||||
import org.dromara.project.service.IBusProjectService;
|
||||
import org.dromara.system.domain.SysMenu;
|
||||
import org.dromara.system.domain.vo.RouterVo;
|
||||
import org.dromara.system.mapper.SysRoleMapper;
|
||||
import org.dromara.system.service.impl.SysMenuServiceImpl;
|
||||
import org.dromara.system.service.impl.SysUserServiceImpl;
|
||||
import org.dromara.warm.flow.core.FlowEngine;
|
||||
@ -96,6 +97,7 @@ public class PersonalHomeController extends BaseController {
|
||||
@Resource
|
||||
private IBusProjectService projectService;
|
||||
|
||||
private final SysRoleMapper roleMapper;
|
||||
private final SysMenuServiceImpl sysMenuService;
|
||||
|
||||
// region AI 模块
|
||||
|
||||
@ -1,80 +0,0 @@
|
||||
package org.dromara.bigscreen.controller;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.bigscreen.domain.dto.ProjectImageProgressDetailReq;
|
||||
import org.dromara.bigscreen.domain.progress.DesignProgressVo;
|
||||
import org.dromara.bigscreen.domain.progress.MaterialProgressDetailVo;
|
||||
import org.dromara.bigscreen.domain.progress.MilestoneProgressVo;
|
||||
import org.dromara.bigscreen.domain.progress.ProjectTotalProgressVo;
|
||||
import org.dromara.bigscreen.domain.vo.ProjectImageProgressDetailVo;
|
||||
import org.dromara.bigscreen.service.ProgressBigScreenService;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 进度管理大屏接口
|
||||
*
|
||||
* @author lilemy
|
||||
* @date 2025-12-15 11:35
|
||||
*/
|
||||
@Validated
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/progress/big/screen")
|
||||
public class ProgressBigScreenController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private ProgressBigScreenService progressBigScreenService;
|
||||
|
||||
/**
|
||||
* 获取项目总进度
|
||||
*/
|
||||
@GetMapping("/projectTotalProgress/{projectId}")
|
||||
public R<ProjectTotalProgressVo> getProjectTotalProgress(@NotNull(message = "项目主键不能为空")
|
||||
@PathVariable Long projectId) {
|
||||
return R.ok(progressBigScreenService.getProjectTotalProgress(projectId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取里程碑进度
|
||||
*/
|
||||
@GetMapping("/milestoneProgress/{projectId}")
|
||||
public R<List<MilestoneProgressVo>> getMilestoneProgress(@NotNull(message = "项目主键不能为空")
|
||||
@PathVariable Long projectId) {
|
||||
return R.ok(progressBigScreenService.getMilestoneProgress(projectId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设计进度
|
||||
*/
|
||||
@GetMapping("/designProgress/{projectId}")
|
||||
public R<DesignProgressVo> getDesignProgress(@NotNull(message = "项目主键不能为空")
|
||||
@PathVariable Long projectId) {
|
||||
return R.ok(progressBigScreenService.getDesignProgress(projectId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取施工进度详情
|
||||
*/
|
||||
@GetMapping("/constructionProgress/detail")
|
||||
public R<List<ProjectImageProgressDetailVo>> getProjectTotalProgressDetail(@Validated ProjectImageProgressDetailReq req) {
|
||||
return R.ok(progressBigScreenService.getProjectTotalProgressDetail(req));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取材料进度详情
|
||||
*/
|
||||
@GetMapping("/materialProgress/detail")
|
||||
public R<List<MaterialProgressDetailVo>> getMaterialProgressDetail(Long project, String name, String specification) {
|
||||
return R.ok(progressBigScreenService.getMaterialProgressDetail(project, name, specification));
|
||||
}
|
||||
}
|
||||
@ -1,39 +0,0 @@
|
||||
package org.dromara.bigscreen.controller;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.bigscreen.domain.vo.ProjectPeopleVo;
|
||||
import org.dromara.bigscreen.service.ProjectBigScreenService;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.project.domain.vo.project.BusProjectVo;
|
||||
import org.dromara.project.service.IBusProjectService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* UE大屏
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-04
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/UE/screen")
|
||||
public class UEController {
|
||||
|
||||
@Resource
|
||||
private IBusProjectService projectService;
|
||||
|
||||
|
||||
@GetMapping("/projectInfo/{projectId}")
|
||||
public R<BusProjectVo> getProjectPeople(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long projectId) {
|
||||
return R.ok(projectService.selectById(projectId));
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,41 +0,0 @@
|
||||
package org.dromara.bigscreen.domain.bo;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
|
||||
@Data
|
||||
public class DpznglBo implements Serializable {
|
||||
|
||||
/**
|
||||
* 分页大小
|
||||
*/
|
||||
private Integer pageSize = 10;
|
||||
|
||||
/**
|
||||
* 当前页数
|
||||
*/
|
||||
private Integer pageNum = 1;
|
||||
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private LocalDate startDate;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private LocalDate endDate;
|
||||
|
||||
|
||||
}
|
||||
@ -27,9 +27,4 @@ public class ProjectImageProgressDetailReq implements Serializable {
|
||||
*/
|
||||
@NotNull(message = "进度名称不能为空")
|
||||
private String progressName;
|
||||
|
||||
/**
|
||||
* 是否查询光伏场区所有数据
|
||||
*/
|
||||
private Boolean isAll = false;
|
||||
}
|
||||
|
||||
@ -1,27 +0,0 @@
|
||||
package org.dromara.bigscreen.domain.progress;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author lilemy
|
||||
* @date 2025-12-15 17:30
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DesignProgressMajorVo {
|
||||
|
||||
/**
|
||||
* 专业名称
|
||||
*/
|
||||
private String majorName;
|
||||
|
||||
/**
|
||||
* 完成率
|
||||
*/
|
||||
private BigDecimal completionRate;
|
||||
}
|
||||
@ -1,94 +0,0 @@
|
||||
package org.dromara.bigscreen.domain.progress;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lilemy
|
||||
* @date 2025-12-15 17:07
|
||||
*/
|
||||
@Data
|
||||
public class DesignProgressVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 379443600182489913L;
|
||||
|
||||
/**
|
||||
* 总设计任务进度
|
||||
*/
|
||||
private Long totalDesignProgress;
|
||||
|
||||
/**
|
||||
* 当前设计任务进度
|
||||
*/
|
||||
private Long currentDesignProgress;
|
||||
|
||||
/**
|
||||
* 设计任务进度趋势
|
||||
*/
|
||||
private Boolean designProgressTrend;
|
||||
|
||||
/**
|
||||
* 设计任务进度环比
|
||||
*/
|
||||
private BigDecimal designProgressRate;
|
||||
|
||||
/**
|
||||
* 总设计
|
||||
*/
|
||||
private Long totalDesign;
|
||||
|
||||
/**
|
||||
* 已审核设计
|
||||
*/
|
||||
private Long reviewedDesign;
|
||||
|
||||
/**
|
||||
* 已审核设计进度趋势
|
||||
*/
|
||||
private Boolean reviewedDesignTrend;
|
||||
|
||||
/**
|
||||
* 已审核设计进度环比
|
||||
*/
|
||||
private BigDecimal reviewedDesignRate;
|
||||
|
||||
/**
|
||||
* 待审核设计
|
||||
*/
|
||||
private Long pendingDesignReview;
|
||||
|
||||
/**
|
||||
* 待审核设计进度趋势
|
||||
*/
|
||||
private Boolean pendingDesignReviewTrend;
|
||||
|
||||
/**
|
||||
* 待审核设计进度环比
|
||||
*/
|
||||
private BigDecimal pendingDesignReviewRate;
|
||||
|
||||
/**
|
||||
* 已逾期设计
|
||||
*/
|
||||
private Long delayedDesign;
|
||||
|
||||
/**
|
||||
* 已逾期设计进度趋势
|
||||
*/
|
||||
private Boolean delayedDesignTrend;
|
||||
|
||||
/**
|
||||
* 已逾期设计进度环比
|
||||
*/
|
||||
private BigDecimal delayedDesignRate;
|
||||
|
||||
/**
|
||||
* 设计专业详情
|
||||
*/
|
||||
List<DesignProgressMajorVo> majorList;
|
||||
}
|
||||
@ -1,73 +0,0 @@
|
||||
package org.dromara.bigscreen.domain.progress;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* @author lilemy
|
||||
* @date 2025-12-16 17:03
|
||||
*/
|
||||
@Data
|
||||
public class MaterialProgressDetailVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -4499381537680421083L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private BigDecimal quantity;
|
||||
|
||||
/**
|
||||
* 验收
|
||||
*/
|
||||
private BigDecimal acceptedQuantity;
|
||||
|
||||
/**
|
||||
* 缺件
|
||||
*/
|
||||
private BigDecimal shortageQuantity;
|
||||
|
||||
// region 接收单数据
|
||||
|
||||
/**
|
||||
* 表单编号
|
||||
*/
|
||||
private String formCode;
|
||||
|
||||
/**
|
||||
* 合同名称
|
||||
*/
|
||||
private String contractName;
|
||||
|
||||
/**
|
||||
* 订货单位
|
||||
*/
|
||||
private String orderingUnit;
|
||||
|
||||
/**
|
||||
* 供货单位
|
||||
*/
|
||||
private String supplierUnit;
|
||||
|
||||
/**
|
||||
* 到货时间
|
||||
*/
|
||||
private LocalDate arrivalDate;
|
||||
|
||||
// endregion
|
||||
}
|
||||
@ -1,64 +0,0 @@
|
||||
package org.dromara.bigscreen.domain.progress;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* @author lilemy
|
||||
* @date 2025-12-15 16:15
|
||||
*/
|
||||
@Data
|
||||
public class MilestoneProgressVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 5731146976460407811L;
|
||||
|
||||
/**
|
||||
* 主键 ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 节点名称
|
||||
*/
|
||||
private String nodeName;
|
||||
|
||||
/**
|
||||
* 对应项目结构
|
||||
*/
|
||||
private Long projectStructure;
|
||||
|
||||
/**
|
||||
* 对应项目结构名称
|
||||
*/
|
||||
private String projectStructureName;
|
||||
|
||||
/**
|
||||
* 预计开始时间
|
||||
*/
|
||||
private LocalDate planStartDate;
|
||||
|
||||
/**
|
||||
* 预计结束时间
|
||||
*/
|
||||
private LocalDate planEndDate;
|
||||
|
||||
/**
|
||||
* 实际开始时间
|
||||
*/
|
||||
private LocalDate practicalStartDate;
|
||||
|
||||
/**
|
||||
* 实际结束时间
|
||||
*/
|
||||
private LocalDate practicalEndDate;
|
||||
|
||||
/**
|
||||
* 当前进度
|
||||
*/
|
||||
private BigDecimal currentProgress;
|
||||
}
|
||||
@ -1,37 +0,0 @@
|
||||
package org.dromara.bigscreen.domain.progress;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author lilemy
|
||||
* @date 2025-12-15 14:40
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ProjectTotalProgressDetailVo {
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 实际进度
|
||||
*/
|
||||
private BigDecimal actualProgress;
|
||||
|
||||
/**
|
||||
* 计划进度
|
||||
*/
|
||||
private BigDecimal planProgress;
|
||||
|
||||
/**
|
||||
* 完成率
|
||||
*/
|
||||
private BigDecimal completionRate;
|
||||
}
|
||||
@ -1,49 +0,0 @@
|
||||
package org.dromara.bigscreen.domain.progress;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lilemy
|
||||
* @date 2025-12-15 14:23
|
||||
*/
|
||||
@Data
|
||||
public class ProjectTotalProgressVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -5706098940478706815L;
|
||||
|
||||
/**
|
||||
* 总进度
|
||||
*/
|
||||
private BigDecimal totalProgress;
|
||||
|
||||
/**
|
||||
* 总计划工期(天)
|
||||
*/
|
||||
private Long totalPlannedDuration;
|
||||
|
||||
/**
|
||||
* 当前计划工期(天)
|
||||
*/
|
||||
private Long currentPlannedDuration;
|
||||
|
||||
/**
|
||||
* 总完成情况(万元)
|
||||
*/
|
||||
private BigDecimal totalCompletionAmount;
|
||||
|
||||
/**
|
||||
* 当前完成情况(万元)
|
||||
*/
|
||||
private BigDecimal currentCompletionAmount;
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
private List<ProjectTotalProgressDetailVo> detailList;
|
||||
}
|
||||
@ -1,103 +0,0 @@
|
||||
package org.dromara.bigscreen.domain.vo;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
import org.dromara.quality.domain.vo.qualityinspection.QltQualityInspectionVo;
|
||||
import org.dromara.safety.domain.vo.safetyinspection.HseSafetyInspectionVo;
|
||||
import org.dromara.safety.domain.vo.teammeeting.HseTeamMeetingVo;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class DpznglVo implements Serializable {
|
||||
|
||||
/**
|
||||
* 站班会
|
||||
*/
|
||||
private List<HseTeamMeetingVo> zbhList;
|
||||
|
||||
|
||||
// 质量管理
|
||||
|
||||
/**
|
||||
* 质量总数
|
||||
*/
|
||||
private Long zlZS;
|
||||
/**
|
||||
* 质量数据
|
||||
*/
|
||||
private List<QltQualityInspectionVo> zlList;
|
||||
|
||||
/**
|
||||
* 质量 专项检查
|
||||
*/
|
||||
private Long zxjcZl;
|
||||
|
||||
/**
|
||||
* 质量 定期检查
|
||||
*/
|
||||
private Long dqjcZl;
|
||||
|
||||
/**
|
||||
* 质量 日常巡检
|
||||
*/
|
||||
private Long rcxjZl;
|
||||
|
||||
/**
|
||||
* 质量 整改数量
|
||||
*/
|
||||
private Long zlZgsl;
|
||||
|
||||
/**
|
||||
* 质量数据-整改
|
||||
*/
|
||||
private List<QltQualityInspectionVo> zlZgList;
|
||||
|
||||
|
||||
|
||||
// 安全管理
|
||||
|
||||
/**
|
||||
* 安全总数
|
||||
*/
|
||||
private Long aqZS;
|
||||
/**
|
||||
* 安全数据
|
||||
*/
|
||||
private List<HseSafetyInspectionVo> aqList;
|
||||
|
||||
/**
|
||||
* 安全 专项检查
|
||||
*/
|
||||
private Long zxjcAq;
|
||||
|
||||
/**
|
||||
* 安全定期检查
|
||||
*/
|
||||
private Long dqjcAq;
|
||||
|
||||
/**
|
||||
* 安全 日常巡检
|
||||
*/
|
||||
private Long rcxjAq;
|
||||
|
||||
/**
|
||||
* 安全 整改数量
|
||||
*/
|
||||
private Long aqZgsl;
|
||||
|
||||
/**
|
||||
* 安全数据-整改
|
||||
*/
|
||||
private List<HseSafetyInspectionVo> aqZgList;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1,68 +0,0 @@
|
||||
package org.dromara.bigscreen.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class InventoryStructureAnalysisVo implements Serializable {
|
||||
|
||||
/**
|
||||
* 本月入库总价
|
||||
*/
|
||||
public BigDecimal enterTotalPrices;
|
||||
|
||||
/**
|
||||
* 上月入库总价
|
||||
*/
|
||||
public BigDecimal oldEnterTotalPrices;
|
||||
|
||||
|
||||
/**
|
||||
* 本月出库总价
|
||||
*/
|
||||
public BigDecimal leaveTotalPrices;
|
||||
|
||||
/**
|
||||
* 上月出库总价
|
||||
*/
|
||||
public BigDecimal oldLeaveTotalPrices;
|
||||
|
||||
/**
|
||||
* 库存总价
|
||||
*/
|
||||
public BigDecimal inventoryTotalPrices;
|
||||
|
||||
/**
|
||||
* 出库总价
|
||||
*/
|
||||
public BigDecimal outTotalPrices;
|
||||
|
||||
/**
|
||||
* 库存逆变器总价
|
||||
*/
|
||||
public BigDecimal inventoryInverterTotalPrices;
|
||||
|
||||
/**
|
||||
* 库存箱变总价
|
||||
*/
|
||||
public BigDecimal inventoryBoxTransformerTotalPrices;
|
||||
|
||||
/**
|
||||
* 库存光伏支架总价
|
||||
*/
|
||||
public BigDecimal inventoryPhotovoltaicSupportTotalPrices;
|
||||
|
||||
/**
|
||||
* 库存环网柜总价
|
||||
*/
|
||||
public BigDecimal inventoryCircuitBreakerTotalPrices;
|
||||
|
||||
/**
|
||||
* 当前库存总价
|
||||
*/
|
||||
public BigDecimal nowInventoryTotalPrices;
|
||||
|
||||
|
||||
}
|
||||
@ -41,11 +41,6 @@ public class ProjectImageProgressDetailVo implements Serializable {
|
||||
*/
|
||||
private BigDecimal totalProgress;
|
||||
|
||||
/**
|
||||
* 完成率
|
||||
*/
|
||||
private BigDecimal completionRate;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
|
||||
@ -1,46 +0,0 @@
|
||||
package org.dromara.bigscreen.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 仓库出入库列表
|
||||
*/
|
||||
@Data
|
||||
public class StockInAndStockOutRecordVo implements Serializable {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
public Long id;
|
||||
|
||||
/**
|
||||
* 材料名称
|
||||
*/
|
||||
public String name;
|
||||
|
||||
/**
|
||||
* 库存数量
|
||||
*/
|
||||
public Long inventoryNumber;
|
||||
/**
|
||||
* 出入库数量
|
||||
*/
|
||||
public Long inAndOutNumber;
|
||||
/**
|
||||
* 出入库类型(0、入库,1、出库)
|
||||
*/
|
||||
public String type;
|
||||
/**
|
||||
* 出入库时间
|
||||
*/
|
||||
public Date time;
|
||||
|
||||
/**
|
||||
* 操作人
|
||||
*/
|
||||
public String operator;
|
||||
|
||||
}
|
||||
@ -1,52 +0,0 @@
|
||||
package org.dromara.bigscreen.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 物资需求与实际到货对比vo
|
||||
*/
|
||||
@Data
|
||||
public class WarehouseMonitoringVo implements Serializable {
|
||||
|
||||
/**
|
||||
* 摄像头id
|
||||
*/
|
||||
public Long cameraId;
|
||||
/**
|
||||
* 仓库id
|
||||
*/
|
||||
public Long warehouseId;
|
||||
|
||||
/**
|
||||
* 仓库名称
|
||||
*/
|
||||
public String name;
|
||||
|
||||
/**
|
||||
* 摄像头序列号
|
||||
*/
|
||||
public String cameraSerial;
|
||||
|
||||
/**
|
||||
* 摄像头名称
|
||||
*/
|
||||
public String cameraName;
|
||||
|
||||
/**
|
||||
* 设备在线状态(0离线 1在线)
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 状态:0-关闭,1-开启
|
||||
*/
|
||||
private Integer enable;
|
||||
|
||||
/**
|
||||
* 摄像头最后一张抓图地址
|
||||
*/
|
||||
public String imgUrl;
|
||||
|
||||
}
|
||||
@ -1,40 +0,0 @@
|
||||
package org.dromara.bigscreen.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 设计量与到货量对比
|
||||
*/
|
||||
@Data
|
||||
public class designAndArrivalComparisonVo implements Serializable {
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
public String name;
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
public String specification;
|
||||
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
public String unit;
|
||||
|
||||
/**
|
||||
* 设计量
|
||||
*/
|
||||
public BigDecimal designTotalPrices;
|
||||
|
||||
/**
|
||||
* 到货量
|
||||
*/
|
||||
public BigDecimal arrivalTotalPrices;
|
||||
|
||||
}
|
||||
@ -1,35 +0,0 @@
|
||||
package org.dromara.bigscreen.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 物资需求与实际到货对比vo
|
||||
*/
|
||||
@Data
|
||||
public class wzxqysjdhdbVo implements Serializable {
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
public String name;
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
public String specification;
|
||||
|
||||
|
||||
/**
|
||||
* 设计量
|
||||
*/
|
||||
public BigDecimal designTotalPrices;
|
||||
|
||||
/**
|
||||
* 到货量
|
||||
*/
|
||||
public BigDecimal arrivalTotalPrices;
|
||||
|
||||
}
|
||||
@ -1,35 +0,0 @@
|
||||
package org.dromara.bigscreen.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 物资需求与实际到货对比vo
|
||||
*/
|
||||
@Data
|
||||
public class xhqsdbVo implements Serializable {
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
public String name;
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
public String specification;
|
||||
|
||||
|
||||
/**
|
||||
* 出库量
|
||||
*/
|
||||
public BigDecimal outTotalPrices;
|
||||
|
||||
/**
|
||||
* 使用量
|
||||
*/
|
||||
public BigDecimal useTotalPrices;
|
||||
|
||||
}
|
||||
@ -1,29 +0,0 @@
|
||||
package org.dromara.bigscreen.enums;
|
||||
|
||||
public enum DpEnum {
|
||||
|
||||
ZLGLLX_ZXGL("专项检查", "1"),
|
||||
ZLGLLX_DQJC("定期检查", "2"),
|
||||
ZLGLLX_RCXJ("日常巡检", "3"),
|
||||
ZLGDZT_ZG("工单状态-整改", "1"),
|
||||
RYZT_ZG("人员状态-在岗", "1"),
|
||||
RYZT_LG("工单状态-离岗", "0"),
|
||||
JSLX_AQY("角色类型-安全员", "SAFETY_OFFICER");
|
||||
|
||||
|
||||
private final String TypeName;
|
||||
|
||||
private final String TypeValue;
|
||||
|
||||
public String getTypeName() {
|
||||
return TypeName;
|
||||
}
|
||||
public String getTypeValue() {
|
||||
return TypeValue;
|
||||
}
|
||||
|
||||
DpEnum(String TypeName, String TypeValue) {
|
||||
this.TypeName = TypeName;
|
||||
this.TypeValue = TypeValue;
|
||||
}
|
||||
}
|
||||
@ -1,22 +0,0 @@
|
||||
package org.dromara.bigscreen.enums;
|
||||
|
||||
public enum WuZhiEnum {
|
||||
|
||||
LBQ("逆变器"),
|
||||
GFZJ("光伏支架"),
|
||||
XB("箱变"),
|
||||
HWG("环网柜");
|
||||
|
||||
|
||||
private final String TypeName;
|
||||
|
||||
|
||||
|
||||
public String getTypeName() {
|
||||
return TypeName;
|
||||
}
|
||||
|
||||
WuZhiEnum(String TypeName) {
|
||||
this.TypeName = TypeName;
|
||||
}
|
||||
}
|
||||
@ -1,28 +0,0 @@
|
||||
package org.dromara.bigscreen.service;
|
||||
|
||||
|
||||
import org.dromara.bigscreen.domain.bo.DpznglBo;
|
||||
import org.dromara.bigscreen.domain.vo.DpznglAqyVo;
|
||||
import org.dromara.bigscreen.domain.vo.DpznglVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 大屏-质安管理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-05
|
||||
*/
|
||||
public interface DpzaglService {
|
||||
/**
|
||||
* 查询大屏-质安管理-站班会,巡检工单,整改情况
|
||||
*/
|
||||
DpznglVo queryList(DpznglBo bo);
|
||||
|
||||
/**
|
||||
* 查询大屏-质安管理-安全员分布情况
|
||||
*/
|
||||
List<DpznglAqyVo> listByAqy(DpznglBo bo);
|
||||
|
||||
DpznglVo listByzbh(DpznglBo bo);
|
||||
}
|
||||
@ -1,45 +0,0 @@
|
||||
package org.dromara.bigscreen.service;
|
||||
|
||||
|
||||
import org.dromara.bigscreen.domain.vo.InventoryStructureAnalysisVo;
|
||||
import org.dromara.bigscreen.domain.vo.StockInAndStockOutRecordVo;
|
||||
import org.dromara.bigscreen.domain.vo.WarehouseMonitoringVo;
|
||||
import org.dromara.bigscreen.domain.vo.xhqsdbVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 物资管理大屏Service接口
|
||||
*/
|
||||
public interface IMaterialsManagementService {
|
||||
|
||||
/**
|
||||
* 库存结构分析
|
||||
* @param projectId
|
||||
* @return
|
||||
*/
|
||||
InventoryStructureAnalysisVo inventoryStructureAnalysis(Long projectId);
|
||||
|
||||
/**
|
||||
* 消耗趋势对比
|
||||
* @param projectId
|
||||
* @return
|
||||
*/
|
||||
List<xhqsdbVo> xhqsdb(Long projectId);
|
||||
|
||||
/**
|
||||
* 仓库实时监控
|
||||
* @param projectId
|
||||
* @return
|
||||
*/
|
||||
List<WarehouseMonitoringVo> warehouseMonitoring(Long projectId);
|
||||
|
||||
/**
|
||||
* 仓库出入库详情
|
||||
*
|
||||
* @param projectId
|
||||
* @param warehouseId
|
||||
* @return
|
||||
*/
|
||||
List<StockInAndStockOutRecordVo> warehouseInAndOutDetail(Long projectId, Long warehouseId);
|
||||
}
|
||||
@ -1,67 +0,0 @@
|
||||
package org.dromara.bigscreen.service;
|
||||
|
||||
import org.dromara.bigscreen.domain.dto.ProjectImageProgressDetailReq;
|
||||
import org.dromara.bigscreen.domain.progress.DesignProgressVo;
|
||||
import org.dromara.bigscreen.domain.progress.MaterialProgressDetailVo;
|
||||
import org.dromara.bigscreen.domain.progress.MilestoneProgressVo;
|
||||
import org.dromara.bigscreen.domain.progress.ProjectTotalProgressVo;
|
||||
import org.dromara.bigscreen.domain.vo.ProjectImageProgressDetailVo;
|
||||
import org.dromara.bigscreen.domain.vo.wzxqysjdhdbVo;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lilemy
|
||||
* @date 2025-12-15 14:18
|
||||
*/
|
||||
public interface ProgressBigScreenService {
|
||||
|
||||
/**
|
||||
* 获取项目总进度
|
||||
*
|
||||
* @param projectId 项目 id
|
||||
* @return 项目总进度
|
||||
*/
|
||||
ProjectTotalProgressVo getProjectTotalProgress(Long projectId);
|
||||
|
||||
/**
|
||||
* 获取施工进度详情
|
||||
*
|
||||
* @param req 请求参数
|
||||
* @return 施工进度详情
|
||||
*/
|
||||
List<ProjectImageProgressDetailVo> getProjectTotalProgressDetail(@Validated ProjectImageProgressDetailReq req);
|
||||
|
||||
/**
|
||||
* 获取里程碑进度
|
||||
*
|
||||
* @param projectId 项目 id
|
||||
* @return 里程碑进度
|
||||
*/
|
||||
List<MilestoneProgressVo> getMilestoneProgress(Long projectId);
|
||||
|
||||
/**
|
||||
* 获取设计进度
|
||||
*
|
||||
* @param projectId 项目 id
|
||||
* @return 设计进度
|
||||
*/
|
||||
DesignProgressVo getDesignProgress(Long projectId);
|
||||
|
||||
/**
|
||||
* 获取物料进度详情
|
||||
*
|
||||
* @param projectId 项目 id
|
||||
* @return 物料进度详情
|
||||
*/
|
||||
List<MaterialProgressDetailVo> getMaterialProgressDetail(Long projectId, String name, String specification);
|
||||
|
||||
/**
|
||||
* 获取物资进度
|
||||
*
|
||||
* @param projectId 项目 id
|
||||
* @return 物资进度
|
||||
*/
|
||||
List<wzxqysjdhdbVo> getMaterialProgress(Long projectId);
|
||||
}
|
||||
@ -1,244 +0,0 @@
|
||||
package org.dromara.bigscreen.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.bigscreen.domain.bo.DpznglBo;
|
||||
import org.dromara.bigscreen.domain.vo.DpznglAqyVo;
|
||||
import org.dromara.bigscreen.domain.vo.DpznglVo;
|
||||
import org.dromara.bigscreen.enums.DpEnum;
|
||||
import org.dromara.bigscreen.service.DpzaglService;
|
||||
import org.dromara.common.core.service.UserService;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.domain.GeoPoint;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.utils.JSTUtil;
|
||||
import org.dromara.gps.domain.GpsEquipmentSon;
|
||||
import org.dromara.gps.mapper.GpsEquipmentSonMapper;
|
||||
import org.dromara.gps.service.IGpsEquipmentSonService;
|
||||
import org.dromara.project.domain.BusProjectPunchrange;
|
||||
import org.dromara.project.domain.BusUserProjectRelevancy;
|
||||
import org.dromara.project.mapper.BusUserProjectRelevancyMapper;
|
||||
import org.dromara.project.service.IBusProjectPunchrangeService;
|
||||
import org.dromara.quality.domain.QltQualityInspection;
|
||||
import org.dromara.quality.domain.dto.qualityinspection.QltQualityInspectionQueryReq;
|
||||
import org.dromara.quality.domain.vo.qualityinspection.QltQualityInspectionVo;
|
||||
import org.dromara.quality.service.IQltQualityInspectionService;
|
||||
import org.dromara.safety.domain.HseSafetyInspection;
|
||||
import org.dromara.safety.domain.HseTeamMeeting;
|
||||
import org.dromara.safety.domain.dto.safetyinspection.HseSafetyInspectionQueryReq;
|
||||
import org.dromara.safety.domain.dto.teammeeting.HseTeamMeetingQueryReq;
|
||||
import org.dromara.safety.domain.vo.safetyinspection.HseSafetyInspectionVo;
|
||||
import org.dromara.safety.domain.vo.teammeeting.HseTeamMeetingVo;
|
||||
import org.dromara.safety.service.IHseSafetyInspectionService;
|
||||
import org.dromara.safety.service.IHseTeamMeetingService;
|
||||
import org.dromara.system.domain.SysRole;
|
||||
import org.dromara.system.domain.SysUserRole;
|
||||
import org.dromara.system.mapper.SysRoleMapper;
|
||||
import org.dromara.system.mapper.SysUserRoleMapper;
|
||||
import org.dromara.system.service.ISysRoleService;
|
||||
import org.dromara.system.service.ISysUserService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
* 大屏-质安管理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-05
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
@Slf4j
|
||||
public class DpzaglServiceImpl implements DpzaglService {
|
||||
|
||||
//站班会
|
||||
private final IHseTeamMeetingService teamMeetingService;
|
||||
//质量-检查工单
|
||||
private final IQltQualityInspectionService qualityInspectionService;
|
||||
|
||||
// 安全工单
|
||||
private final IHseSafetyInspectionService safetyInspectionService;
|
||||
|
||||
|
||||
private final SysRoleMapper sysRoleMapper;
|
||||
|
||||
private final UserService userService;
|
||||
|
||||
|
||||
private final SysUserRoleMapper sysUserRoleMapper;
|
||||
|
||||
|
||||
private final GpsEquipmentSonMapper gpsEquipmentSonMapper;
|
||||
|
||||
private final IBusProjectPunchrangeService busProjectPunchrangeService;
|
||||
|
||||
|
||||
private final BusUserProjectRelevancyMapper busUserProjectRelevancyMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public DpznglVo queryList(DpznglBo bo) {
|
||||
DpznglVo dpznglVo = new DpznglVo();
|
||||
PageQuery pageQuery = new PageQuery(bo.getPageSize(),bo.getPageNum());
|
||||
// 质量
|
||||
saveZl(pageQuery,dpznglVo,bo);
|
||||
// 安全
|
||||
saveAq(pageQuery,dpznglVo,bo);
|
||||
|
||||
|
||||
return dpznglVo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DpznglAqyVo> listByAqy(DpznglBo bo) {
|
||||
List<DpznglAqyVo> dpznglAqyVos = new ArrayList<>();
|
||||
if (bo == null || bo.getProjectId() == null) throw new RuntimeException("项目不能为空");
|
||||
|
||||
//// 查询该项目下的人员id
|
||||
// List<BusUserProjectRelevancy> busUserProjectRelevancies = busUserProjectRelevancyMapper.selectList(new LambdaQueryWrapper<BusUserProjectRelevancy>().eq(BusUserProjectRelevancy::getProjectId, bo.getProjectId()));
|
||||
// if (busUserProjectRelevancies == null || busUserProjectRelevancies.size() == 0){
|
||||
// return dpznglAqyVos;
|
||||
// }
|
||||
|
||||
// 查询拥有安全员的角色
|
||||
List<SysRole> sysRoles = sysRoleMapper.selectList(new LambdaQueryWrapper<SysRole>().eq(SysRole::getRoleIdentity, DpEnum.JSLX_AQY.getTypeValue()));
|
||||
if (sysRoles == null || sysRoles.size() == 0){
|
||||
return dpznglAqyVos;
|
||||
}
|
||||
|
||||
// 根据角色查询人员
|
||||
List<Long> roles = sysRoles.stream().map(SysRole::getRoleId).collect(Collectors.toList());
|
||||
List<SysUserRole> sysUserRoles = sysUserRoleMapper.selectList(new LambdaQueryWrapper<SysUserRole>().in(SysUserRole::getRoleId, roles).groupBy(SysUserRole::getUserId));
|
||||
if (sysUserRoles == null && sysUserRoles.size() == 0){
|
||||
return dpznglAqyVos;
|
||||
}
|
||||
|
||||
// 查询人员的最新经纬度
|
||||
List<Long> collect = sysUserRoles.stream().map(SysUserRole::getUserId).collect(Collectors.toList());
|
||||
if (collect == null || collect.size() == 0){
|
||||
return dpznglAqyVos;
|
||||
}
|
||||
List<GpsEquipmentSon> temp = gpsEquipmentSonMapper.listByAqy(collect,bo.getProjectId());
|
||||
if (temp != null && temp.size() > 0){
|
||||
// 回填数据
|
||||
dpznglAqyVos = temp.stream().map(gpsEquipmentSon -> {
|
||||
DpznglAqyVo dpznglAqyVo = new DpznglAqyVo();
|
||||
dpznglAqyVo.setUserId(gpsEquipmentSon.getUserId());
|
||||
dpznglAqyVo.setLocLatitude(gpsEquipmentSon.getLocLatitude());
|
||||
dpznglAqyVo.setLocLongitude(gpsEquipmentSon.getLocLongitude());
|
||||
return dpznglAqyVo;
|
||||
}).collect(Collectors.toList());
|
||||
// 判断是否离岗
|
||||
judgeFw(dpznglAqyVos,bo.getProjectId());
|
||||
}
|
||||
|
||||
return dpznglAqyVos;
|
||||
}
|
||||
|
||||
private void judgeFw(List<DpznglAqyVo> dpznglAqyVos, Long projectId) {
|
||||
// 获取该项目的打卡范围
|
||||
List<BusProjectPunchrange> busProjectPunchranges = busProjectPunchrangeService.getBaseMapper().selectList(new LambdaQueryWrapper<BusProjectPunchrange>().eq(BusProjectPunchrange::getProjectId, projectId));
|
||||
if (busProjectPunchranges == null || busProjectPunchranges.size() == 0){
|
||||
return;
|
||||
}
|
||||
//判断是否在岗
|
||||
for (DpznglAqyVo dpznglAqyVo : dpznglAqyVos) {
|
||||
dpznglAqyVo.setSfzg(DpEnum.RYZT_LG.getTypeValue());
|
||||
dpznglAqyVo.setUserName(userService.selectNicknameByIds(dpznglAqyVo.getUserId().toString()));
|
||||
for (BusProjectPunchrange busProjectPunchrange : busProjectPunchranges) {
|
||||
List<String> coordinates = List.of(busProjectPunchrange.getPunchRange());
|
||||
List<GeoPoint> matchingRange = JSTUtil.findMatchingRange(dpznglAqyVo.getLocLatitude().toString(), dpznglAqyVo.getLocLongitude().toString(), coordinates);
|
||||
if (matchingRange != null && matchingRange.size() > 0){
|
||||
dpznglAqyVo.setSfzg(DpEnum.RYZT_ZG.getTypeValue());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public DpznglVo listByzbh(DpznglBo bo) {
|
||||
DpznglVo dpznglVo = new DpznglVo();
|
||||
|
||||
// 站班会
|
||||
HseTeamMeetingQueryReq hseTeamMeetingQueryReq = new HseTeamMeetingQueryReq();
|
||||
// List<HseTeamMeetingVo> hseTeamMeetingVos = teamMeetingService.queryList(hseTeamMeetingQueryReq);
|
||||
List<HseTeamMeeting> hseTeamMeetings = teamMeetingService.getBaseMapper().selectList(new LambdaQueryWrapper<HseTeamMeeting>().eq(HseTeamMeeting::getProjectId, bo.getProjectId()));
|
||||
dpznglVo.setZbhList(MapstructUtils.convert(hseTeamMeetings, HseTeamMeetingVo.class));
|
||||
dpznglVo.getZbhList().forEach(hseTeamMeetingVo -> {if ( hseTeamMeetingVo.getCompereId() != null){hseTeamMeetingVo.setCompereName(userService.selectNicknameByIds(hseTeamMeetingVo.getCompereId().toString()));}});
|
||||
return dpznglVo;
|
||||
}
|
||||
|
||||
|
||||
private void saveAq(PageQuery pageQuery, DpznglVo dpznglVo,DpznglBo bo) {
|
||||
|
||||
// 安全 巡检工单,整改情况
|
||||
HseSafetyInspectionQueryReq req = new HseSafetyInspectionQueryReq();
|
||||
// 质量展示数据
|
||||
// TableDataInfo<HseSafetyInspectionVo> anList = safetyInspectionService.queryPageList(req, pageQuery);
|
||||
// 质量展示数据-整改
|
||||
// req.setStatus(DpEnum.ZLGDZT_ZG.getTypeValue());
|
||||
// TableDataInfo<HseSafetyInspectionVo> aqZgList = safetyInspectionService.queryPageList(req, pageQuery);
|
||||
// 安全总数(用于判断巡检类型)
|
||||
List<HseSafetyInspection> list = safetyInspectionService.list(new LambdaQueryWrapper<HseSafetyInspection>().eq(HseSafetyInspection::getProjectId, bo.getProjectId()).ge(bo.getStartDate() != null ,HseSafetyInspection::getCreateTime, bo.getStartDate()).le(bo.getEndDate() != null ,HseSafetyInspection::getCreateTime, bo.getEndDate()));
|
||||
|
||||
// List<HseSafetyInspectionVo> rows = anList.getRows();
|
||||
|
||||
if (list != null && list.size() > 0){
|
||||
dpznglVo.setAqZS(Long.valueOf(list.size()));
|
||||
dpznglVo.setAqList(MapstructUtils.convert(list, HseSafetyInspectionVo.class));
|
||||
dpznglVo.getAqList().forEach(zl ->{zl.setCreatorName(userService.selectNicknameByIds(zl.getCreateBy().toString()));});
|
||||
dpznglVo.setZxjcAq(list.stream().filter(zl -> DpEnum.ZLGLLX_ZXGL.getTypeValue().equals(zl.getCheckType())).count());
|
||||
dpznglVo.setDqjcAq(list.stream().filter(zl -> DpEnum.ZLGLLX_DQJC.getTypeValue().equals(zl.getCheckType())).count());
|
||||
dpznglVo.setRcxjAq(list.stream().filter(zl -> DpEnum.ZLGLLX_RCXJ.getTypeValue().equals(zl.getCheckType())).count());
|
||||
dpznglVo.setAqZgsl(list.stream().filter(zl -> DpEnum.ZLGDZT_ZG.getTypeValue().equals(zl.getReviewType())).count());
|
||||
List<HseSafetyInspectionVo> convert = MapstructUtils.convert(list.stream().filter(zl -> DpEnum.ZLGDZT_ZG.getTypeValue().equals(zl.getReviewType())).collect(Collectors.toList()), HseSafetyInspectionVo.class);
|
||||
convert.forEach(zl ->{if (zl.getCorrectorId() != null)zl.setCorrectorName(userService.selectNicknameByIds(zl.getCorrectorId().toString()));});
|
||||
dpznglVo.setAqZgList(convert);
|
||||
}
|
||||
// if (aqZgList.getRows() != null && aqZgList.getRows().size() > 0){
|
||||
// aqZgList.getRows().forEach(zl ->{if (zl.getCorrectorId() != null){zl.setCorrectorName(userService.selectNicknameByIds(zl.getCorrectorId().toString()));}});
|
||||
// dpznglVo.setAqZgList(aqZgList.getRows());
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void saveZl(PageQuery pageQuery,DpznglVo dpznglVo,DpznglBo bo) {
|
||||
|
||||
// 质量 巡检工单,整改情况
|
||||
QltQualityInspectionQueryReq req = new QltQualityInspectionQueryReq();
|
||||
|
||||
//// 质量展示数据
|
||||
// TableDataInfo<QltQualityInspectionVo> zlLists = qualityInspectionService.queryPageList(req, pageQuery);
|
||||
// 质量展示数据-整改
|
||||
// req.setInspectionStatus(DpEnum.ZLGDZT_ZG.getTypeValue());
|
||||
// TableDataInfo<QltQualityInspectionVo> zlZgLists = qualityInspectionService.queryPageList(req, pageQuery);
|
||||
// 质量总数
|
||||
List<QltQualityInspection> zsZl = qualityInspectionService.getBaseMapper()
|
||||
.selectList(new LambdaQueryWrapper<QltQualityInspection>().eq(QltQualityInspection::getProjectId, bo.getProjectId())
|
||||
.ge(bo.getStartDate() != null ,QltQualityInspection::getCreateTime, bo.getStartDate()).le(bo.getEndDate() != null ,QltQualityInspection::getCreateTime, bo.getEndDate()));
|
||||
|
||||
|
||||
// List<QltQualityInspectionVo> rows = zlLists.getRows();
|
||||
if (zsZl != null && zsZl.size() > 0){
|
||||
dpznglVo.setZlZS(Long.valueOf(zsZl.size()));
|
||||
dpznglVo.setZlList(MapstructUtils.convert(zsZl, QltQualityInspectionVo.class));
|
||||
dpznglVo.getZlList().forEach(zl ->{zl.setCreateByName(userService.selectNicknameByIds(zl.getCreateBy().toString()));});
|
||||
dpznglVo.setZxjcZl(zsZl.stream().filter(zl -> DpEnum.ZLGLLX_ZXGL.getTypeValue().equals(zl.getInspectionType())).count());
|
||||
dpznglVo.setDqjcZl(zsZl.stream().filter(zl -> DpEnum.ZLGLLX_DQJC.getTypeValue().equals(zl.getInspectionType())).count());
|
||||
dpznglVo.setRcxjZl(zsZl.stream().filter(zl -> DpEnum.ZLGLLX_RCXJ.getTypeValue().equals(zl.getInspectionType())).count());
|
||||
dpznglVo.setZlZgsl(zsZl.stream().filter(zl -> DpEnum.ZLGDZT_ZG.getTypeValue().equals(zl.getVerificationType())).count());
|
||||
List<QltQualityInspection> collect = zsZl.stream().filter(zl -> DpEnum.ZLGDZT_ZG.getTypeValue().equals(zl.getVerificationType())).collect(Collectors.toList());
|
||||
List<QltQualityInspectionVo> convert = MapstructUtils.convert(collect, QltQualityInspectionVo.class);
|
||||
convert.forEach(zl ->{if (zl.getCorrectorId() != null)zl.setCorrectorName(userService.selectNicknameByIds(zl.getCorrectorId().toString()));});
|
||||
dpznglVo.setZlZgList(convert);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,431 +0,0 @@
|
||||
package org.dromara.bigscreen.service.impl;
|
||||
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.dromara.bigscreen.domain.vo.InventoryStructureAnalysisVo;
|
||||
import org.dromara.bigscreen.domain.vo.StockInAndStockOutRecordVo;
|
||||
import org.dromara.bigscreen.domain.vo.WarehouseMonitoringVo;
|
||||
import org.dromara.bigscreen.domain.vo.xhqsdbVo;
|
||||
import org.dromara.bigscreen.enums.WuZhiEnum;
|
||||
import org.dromara.bigscreen.service.IMaterialsManagementService;
|
||||
import org.dromara.materials.domain.*;
|
||||
import org.dromara.materials.service.*;
|
||||
import org.dromara.other.domain.OthYs7Device;
|
||||
import org.dromara.other.domain.OthYs7DeviceImg;
|
||||
import org.dromara.other.service.IOthYs7DeviceImgService;
|
||||
import org.dromara.other.service.IOthYs7DeviceService;
|
||||
import org.dromara.tender.domain.BusBillofquantitiesLimitList;
|
||||
import org.dromara.tender.service.IBusBillofquantitiesLimitListService;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.temporal.TemporalAdjusters;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class MaterialsManagementServiceImpl implements IMaterialsManagementService {
|
||||
|
||||
@Lazy
|
||||
@Resource
|
||||
private IMatMaterialReceiveItemService materialReceiveItemService;
|
||||
|
||||
@Lazy
|
||||
@Resource
|
||||
private IMatMaterialIssueItemService materialIssueItemService;
|
||||
|
||||
@Lazy
|
||||
@Resource
|
||||
private IMatMaterialsService materialsService;
|
||||
@Lazy
|
||||
@Resource
|
||||
private IBusBillofquantitiesLimitListService billofquantitiesLimitListService;
|
||||
@Lazy
|
||||
@Resource
|
||||
private IMatMaterialsInventoryService materialsInventoryService;
|
||||
@Lazy
|
||||
@Resource
|
||||
private IMatMaterialsUseRecordService matMaterialsUseRecordService;
|
||||
@Lazy
|
||||
@Resource
|
||||
private IMatMaterialIssueService materialIssueService;
|
||||
|
||||
@Resource
|
||||
private IMatWarehouseService warehouseService;
|
||||
@Lazy
|
||||
@Resource
|
||||
private IMatWarehouseCameraService warehouseCameraService;
|
||||
@Lazy
|
||||
@Resource
|
||||
private IOthYs7DeviceService othYs7DeviceService;
|
||||
@Lazy
|
||||
@Resource
|
||||
private IOthYs7DeviceImgService ys7DeviceImgService;
|
||||
@Lazy
|
||||
@Resource
|
||||
private IMatMaterialReceiveService materialReceiveService;
|
||||
|
||||
|
||||
@Override
|
||||
public InventoryStructureAnalysisVo inventoryStructureAnalysis(Long projectId) {
|
||||
InventoryStructureAnalysisVo vo = new InventoryStructureAnalysisVo();
|
||||
// 获取当月第一天
|
||||
LocalDateTime monthStart = LocalDateTime.now()
|
||||
// 调整到当月第一天
|
||||
.with(TemporalAdjusters.firstDayOfMonth())
|
||||
// 重置时分秒毫秒为0
|
||||
.withHour(0)
|
||||
.withMinute(0)
|
||||
.withSecond(0)
|
||||
.withNano(0);
|
||||
// 获取当前时间
|
||||
LocalDateTime currentTime = LocalDateTime.now();
|
||||
// 获取上月第一天
|
||||
LocalDateTime lastMonthFirstDay = LocalDateTime.now()
|
||||
// 先回退一个月
|
||||
.minusMonths(1)
|
||||
// 调整到当月第一天
|
||||
.with(TemporalAdjusters.firstDayOfMonth())
|
||||
// 重置时间为 00:00:00.000000000
|
||||
.withHour(0)
|
||||
.withMinute(0)
|
||||
.withSecond(0);
|
||||
// 获取上月最后一天
|
||||
LocalDateTime lastMonthLastDay = LocalDateTime.now()
|
||||
// 先回退一个月
|
||||
.minusMonths(1)
|
||||
// 调整到当月最后一天
|
||||
.with(TemporalAdjusters.lastDayOfMonth())
|
||||
// 设置时间为 23:59:59.999999999(纳秒最大值,对应毫秒级的999)
|
||||
.withHour(23)
|
||||
.withMinute(59)
|
||||
.withSecond(59);
|
||||
// 获取当月入库数据
|
||||
List<MatMaterialReceiveItem> matMaterialReceiveItems = materialReceiveItemService.getBaseMapper().selectList(new LambdaQueryWrapper<MatMaterialReceiveItem>()
|
||||
.eq(MatMaterialReceiveItem::getProjectId, projectId)
|
||||
.ne(MatMaterialReceiveItem::getAcceptedQuantity, BigDecimal.ZERO)
|
||||
.between(MatMaterialReceiveItem::getCreateTime, monthStart, currentTime));
|
||||
if (CollUtil.isEmpty(matMaterialReceiveItems)) {
|
||||
vo.setEnterTotalPrices(BigDecimal.ZERO);
|
||||
} else {
|
||||
// 计算本月入库金额
|
||||
BigDecimal enterTotalPrices = matMaterialReceiveItems.stream()
|
||||
.map(item -> item.getAcceptedQuantity().multiply(item.getUnitPrice() != null ? item.getUnitPrice() : BigDecimal.ZERO))
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
vo.setEnterTotalPrices(enterTotalPrices.setScale(4, BigDecimal.ROUND_HALF_UP));
|
||||
}
|
||||
// 获取上月入库数据
|
||||
List<MatMaterialReceiveItem> oldMatMaterialReceiveItems = materialReceiveItemService.getBaseMapper().selectList(new LambdaQueryWrapper<MatMaterialReceiveItem>()
|
||||
.eq(MatMaterialReceiveItem::getProjectId, projectId)
|
||||
.ne(MatMaterialReceiveItem::getAcceptedQuantity, BigDecimal.ZERO)
|
||||
.between(MatMaterialReceiveItem::getCreateTime, lastMonthFirstDay, lastMonthLastDay));
|
||||
if (CollUtil.isEmpty(oldMatMaterialReceiveItems)) {
|
||||
vo.setOldEnterTotalPrices(BigDecimal.ZERO);
|
||||
} else {
|
||||
// 计算上月入库金额
|
||||
BigDecimal oldEnterTotalPrices = oldMatMaterialReceiveItems.stream()
|
||||
.map(item -> item.getAcceptedQuantity().multiply(item.getUnitPrice() != null ? item.getUnitPrice() : BigDecimal.ZERO))
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
vo.setOldEnterTotalPrices(oldEnterTotalPrices.setScale(4, BigDecimal.ROUND_HALF_UP));
|
||||
}
|
||||
// 获取当月出库数据
|
||||
List<MatMaterialIssueItem> matMaterialIssueItems = materialIssueItemService.getBaseMapper()
|
||||
.selectList(new LambdaQueryWrapper<MatMaterialIssueItem>()
|
||||
.eq(MatMaterialIssueItem::getProjectId, projectId)
|
||||
.ne(MatMaterialIssueItem::getIssuedQuantity, BigDecimal.ZERO)
|
||||
.between(MatMaterialIssueItem::getCreateTime, monthStart, currentTime));
|
||||
|
||||
//计算本月出库金额
|
||||
if (CollUtil.isEmpty(matMaterialIssueItems)) {
|
||||
vo.setLeaveTotalPrices(BigDecimal.ZERO);
|
||||
} else {
|
||||
BigDecimal leaveTotalPrices = matMaterialIssueItems.stream()
|
||||
.map(item -> item.getIssuedQuantity().multiply(item.getUnitPrice() != null ? item.getUnitPrice() : BigDecimal.ZERO))
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
vo.setLeaveTotalPrices(leaveTotalPrices.setScale(4, BigDecimal.ROUND_HALF_UP));
|
||||
}
|
||||
// 获取上月出库数据
|
||||
List<MatMaterialIssueItem> oldMatMaterialIssueItems = materialIssueItemService.getBaseMapper()
|
||||
.selectList(new LambdaQueryWrapper<MatMaterialIssueItem>()
|
||||
.eq(MatMaterialIssueItem::getProjectId, projectId)
|
||||
.ne(MatMaterialIssueItem::getIssuedQuantity, BigDecimal.ZERO)
|
||||
.between(MatMaterialIssueItem::getCreateTime, lastMonthFirstDay, lastMonthLastDay));
|
||||
//计算上月出库金额
|
||||
if (CollUtil.isEmpty(oldMatMaterialIssueItems)) {
|
||||
vo.setOldLeaveTotalPrices(BigDecimal.ZERO);
|
||||
} else {
|
||||
BigDecimal oldLeaveTotalPrices = oldMatMaterialIssueItems.stream()
|
||||
.map(item -> item.getIssuedQuantity().multiply(item.getUnitPrice() != null ? item.getUnitPrice() : BigDecimal.ZERO))
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
vo.setOldLeaveTotalPrices(oldLeaveTotalPrices.setScale(4, BigDecimal.ROUND_HALF_UP));
|
||||
}
|
||||
//获取总入库存金额 入库 * 单价
|
||||
List<MatMaterialReceiveItem> totalMatMaterialReceiveItems = materialReceiveItemService.getBaseMapper().selectList(new LambdaQueryWrapper<MatMaterialReceiveItem>().eq(MatMaterialReceiveItem::getProjectId, projectId));
|
||||
if (CollUtil.isEmpty(totalMatMaterialReceiveItems)) {
|
||||
vo.setInventoryTotalPrices(BigDecimal.ZERO);
|
||||
} else {
|
||||
// 计算总入库存金额
|
||||
BigDecimal inventoryTotalPrices = totalMatMaterialReceiveItems.stream()
|
||||
.map(item -> item.getAcceptedQuantity().multiply(item.getUnitPrice() != null ? item.getUnitPrice() : BigDecimal.ZERO))
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
vo.setInventoryTotalPrices(inventoryTotalPrices.setScale(4, BigDecimal.ROUND_HALF_UP));
|
||||
}
|
||||
|
||||
// 获取总出库金额 出库 * 单价
|
||||
List<MatMaterialIssueItem> totalMatMaterialIssueItems = materialIssueItemService.getBaseMapper().selectList(new LambdaQueryWrapper<MatMaterialIssueItem>().eq(MatMaterialIssueItem::getProjectId, projectId));
|
||||
if (CollUtil.isEmpty(totalMatMaterialIssueItems)) {
|
||||
vo.setOutTotalPrices(BigDecimal.ZERO);
|
||||
} else {
|
||||
// 计算总出库金额
|
||||
BigDecimal outTotalPrices = totalMatMaterialIssueItems.stream()
|
||||
.map(item -> item.getIssuedQuantity().multiply(item.getUnitPrice() != null ? item.getUnitPrice() : BigDecimal.ZERO))
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
vo.setOutTotalPrices(outTotalPrices.setScale(4, BigDecimal.ROUND_HALF_UP));
|
||||
}
|
||||
|
||||
|
||||
// 获取施工图一览大类名下所有小类名
|
||||
List<BusBillofquantitiesLimitList> limitLists = billofquantitiesLimitListService.getBaseMapper().selectList(new LambdaQueryWrapper<BusBillofquantitiesLimitList>()
|
||||
.eq(BusBillofquantitiesLimitList::getProjectId, projectId)
|
||||
.eq(BusBillofquantitiesLimitList::getPid, "0")
|
||||
.eq(BusBillofquantitiesLimitList::getType, "3")
|
||||
.eq(BusBillofquantitiesLimitList::getName, WuZhiEnum.LBQ.getTypeName()).or()
|
||||
.eq(BusBillofquantitiesLimitList::getName, WuZhiEnum.GFZJ.getTypeName()).or()
|
||||
.eq(BusBillofquantitiesLimitList::getName, WuZhiEnum.XB.getTypeName()).or()
|
||||
.eq(BusBillofquantitiesLimitList::getName, WuZhiEnum.HWG.getTypeName())
|
||||
);
|
||||
List<String> lBQNames = new ArrayList<>();
|
||||
List<String> sFZJNames = new ArrayList<>();
|
||||
List<String> xBNames = new ArrayList<>();
|
||||
List<String> hWGNames = new ArrayList<>();
|
||||
for (BusBillofquantitiesLimitList item : limitLists) {
|
||||
if (item.getName().equals(WuZhiEnum.LBQ.getTypeName())) {
|
||||
lBQNames.add(item.getName());
|
||||
continue;
|
||||
}
|
||||
if (item.getName().equals(WuZhiEnum.GFZJ.getTypeName())) {
|
||||
sFZJNames.add(item.getName());
|
||||
continue;
|
||||
}
|
||||
if (item.getName().equals(WuZhiEnum.XB.getTypeName())) {
|
||||
xBNames.add(item.getName());
|
||||
continue;
|
||||
}
|
||||
if (item.getName().equals(WuZhiEnum.HWG.getTypeName())) {
|
||||
hWGNames.add(item.getName());
|
||||
}
|
||||
}
|
||||
//获取库存逆变器总价
|
||||
BigDecimal inventoryInverterTotalPrices = materialsService.selectTotalPricesByNames(projectId, lBQNames);
|
||||
vo.setInventoryInverterTotalPrices(inventoryInverterTotalPrices);
|
||||
//获取库存箱变总价
|
||||
BigDecimal inventoryBoxTransformerTotalPrices = materialsService.selectTotalPricesByNames(projectId, xBNames);
|
||||
vo.setInventoryBoxTransformerTotalPrices(inventoryBoxTransformerTotalPrices);
|
||||
//获取库存光伏支架总价
|
||||
BigDecimal inventoryPhotovoltaicSupportTotalPrices = materialsService.selectTotalPricesByNames(projectId, sFZJNames);
|
||||
vo.setInventoryPhotovoltaicSupportTotalPrices(inventoryPhotovoltaicSupportTotalPrices);
|
||||
//获取库存环网柜总价
|
||||
BigDecimal inventoryCircuitBreakerTotalPrices = materialsService.selectTotalPricesByNames(projectId, hWGNames);
|
||||
vo.setInventoryCircuitBreakerTotalPrices(inventoryCircuitBreakerTotalPrices);
|
||||
//获取当前库存总价
|
||||
BigDecimal nowInventoryTotalPrices = materialsService.selectTotalPrices(projectId);
|
||||
vo.setNowInventoryTotalPrices(nowInventoryTotalPrices);
|
||||
return vo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 消耗趋势对比
|
||||
*
|
||||
* @param projectId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<xhqsdbVo> xhqsdb(Long projectId) {
|
||||
List<xhqsdbVo> list = new ArrayList<>();
|
||||
//获取出库记录
|
||||
List<MatMaterialIssue> issuesList = materialIssueService.getBaseMapper()
|
||||
.selectList(new LambdaQueryWrapper<MatMaterialIssue>()
|
||||
.eq(MatMaterialIssue::getProjectId, projectId)
|
||||
.eq(MatMaterialIssue::getMaterialSource, "1"));
|
||||
if (CollUtil.isEmpty(issuesList)) {
|
||||
return List.of();
|
||||
}
|
||||
Set<Long> issueIds = issuesList.stream().map(MatMaterialIssue::getId).collect(Collectors.toSet());
|
||||
if (CollUtil.isEmpty(issueIds)){
|
||||
return List.of();
|
||||
}
|
||||
//获取领料明细列表
|
||||
List<MatMaterialIssueItem> issueItems = materialIssueItemService.getBaseMapper().selectList(new LambdaQueryWrapper<MatMaterialIssueItem>()
|
||||
.in(MatMaterialIssueItem::getIssueId, issueIds));
|
||||
if (CollUtil.isEmpty(issueItems)){
|
||||
return List.of();
|
||||
}
|
||||
Set<Long> iIds = issueItems.stream().filter(item -> item.getInventoryId() != null).map(MatMaterialIssueItem::getInventoryId).collect(Collectors.toSet());
|
||||
if (CollUtil.isEmpty(iIds)){
|
||||
return List.of();
|
||||
}
|
||||
//获取出入库表中出库记录
|
||||
List<MatMaterialsInventory> inventories = materialsInventoryService.getBaseMapper()
|
||||
.selectList(new LambdaQueryWrapper<MatMaterialsInventory>()
|
||||
.in(MatMaterialsInventory::getId, iIds));
|
||||
if (CollUtil.isEmpty(inventories)) {
|
||||
return List.of();
|
||||
}
|
||||
//获取每个材料的库存数量
|
||||
HashMap<Long, BigDecimal> inventoryHashMap = new HashMap<>();
|
||||
inventories.forEach(item -> {
|
||||
if (inventoryHashMap.containsKey(item.getMaterialsId())){
|
||||
inventoryHashMap.put(item.getMaterialsId(), inventoryHashMap.get(item.getMaterialsId()).add(new BigDecimal(item.getNumber())));
|
||||
}else {
|
||||
inventoryHashMap.put(item.getMaterialsId(), new BigDecimal(item.getNumber()));
|
||||
}
|
||||
});
|
||||
Set<Long> mids = inventories.stream().filter(item -> item.getMaterialsId() != null).map(MatMaterialsInventory::getMaterialsId).collect(Collectors.toSet());
|
||||
if (CollUtil.isEmpty(mids)){
|
||||
return List.of();
|
||||
}
|
||||
//获取材料名称列表
|
||||
List<MatMaterials> materials = materialsService.getBaseMapper().selectList(new LambdaQueryWrapper<MatMaterials>()
|
||||
.eq(MatMaterials::getProjectId, projectId)
|
||||
.in(MatMaterials::getId, mids));
|
||||
if (CollUtil.isEmpty(materials)) {
|
||||
return List.of();
|
||||
}
|
||||
//获取材料名称
|
||||
Map<Long, String> map1 = materials.stream()
|
||||
.collect(Collectors.toMap(MatMaterials::getId, MatMaterials::getMaterialsName));
|
||||
//获取所有出入库记录id
|
||||
Set<Long> ids = inventories.stream()
|
||||
.map(MatMaterialsInventory::getId)
|
||||
.collect(Collectors.toSet());
|
||||
if (CollUtil.isEmpty(ids)) {
|
||||
return List.of();
|
||||
}
|
||||
//根据出入库id获取使用记录
|
||||
List<MatMaterialsUseRecord> useRecords = matMaterialsUseRecordService.getBaseMapper()
|
||||
.selectList(new LambdaQueryWrapper<MatMaterialsUseRecord>()
|
||||
.eq(MatMaterialsUseRecord::getProjectId, projectId)
|
||||
.in(MatMaterialsUseRecord::getInventoryId, ids));
|
||||
Map<Long, BigDecimal> map = useRecords.stream()
|
||||
.collect(Collectors.groupingBy(
|
||||
MatMaterialsUseRecord::getInventoryId,
|
||||
Collectors.reducing(BigDecimal.ZERO, MatMaterialsUseRecord::getUseNumber, BigDecimal::add)
|
||||
));
|
||||
inventoryHashMap.forEach((key, value) -> {
|
||||
xhqsdbVo vo = new xhqsdbVo();
|
||||
vo.setName(map1.get(key));
|
||||
vo.setOutTotalPrices( value);
|
||||
vo.setUseTotalPrices(map.getOrDefault(key, BigDecimal.ZERO));
|
||||
list.add(vo);
|
||||
});
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WarehouseMonitoringVo> warehouseMonitoring(Long projectId) {
|
||||
List<WarehouseMonitoringVo> list = new ArrayList<>();
|
||||
//根据项目id获取仓库列表
|
||||
List<MatWarehouse> warehouseList = warehouseService.getBaseMapper().selectList(new LambdaQueryWrapper<MatWarehouse>()
|
||||
.eq(MatWarehouse::getProjectId, projectId));
|
||||
//构建仓库id与仓库对象映射
|
||||
if (CollUtil.isEmpty(warehouseList)){
|
||||
return list;
|
||||
}
|
||||
Map<Long, MatWarehouse> warehouseMap = warehouseList.stream().collect(Collectors.toMap(MatWarehouse::getId, item -> item));
|
||||
//根据仓库列表获取仓库id
|
||||
Set<Long> warehouseIds = warehouseList.stream().map(MatWarehouse::getId).collect(Collectors.toSet());
|
||||
//根据仓库id获取摄像头id列表
|
||||
List<MatWarehouseCamera> warehouseCameraList = warehouseCameraService.getBaseMapper().selectList(new LambdaQueryWrapper<MatWarehouseCamera>()
|
||||
.in(MatWarehouseCamera::getWarehouseId, warehouseIds));
|
||||
if (CollUtil.isEmpty(warehouseCameraList)){
|
||||
return list;
|
||||
}
|
||||
Set<Long> cameraIds = warehouseCameraList.stream().filter(item -> item.getCameraId() != null).map(MatWarehouseCamera::getCameraId).collect(Collectors.toSet());
|
||||
//生成摄像头与仓库关系
|
||||
Map<Long, Long> warehouseCameraMap = warehouseCameraList.stream().collect(Collectors.toMap(MatWarehouseCamera::getCameraId, MatWarehouseCamera::getWarehouseId));
|
||||
//根据摄像头id列表获取摄像头列表
|
||||
List<OthYs7Device> cameraList = othYs7DeviceService.getBaseMapper()
|
||||
.selectList(new LambdaQueryWrapper<OthYs7Device>()
|
||||
.in(OthYs7Device::getId, cameraIds));
|
||||
if (CollUtil.isEmpty(cameraList)){
|
||||
return list;
|
||||
}
|
||||
//获取摄像头最后一张抓拍图片
|
||||
Set<String> deviceSerialSet = cameraList.stream().map(OthYs7Device::getDeviceSerial).collect(Collectors.toSet());
|
||||
List<OthYs7DeviceImg> deviceImgs = ys7DeviceImgService.getBaseMapper()
|
||||
.selectList(new LambdaQueryWrapper<OthYs7DeviceImg>()
|
||||
.in(OthYs7DeviceImg::getDeviceSerial, deviceSerialSet));
|
||||
Map<String, String> deviceImgMap = new HashMap<>();
|
||||
if (CollUtil.isNotEmpty(deviceImgs)){
|
||||
//构建摄像头与图片关系
|
||||
deviceImgMap = deviceImgs.stream().collect(Collectors.toMap(OthYs7DeviceImg::getDeviceSerial, OthYs7DeviceImg::getUrl));
|
||||
}
|
||||
//遍历摄像头列表组装返回数据
|
||||
for (OthYs7Device item : cameraList) {
|
||||
WarehouseMonitoringVo vo = new WarehouseMonitoringVo();
|
||||
vo.setCameraId(item.getId());
|
||||
vo.setWarehouseId(warehouseCameraMap.get(item.getId()));
|
||||
vo.setCameraSerial(item.getDeviceSerial());
|
||||
vo.setCameraName(item.getDeviceName());
|
||||
vo.setStatus(item.getStatus());
|
||||
vo.setEnable(item.getEnable());
|
||||
vo.setName(warehouseMap.get(vo.getWarehouseId()).getWarehouseName());
|
||||
vo.setImgUrl(deviceImgMap.get(item.getDeviceSerial()) != null ? deviceImgMap.get(item.getDeviceSerial()) : "");
|
||||
list.add(vo);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 仓库出入库明细
|
||||
*
|
||||
* @param projectId
|
||||
* @param warehouseId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<StockInAndStockOutRecordVo> warehouseInAndOutDetail(Long projectId, Long warehouseId) {
|
||||
List<StockInAndStockOutRecordVo> list = new ArrayList<>();
|
||||
//根据项目id和仓库id获取入库列表
|
||||
List<MatMaterials> matMaterials = materialsService.getBaseMapper().selectList(new LambdaQueryWrapper<MatMaterials>()
|
||||
.eq(MatMaterials::getProjectId, projectId)
|
||||
.eq(MatMaterials::getWarehouseId, warehouseId));
|
||||
if (CollUtil.isEmpty(matMaterials)) {
|
||||
return list;
|
||||
}
|
||||
//生成材料id与材料名称关系
|
||||
Map<Long, String> map1 = matMaterials.stream().collect(Collectors.toMap(MatMaterials::getId, MatMaterials::getMaterialsName));
|
||||
//获取入库的材料id列表
|
||||
Set<Long> mIds = matMaterials.stream()
|
||||
.map(MatMaterials::getId)
|
||||
.collect(Collectors.toSet());
|
||||
if (CollUtil.isEmpty(mIds)){
|
||||
return list;
|
||||
}
|
||||
//根据材料id列表查询出入库记录表,获取到所有材料的出入库记录
|
||||
List<MatMaterialsInventory> materialsInventoryList = materialsInventoryService.getBaseMapper()
|
||||
.selectList(new LambdaQueryWrapper<MatMaterialsInventory>()
|
||||
.in(MatMaterialsInventory::getMaterialsId, mIds)
|
||||
.orderByDesc(MatMaterialsInventory::getCreateTime));
|
||||
if (CollUtil.isEmpty(materialsInventoryList)){
|
||||
return list;
|
||||
}
|
||||
//遍历出入库记录列表,组装返回数据
|
||||
for (MatMaterialsInventory item : materialsInventoryList) {
|
||||
StockInAndStockOutRecordVo vo = new StockInAndStockOutRecordVo();
|
||||
vo.setId(item.getId());
|
||||
vo.setName(map1.get(item.getMaterialsId()));
|
||||
vo.setInventoryNumber(item.getResidue());
|
||||
vo.setInAndOutNumber(item.getNumber());
|
||||
vo.setType(item.getOutPut());
|
||||
vo.setTime(item.getOutPutTime());
|
||||
vo.setOperator(item.getOperator());
|
||||
list.add(vo);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
@ -1,403 +0,0 @@
|
||||
package org.dromara.bigscreen.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.bigscreen.domain.dto.ProjectImageProgressDetailReq;
|
||||
import org.dromara.bigscreen.domain.progress.*;
|
||||
import org.dromara.bigscreen.domain.vo.ProjectImageProgressDetailVo;
|
||||
import org.dromara.bigscreen.domain.vo.wzxqysjdhdbVo;
|
||||
import org.dromara.bigscreen.service.ProgressBigScreenService;
|
||||
import org.dromara.bigscreen.service.ProjectBigScreenService;
|
||||
import org.dromara.cailiaoshebei.service.IBusMrpBaseService;
|
||||
import org.dromara.common.core.enums.BusinessStatusEnum;
|
||||
import org.dromara.common.core.utils.DateUtils;
|
||||
import org.dromara.common.utils.BigDecimalUtil;
|
||||
import org.dromara.design.domain.DesVolumeCatalog;
|
||||
import org.dromara.design.domain.DesVolumeFile;
|
||||
import org.dromara.design.service.IDesVolumeCatalogService;
|
||||
import org.dromara.design.service.IDesVolumeFileService;
|
||||
import org.dromara.materials.domain.MatMaterialReceive;
|
||||
import org.dromara.materials.domain.MatMaterialReceiveItem;
|
||||
import org.dromara.materials.service.IMatMaterialReceiveItemService;
|
||||
import org.dromara.materials.service.IMatMaterialReceiveService;
|
||||
import org.dromara.materials.service.IMatMaterialsService;
|
||||
import org.dromara.progress.constant.PgsProgressCategoryConstant;
|
||||
import org.dromara.progress.domain.PgsConstructionSchedulePlan;
|
||||
import org.dromara.progress.domain.PgsProgressCategory;
|
||||
import org.dromara.progress.domain.dto.progressplan.PgsProgressPlanQueryReq;
|
||||
import org.dromara.progress.domain.vo.progresscategory.PgsProgressCategoryValueTotalVo;
|
||||
import org.dromara.progress.domain.vo.progressplan.PgsProgressPlanDateVo;
|
||||
import org.dromara.progress.service.IPgsConstructionSchedulePlanService;
|
||||
import org.dromara.progress.service.IPgsProgressCategoryService;
|
||||
import org.dromara.progress.service.IPgsProgressPlanService;
|
||||
import org.dromara.project.domain.BusProject;
|
||||
import org.dromara.project.service.IBusProjectService;
|
||||
import org.dromara.system.domain.vo.SysDictDataVo;
|
||||
import org.dromara.system.service.ISysDictDataService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author lilemy
|
||||
* @date 2025-12-15 14:18
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class ProgressBigScreenServiceImpl implements ProgressBigScreenService {
|
||||
|
||||
@Resource
|
||||
private ProjectBigScreenService projectBigScreenService;
|
||||
|
||||
@Resource
|
||||
private IBusProjectService projectService;
|
||||
|
||||
@Resource
|
||||
private IPgsProgressCategoryService progressCategoryService;
|
||||
|
||||
@Resource
|
||||
private IPgsProgressPlanService progressPlanService;
|
||||
|
||||
@Resource
|
||||
private IPgsConstructionSchedulePlanService constructionSchedulePlanService;
|
||||
|
||||
@Resource
|
||||
private IDesVolumeCatalogService volumeCatalogService;
|
||||
|
||||
@Resource
|
||||
private IDesVolumeFileService volumeFileService;
|
||||
|
||||
@Resource
|
||||
private ISysDictDataService dictDataService;
|
||||
|
||||
@Resource
|
||||
private IMatMaterialReceiveService materialReceiveService;
|
||||
|
||||
@Resource
|
||||
private IMatMaterialReceiveItemService materialReceiveItemService;
|
||||
|
||||
@Resource
|
||||
private IBusMrpBaseService mrpBaseService;
|
||||
|
||||
@Resource
|
||||
private IMatMaterialsService matMaterialsService;
|
||||
|
||||
/**
|
||||
* 获取项目总进度
|
||||
*
|
||||
* @param projectId 项目 id
|
||||
* @return 项目总进度
|
||||
*/
|
||||
@Override
|
||||
public ProjectTotalProgressVo getProjectTotalProgress(Long projectId) {
|
||||
ProjectTotalProgressVo vo = new ProjectTotalProgressVo();
|
||||
// 获取项目和项目子项
|
||||
BusProject project = projectService.getById(projectId);
|
||||
if (project == null) {
|
||||
return vo;
|
||||
}
|
||||
List<BusProject> projects = projectService.lambdaQuery()
|
||||
.eq(BusProject::getPId, projectId)
|
||||
.list();
|
||||
projects.add(project);
|
||||
List<Long> projectIds = projects.stream().map(BusProject::getId).toList();
|
||||
// 获取当前项目所有父级类别
|
||||
List<PgsProgressCategory> topList = progressCategoryService.lambdaQuery()
|
||||
.in(PgsProgressCategory::getProjectId, projectIds)
|
||||
.eq(PgsProgressCategory::getParentId, PgsProgressCategoryConstant.TOP_PARENT_ID)
|
||||
.list();
|
||||
if (CollUtil.isEmpty(topList)) {
|
||||
return vo;
|
||||
}
|
||||
List<Long> topIds = topList.stream().map(PgsProgressCategory::getId).toList();
|
||||
List<PgsProgressCategory> children = progressCategoryService.getLeafNodesByTopIds(topIds);
|
||||
BigDecimal completedPercentage = progressCategoryService.getCompletedPercentage(children);
|
||||
vo.setTotalProgress(completedPercentage);
|
||||
// 获取总计划工期
|
||||
PgsProgressPlanQueryReq queryDate = new PgsProgressPlanQueryReq();
|
||||
queryDate.setProjectId(projectId);
|
||||
PgsProgressPlanDateVo dateVo = progressPlanService.queryDate(queryDate);
|
||||
if (dateVo != null && dateVo.getStartDate() != null && dateVo.getEndDate() != null) {
|
||||
LocalDate startDate = dateVo.getStartDate();
|
||||
LocalDate endDate = dateVo.getEndDate();
|
||||
LocalDate now = LocalDate.now();
|
||||
long totalDays = ChronoUnit.DAYS.between(startDate, endDate);
|
||||
vo.setTotalPlannedDuration(totalDays);
|
||||
if (now.isAfter(endDate)) {
|
||||
vo.setCurrentPlannedDuration(totalDays);
|
||||
} else if (now.isBefore(startDate)) {
|
||||
vo.setCurrentPlannedDuration(0L);
|
||||
} else {
|
||||
vo.setCurrentPlannedDuration(ChronoUnit.DAYS.between(startDate, now) + 1);
|
||||
}
|
||||
}
|
||||
// 获取整体完成情况
|
||||
PgsProgressCategoryValueTotalVo valueTotal = progressCategoryService.getValueTotal(children, true);
|
||||
vo.setTotalCompletionAmount(valueTotal.getTotalValue().divide(BigDecimal.valueOf(10000), 0, RoundingMode.HALF_UP));
|
||||
vo.setCurrentCompletionAmount(valueTotal.getCurrentValue().divide(BigDecimal.valueOf(10000), 0, RoundingMode.HALF_UP));
|
||||
// 获取详情
|
||||
Map<String, List<PgsProgressCategory>> nameMap = topList.stream()
|
||||
.collect(Collectors.groupingBy(PgsProgressCategory::getName));
|
||||
List<ProjectTotalProgressDetailVo> detailList = new ArrayList<>();
|
||||
for (Map.Entry<String, List<PgsProgressCategory>> entry : nameMap.entrySet()) {
|
||||
ProjectTotalProgressDetailVo detailVo = new ProjectTotalProgressDetailVo();
|
||||
String name = entry.getKey();
|
||||
detailVo.setName(name);
|
||||
List<PgsProgressCategory> value = entry.getValue();
|
||||
List<Long> top = value.stream().map(PgsProgressCategory::getId).toList();
|
||||
List<PgsProgressCategory> nameChildren = progressCategoryService.getLeafNodesByTopIds(top, children);
|
||||
BigDecimal completedTotal = nameChildren.stream().map(PgsProgressCategory::getCompleted)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
BigDecimal planTotal = nameChildren.stream().map(PgsProgressCategory::getPlanTotal)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
BigDecimal total = nameChildren.stream().map(PgsProgressCategory::getTotal)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
detailVo.setActualProgress(completedTotal);
|
||||
detailVo.setPlanProgress(planTotal);
|
||||
detailVo.setCompletionRate(BigDecimalUtil.toPercentage(completedTotal, total));
|
||||
detailList.add(detailVo);
|
||||
}
|
||||
vo.setDetailList(detailList);
|
||||
return vo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取施工进度详情
|
||||
*
|
||||
* @param req 请求参数
|
||||
* @return 施工进度详情
|
||||
*/
|
||||
@Override
|
||||
public List<ProjectImageProgressDetailVo> getProjectTotalProgressDetail(ProjectImageProgressDetailReq req) {
|
||||
req.setIsAll(true);
|
||||
return projectBigScreenService.getProjectImageProgressDetail(req);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取里程碑进度
|
||||
*
|
||||
* @param projectId 项目 id
|
||||
* @return 里程碑进度
|
||||
*/
|
||||
@Override
|
||||
public List<MilestoneProgressVo> getMilestoneProgress(Long projectId) {
|
||||
List<MilestoneProgressVo> voList = new ArrayList<>();
|
||||
List<PgsConstructionSchedulePlan> planList = constructionSchedulePlanService.lambdaQuery()
|
||||
.eq(PgsConstructionSchedulePlan::getProjectId, projectId)
|
||||
.list();
|
||||
if (CollUtil.isEmpty(planList)) {
|
||||
return voList;
|
||||
}
|
||||
List<PgsConstructionSchedulePlan> topList = planList.stream().filter(plan -> plan.getParentId().equals(0L)).toList();
|
||||
return topList.stream().map(plan -> {
|
||||
MilestoneProgressVo vo = new MilestoneProgressVo();
|
||||
BeanUtils.copyProperties(plan, vo);
|
||||
// 获取子节点
|
||||
List<PgsConstructionSchedulePlan> allChildren = constructionSchedulePlanService.getAllChildren(plan.getId(), planList);
|
||||
long count = allChildren.stream().filter(child -> child.getStatus().equals("4")).count();
|
||||
BigDecimal percentage = BigDecimalUtil.toPercentage(new BigDecimal(count), new BigDecimal(allChildren.size()));
|
||||
vo.setCurrentProgress(percentage);
|
||||
return vo;
|
||||
}).toList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设计进度
|
||||
*
|
||||
* @param projectId 项目 id
|
||||
* @return 设计进度
|
||||
*/
|
||||
@Override
|
||||
public DesignProgressVo getDesignProgress(Long projectId) {
|
||||
DesignProgressVo vo = new DesignProgressVo();
|
||||
List<DesVolumeCatalog> catalogList = volumeCatalogService.lambdaQuery()
|
||||
.eq(DesVolumeCatalog::getProjectId, projectId).list();
|
||||
if (CollUtil.isEmpty(catalogList)) {
|
||||
return vo;
|
||||
}
|
||||
LocalDate nowDate = LocalDate.now();
|
||||
long currentDesignProgress = 0L;
|
||||
BigDecimal designProgressThisM = BigDecimal.ZERO;
|
||||
BigDecimal designProgressLastM = BigDecimal.ZERO;
|
||||
long currentDelay = 0L;
|
||||
BigDecimal delayThisD = BigDecimal.ZERO;
|
||||
BigDecimal delayLastD = BigDecimal.ZERO;
|
||||
// 总数量
|
||||
vo.setTotalDesignProgress((long) catalogList.size());
|
||||
LocalDateTime firstDayOfMonth = LocalDateTime.now().withDayOfMonth(1).with(LocalTime.MIN);
|
||||
LocalDateTime lastMonthFirstDay = LocalDateTime.now().minusMonths(1).withDayOfMonth(1).with(LocalTime.MIN);
|
||||
for (DesVolumeCatalog catalog : catalogList) {
|
||||
// 已出图状态
|
||||
if (catalog.getDesignState().equals("1")) {
|
||||
currentDesignProgress++;
|
||||
// 获取当月和上月的完成数量
|
||||
LocalDateTime finishTime = catalog.getFinishTime();
|
||||
if (finishTime != null) {
|
||||
if (finishTime.isAfter(firstDayOfMonth)) {
|
||||
designProgressThisM = designProgressThisM.add(BigDecimal.ONE);
|
||||
} else if (finishTime.isBefore(lastMonthFirstDay)) {
|
||||
designProgressLastM = designProgressLastM.add(BigDecimal.ONE);
|
||||
}
|
||||
}
|
||||
} else if (!catalog.getPlannedCompletion().isAfter(nowDate) && catalog.getDesignState().equals("2")) {
|
||||
currentDelay++;
|
||||
if (catalog.getPlannedCompletion().isEqual(nowDate)) {
|
||||
delayThisD = delayThisD.add(BigDecimal.ONE);
|
||||
} else if (catalog.getPlannedCompletion().isEqual(nowDate.minusDays(1))) {
|
||||
delayLastD = delayLastD.add(BigDecimal.ONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
// 计算完成情况
|
||||
vo.setCurrentDesignProgress(currentDesignProgress);
|
||||
vo.setDesignProgressTrend(designProgressThisM.compareTo(designProgressLastM) >= 0);
|
||||
vo.setDesignProgressRate(BigDecimalUtil.toLoopPercentage(designProgressThisM, designProgressLastM));
|
||||
// 总逾期数量
|
||||
vo.setDelayedDesign(currentDelay);
|
||||
vo.setDelayedDesignTrend(delayThisD.compareTo(delayLastD) >= 0);
|
||||
vo.setDelayedDesignRate(BigDecimalUtil.toLoopPercentage(delayThisD, delayLastD));
|
||||
// 获取各专业完成情况
|
||||
List<DesignProgressMajorVo> majorList = new ArrayList<>();
|
||||
Map<String, List<DesVolumeCatalog>> specialtyMap = catalogList.stream()
|
||||
.collect(Collectors.groupingBy(DesVolumeCatalog::getSpecialty));
|
||||
List<SysDictDataVo> desUserMajor = dictDataService.selectByDictType("des_user_major");
|
||||
if (CollUtil.isEmpty(desUserMajor)) {
|
||||
log.error("专业字典 des_user_major 数据不存在");
|
||||
} else {
|
||||
Map<String, String> dictMap = desUserMajor.stream()
|
||||
.collect(Collectors.toMap(SysDictDataVo::getDictValue, SysDictDataVo::getDictLabel));
|
||||
specialtyMap.forEach((specialty, list) -> {
|
||||
DesignProgressMajorVo majorVo = new DesignProgressMajorVo();
|
||||
majorVo.setMajorName(dictMap.getOrDefault(specialty, specialty));
|
||||
BigDecimal total = new BigDecimal(list.size());
|
||||
long count = list.stream().filter(catalog -> catalog.getDesignState().equals("1")).count();
|
||||
majorVo.setCompletionRate(BigDecimalUtil.toPercentage(new BigDecimal(count), total));
|
||||
majorList.add(majorVo);
|
||||
});
|
||||
}
|
||||
vo.setMajorList(majorList);
|
||||
// 审核信息
|
||||
Set<Long> ids = catalogList.stream().map(DesVolumeCatalog::getDesign).collect(Collectors.toSet());
|
||||
List<DesVolumeFile> fileList = volumeFileService.lambdaQuery()
|
||||
.in(DesVolumeFile::getVolumeCatalogId, ids)
|
||||
.list();
|
||||
long reviewedDesign = 0L;
|
||||
BigDecimal reviewedDesignThisM = BigDecimal.ZERO;
|
||||
BigDecimal reviewedDesignLastM = BigDecimal.ZERO;
|
||||
long pendingReviewDesign = 0L;
|
||||
BigDecimal pendingReviewDesignThisD = BigDecimal.ZERO;
|
||||
BigDecimal pendingReviewDesignLastD = BigDecimal.ZERO;
|
||||
for (DesVolumeFile file : fileList) {
|
||||
String status = file.getStatus();
|
||||
if (BusinessStatusEnum.FINISH.getStatus().equals(status)) {
|
||||
reviewedDesign++;
|
||||
// 获取当月和上月的完成数量
|
||||
LocalDateTime finishTime = file.getFinishTime();
|
||||
if (finishTime != null) {
|
||||
if (finishTime.isAfter(firstDayOfMonth)) {
|
||||
reviewedDesignThisM = reviewedDesignThisM.add(BigDecimal.ONE);
|
||||
} else if (finishTime.isBefore(lastMonthFirstDay)) {
|
||||
reviewedDesignLastM = reviewedDesignLastM.add(BigDecimal.ONE);
|
||||
}
|
||||
}
|
||||
} else if (BusinessStatusEnum.WAITING.getStatus().equals(status)) {
|
||||
pendingReviewDesign++;
|
||||
Date createTime = file.getCreateTime();
|
||||
LocalDate createDate = createTime.toInstant()
|
||||
.atZone(ZoneId.systemDefault())
|
||||
.toLocalDate();
|
||||
if (createDate.isEqual(nowDate)) {
|
||||
pendingReviewDesignThisD = pendingReviewDesignThisD.add(BigDecimal.ONE);
|
||||
} else if (createDate.isEqual(nowDate.minusDays(1))) {
|
||||
pendingReviewDesignLastD = pendingReviewDesignLastD.add(BigDecimal.ONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
vo.setTotalDesign((long) fileList.size());
|
||||
vo.setReviewedDesign(reviewedDesign);
|
||||
vo.setReviewedDesignTrend(reviewedDesignThisM.compareTo(reviewedDesignLastM) >= 0);
|
||||
vo.setReviewedDesignRate(BigDecimalUtil.toLoopPercentage(reviewedDesignThisM, reviewedDesignLastM));
|
||||
vo.setPendingDesignReview(pendingReviewDesign);
|
||||
vo.setPendingDesignReviewTrend(pendingReviewDesignThisD.compareTo(pendingReviewDesignLastD) >= 0);
|
||||
vo.setPendingDesignReviewRate(BigDecimalUtil.toLoopPercentage(pendingReviewDesignThisD, pendingReviewDesignLastD));
|
||||
return vo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取物料进度详情
|
||||
*
|
||||
* @param projectId 项目 id
|
||||
* @return 物料进度详情
|
||||
*/
|
||||
@Override
|
||||
public List<MaterialProgressDetailVo> getMaterialProgressDetail(Long projectId, String name, String specification) {
|
||||
// 根据名称 规格获取材料
|
||||
List<MatMaterialReceiveItem> itemList = materialReceiveItemService.lambdaQuery()
|
||||
.eq(MatMaterialReceiveItem::getName, name)
|
||||
.eq(MatMaterialReceiveItem::getSpecification, specification)
|
||||
.list();
|
||||
if (CollUtil.isEmpty(itemList)) {
|
||||
return List.of();
|
||||
}
|
||||
Set<Long> ids = itemList.stream().map(MatMaterialReceiveItem::getReceiveId).collect(Collectors.toSet());
|
||||
List<MatMaterialReceive> receiveList = materialReceiveService.lambdaQuery()
|
||||
.in(MatMaterialReceive::getId, ids)
|
||||
.list();
|
||||
Map<Long, MatMaterialReceive> receiveMap = receiveList.stream()
|
||||
.collect(Collectors.toMap(MatMaterialReceive::getId, receive -> receive));
|
||||
return itemList.stream().map(item -> {
|
||||
Long receiveId = item.getReceiveId();
|
||||
MatMaterialReceive receive = receiveMap.get(receiveId);
|
||||
if (receive == null) {
|
||||
return null;
|
||||
}
|
||||
MaterialProgressDetailVo vo = new MaterialProgressDetailVo();
|
||||
vo.setId(item.getId());
|
||||
vo.setName(item.getName());
|
||||
vo.setQuantity(item.getQuantity());
|
||||
vo.setAcceptedQuantity(item.getAcceptedQuantity());
|
||||
vo.setShortageQuantity(item.getShortageQuantity());
|
||||
vo.setFormCode(receive.getFormCode());
|
||||
vo.setContractName(receive.getContractName());
|
||||
vo.setOrderingUnit(receive.getOrderingUnit());
|
||||
vo.setSupplierUnit(receive.getSupplierUnit());
|
||||
vo.setArrivalDate(DateUtils.toLocalDate(receive.getCreateTime()));
|
||||
return vo;
|
||||
}).filter(Objects::nonNull).toList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取物资进度
|
||||
*
|
||||
* @param projectId 项目 id
|
||||
* @return 物资进度
|
||||
*/
|
||||
@Override
|
||||
public List<wzxqysjdhdbVo> getMaterialProgress(Long projectId) {
|
||||
List<wzxqysjdhdbVo> wzxqysjdhdb = mrpBaseService.wzxqysjdhdb(projectId);
|
||||
Map<String, List<wzxqysjdhdbVo>> map = wzxqysjdhdb.stream()
|
||||
.collect(Collectors.groupingBy(o -> o.getName() + o.getSpecification()));
|
||||
List<wzxqysjdhdbVo> wzxqysjdhdbList = new ArrayList<>();
|
||||
map.forEach((k, v) -> {
|
||||
wzxqysjdhdbVo vo = new wzxqysjdhdbVo();
|
||||
vo.setName(v.getFirst().getName());
|
||||
vo.setSpecification(v.getFirst().getSpecification());
|
||||
BigDecimal design = v.stream().map(wzxqysjdhdbVo::getDesignTotalPrices).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
vo.setDesignTotalPrices(design);
|
||||
BigDecimal arrival = v.stream().map(wzxqysjdhdbVo::getArrivalTotalPrices).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
vo.setArrivalTotalPrices(arrival);
|
||||
wzxqysjdhdbList.add(vo);
|
||||
});
|
||||
return wzxqysjdhdbList;
|
||||
}
|
||||
}
|
||||
@ -4,7 +4,6 @@ import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.json.JSONArray;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.dromara.bigscreen.domain.dto.ProjectImageProgressDetailReq;
|
||||
@ -371,7 +370,7 @@ public class ProjectBigScreenServiceImpl implements ProjectBigScreenService {
|
||||
// 如果有叶子节点,统计进度和状态;否则初始化为未完成
|
||||
if (CollUtil.isNotEmpty(leafNodesByTopIds)) {
|
||||
topVo.setProgressTotal(progressCategoryService.getCompletedPercentage(leafNodesByTopIds));
|
||||
topVo.setValueTotal(progressCategoryService.getValueTotal(leafNodesByTopIds, true).getCurrentValue());
|
||||
topVo.setValueTotal(progressCategoryService.getValueTotal(leafNodesByTopIds, true));
|
||||
} else {
|
||||
topVo.setProgressTotal(BigDecimal.ZERO);
|
||||
topVo.setValueTotal(BigDecimal.ZERO);
|
||||
@ -531,38 +530,25 @@ public class ProjectBigScreenServiceImpl implements ProjectBigScreenService {
|
||||
Set<Long> projectIds = subProjects.stream().map(BusProject::getId).collect(Collectors.toSet());
|
||||
projectIds.add(projectId);
|
||||
// 获取对应进度
|
||||
List<PgsProgressCategory> progressCategoryList = progressCategoryService.lambdaQuery()
|
||||
PgsProgressCategory progressCategory = progressCategoryService.lambdaQuery()
|
||||
.in(PgsProgressCategory::getProjectId, projectIds)
|
||||
.eq(PgsProgressCategory::getName, progressName)
|
||||
.list();
|
||||
if (CollUtil.isEmpty(progressCategoryList)) {
|
||||
.last("limit 1")
|
||||
.one();
|
||||
if (progressCategory == null) {
|
||||
return List.of();
|
||||
}
|
||||
// 查出所有属于该顶级节点的子孙节点
|
||||
LambdaQueryWrapper<PgsProgressCategory> lqw = new LambdaQueryWrapper<>();
|
||||
List<PgsProgressCategory> allChildren;
|
||||
if (progressName.equals("光伏场区")) {
|
||||
Long topId = progressCategory.getId();
|
||||
final List<String> gfcqName = List.of("场地平整", "桩基成孔", "桩基浇筑", "支架安装", "组件安装");
|
||||
List<Long> topIds = progressCategoryList.stream().map(PgsProgressCategory::getId).toList();
|
||||
// 查出所有属于这些顶级节点的子孙节点
|
||||
allChildren = progressCategoryService.list(
|
||||
// 查出所有属于该顶级节点的子孙节点
|
||||
List<PgsProgressCategory> allChildren = progressCategoryService.list(
|
||||
Wrappers.<PgsProgressCategory>lambdaQuery()
|
||||
.in(!req.getIsAll(), PgsProgressCategory::getName, gfcqName)
|
||||
.and(wrapper -> {
|
||||
for (Long topId : topIds) {
|
||||
wrapper.or(q -> q.like(PgsProgressCategory::getAncestors, "," + topId + ","))
|
||||
.or(q -> q.like(PgsProgressCategory::getAncestors, "," + topId));
|
||||
}
|
||||
})
|
||||
);
|
||||
} else {
|
||||
PgsProgressCategory first = progressCategoryList.getFirst();
|
||||
lqw.and(wrapper ->
|
||||
wrapper.like(PgsProgressCategory::getAncestors, "," + first.getId() + ",")
|
||||
.in(progressName.equals("光伏场区"), PgsProgressCategory::getName, gfcqName)
|
||||
.and(wrapper ->
|
||||
wrapper.like(PgsProgressCategory::getAncestors, "," + topId + ",")
|
||||
.or()
|
||||
.like(PgsProgressCategory::getAncestors, "," + first.getId()));
|
||||
allChildren = progressCategoryService.list(lqw);
|
||||
}
|
||||
.like(PgsProgressCategory::getAncestors, "," + topId))
|
||||
);
|
||||
if (allChildren.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
@ -570,6 +556,7 @@ public class ProjectBigScreenServiceImpl implements ProjectBigScreenService {
|
||||
Set<Long> parentIds = allChildren.stream()
|
||||
.map(PgsProgressCategory::getParentId)
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
List<PgsProgressCategory> dierList = allChildren.stream()
|
||||
.filter(item -> !parentIds.contains(item.getId()))
|
||||
.toList();
|
||||
@ -581,7 +568,6 @@ public class ProjectBigScreenServiceImpl implements ProjectBigScreenService {
|
||||
vo.setPlanProgress(c.getPlanTotal());
|
||||
vo.setActualProgress(c.getCompleted());
|
||||
vo.setTotalProgress(c.getTotal());
|
||||
vo.setCompletionRate(BigDecimalUtil.toPercentage(c.getCompleted(), c.getTotal()));
|
||||
return vo;
|
||||
}).toList();
|
||||
}
|
||||
@ -589,48 +575,26 @@ public class ProjectBigScreenServiceImpl implements ProjectBigScreenService {
|
||||
Set<Long> parentIds = allChildren.stream()
|
||||
.map(PgsProgressCategory::getParentId)
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
List<PgsProgressCategory> dierList = allChildren.stream()
|
||||
.filter(item -> parentIds.contains(item.getId()))
|
||||
.toList();
|
||||
List<ProjectImageProgressDetailVo> detailVoList = new ArrayList<>();
|
||||
if (CollUtil.isEmpty(dierList)) {
|
||||
// 根据名称进行分类汇总
|
||||
Map<String, List<PgsProgressCategory>> childrenMap = allChildren.stream()
|
||||
.collect(Collectors.groupingBy(PgsProgressCategory::getName));
|
||||
childrenMap.forEach((name, children) -> {
|
||||
if (CollUtil.isEmpty(children)) {
|
||||
return;
|
||||
}
|
||||
return allChildren.stream().map(c -> {
|
||||
ProjectImageProgressDetailVo vo = new ProjectImageProgressDetailVo();
|
||||
String unit = children.stream().map(PgsProgressCategory::getUnit)
|
||||
.filter(Objects::nonNull)
|
||||
.findFirst().orElse(null);
|
||||
vo.setUnit(unit);
|
||||
vo.setProgressName(name);
|
||||
BigDecimal plan = children.stream().map(PgsProgressCategory::getPlanTotal)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
vo.setPlanProgress(plan);
|
||||
BigDecimal completed = children.stream().map(PgsProgressCategory::getCompleted)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
vo.setActualProgress(completed);
|
||||
BigDecimal total = children.stream().map(PgsProgressCategory::getTotal)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
vo.setTotalProgress(total);
|
||||
vo.setCompletionRate(BigDecimalUtil.toPercentage(completed, total));
|
||||
detailVoList.add(vo);
|
||||
});
|
||||
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();
|
||||
} else {
|
||||
// 根据名称进行分类汇总
|
||||
Map<String, List<PgsProgressCategory>> dierMap = dierList.stream()
|
||||
.collect(Collectors.groupingBy(PgsProgressCategory::getName));
|
||||
dierMap.forEach((name, value) -> {
|
||||
ProjectImageProgressDetailVo vo = new ProjectImageProgressDetailVo();
|
||||
Set<Long> parentIdSet = value.stream()
|
||||
.map(PgsProgressCategory::getId)
|
||||
.collect(Collectors.toSet());
|
||||
return dierList.stream().map(c -> {
|
||||
// 获取子集
|
||||
List<PgsProgressCategory> children = allChildren.stream()
|
||||
.filter(item -> parentIdSet.contains(item.getParentId()))
|
||||
.filter(item -> item.getParentId().equals(c.getId()))
|
||||
.toList();
|
||||
// 计算
|
||||
BigDecimal plan = children.stream().map(PgsProgressCategory::getPlanTotal)
|
||||
@ -639,19 +603,16 @@ public class ProjectBigScreenServiceImpl implements ProjectBigScreenService {
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
BigDecimal total = children.stream().map(PgsProgressCategory::getTotal)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
ProjectImageProgressDetailVo vo = new ProjectImageProgressDetailVo();
|
||||
vo.setId(c.getId());
|
||||
vo.setUnit(c.getUnit());
|
||||
vo.setProgressName(c.getName());
|
||||
vo.setPlanProgress(plan);
|
||||
vo.setActualProgress(actual);
|
||||
vo.setTotalProgress(total);
|
||||
vo.setProgressName(name);
|
||||
String unit = value.stream().map(PgsProgressCategory::getUnit)
|
||||
.filter(Objects::nonNull)
|
||||
.findFirst().orElse(null);
|
||||
vo.setUnit(unit);
|
||||
vo.setCompletionRate(BigDecimalUtil.toPercentage(actual, total));
|
||||
detailVoList.add(vo);
|
||||
});
|
||||
return vo;
|
||||
}).toList();
|
||||
}
|
||||
return detailVoList;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -94,7 +94,6 @@ public class SysRoleWorkServiceImpl extends ServiceImpl<SysRoleWorkMapper, SysRo
|
||||
LambdaQueryWrapper<SysRoleWork> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByDesc(SysRoleWork::getCreateTime);
|
||||
lqw.eq(bo.getRoleId() != null, SysRoleWork::getRoleId, bo.getRoleId());
|
||||
lqw.eq(bo.getProjectId() != null, SysRoleWork::getProjectId, bo.getProjectId());
|
||||
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.getLcxq()), SysRoleWork::getLcxq, bo.getLcxq());
|
||||
|
||||
@ -94,12 +94,6 @@ public class BusMaterialbatchdemandplan extends BaseEntity {
|
||||
*/
|
||||
private BigDecimal demandQuantity;
|
||||
|
||||
|
||||
/**
|
||||
* 单价
|
||||
*/
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
/**
|
||||
* 计划到场时间
|
||||
*/
|
||||
|
||||
@ -93,11 +93,6 @@ public class BusMaterialbatchdemandplanBo extends BaseEntity {
|
||||
*/
|
||||
private BigDecimal demandQuantity;
|
||||
|
||||
/**
|
||||
* 单价
|
||||
*/
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
/**
|
||||
* 计划到场时间
|
||||
*/
|
||||
|
||||
@ -118,11 +118,6 @@ public class BusMaterialbatchdemandplanVo implements Serializable {
|
||||
@ExcelProperty(value = "需求数量")
|
||||
private BigDecimal demandQuantity;
|
||||
|
||||
/**
|
||||
* 单价
|
||||
*/
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
/**
|
||||
* 计划到场时间
|
||||
*/
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
package org.dromara.cailiaoshebei.service;
|
||||
|
||||
import org.dromara.bigscreen.domain.vo.designAndArrivalComparisonVo;
|
||||
import org.dromara.bigscreen.domain.vo.wzxqysjdhdbVo;
|
||||
import org.dromara.cailiaoshebei.domain.bo.BusMrpBaseReq;
|
||||
import org.dromara.cailiaoshebei.domain.dto.BusMrpDto;
|
||||
import org.dromara.cailiaoshebei.domain.dto.BusMrpExportDto;
|
||||
@ -92,14 +90,4 @@ public interface IBusMrpBaseService extends IService<BusMrpBase>{
|
||||
Map<String, Object> remaining(Long projectId,Long limitListId,Long mrpBaseId);
|
||||
|
||||
List<BusMrpBaseVo> getListByName(BusMrpBaseReq req);
|
||||
|
||||
/**
|
||||
* 设计量与到货量对比
|
||||
*/
|
||||
List<designAndArrivalComparisonVo> designAndArrivalComparison(Long projectId);
|
||||
|
||||
/**
|
||||
* 物资需求与实际到货对比
|
||||
*/
|
||||
List<wzxqysjdhdbVo> wzxqysjdhdb(Long projectId);
|
||||
}
|
||||
|
||||
@ -105,6 +105,4 @@ public interface IBusPurchaseDocService extends IService<BusPurchaseDoc> {
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateFeedback(FeedbackDto dto);
|
||||
|
||||
List<BusPurchaseDocVo> purchaseNote(Long projectId);
|
||||
}
|
||||
|
||||
@ -1,33 +1,20 @@
|
||||
package org.dromara.cailiaoshebei.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.bigscreen.domain.vo.designAndArrivalComparisonVo;
|
||||
import org.dromara.bigscreen.domain.vo.wzxqysjdhdbVo;
|
||||
import org.dromara.cailiaoshebei.domain.BusMaterialbatchdemandplan;
|
||||
import org.dromara.cailiaoshebei.domain.BusMrpBase;
|
||||
import org.dromara.cailiaoshebei.domain.BusPlanDocAssociation;
|
||||
import org.dromara.cailiaoshebei.domain.bo.BusMaterialbatchdemandplanBo;
|
||||
import org.dromara.cailiaoshebei.domain.bo.BusMrpBaseBo;
|
||||
import org.dromara.cailiaoshebei.domain.bo.BusMrpBaseReq;
|
||||
import org.dromara.cailiaoshebei.domain.dto.BusMaterialbatchdemandplanExportDto;
|
||||
import org.dromara.cailiaoshebei.domain.dto.BusMrpDto;
|
||||
import org.dromara.cailiaoshebei.domain.dto.BusMrpExportDto;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusMaterialbatchdemandplanVo;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusMrpBaseVo;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusMrpVo;
|
||||
import org.dromara.cailiaoshebei.mapper.BusMrpBaseMapper;
|
||||
import org.dromara.cailiaoshebei.service.IBusMaterialbatchdemandplanService;
|
||||
import org.dromara.cailiaoshebei.service.IBusMrpBaseService;
|
||||
import org.dromara.cailiaoshebei.service.IBusPlanDocAssociationService;
|
||||
import org.dromara.common.core.domain.event.ProcessDeleteEvent;
|
||||
import org.dromara.common.core.domain.event.ProcessEvent;
|
||||
@ -36,20 +23,26 @@ import org.dromara.common.core.enums.BusinessStatusEnum;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.utils.excel.ExcelDynamicReader;
|
||||
import org.dromara.materials.domain.MatMaterialReceiveItem;
|
||||
import org.dromara.materials.service.IMatMaterialReceiveItemService;
|
||||
import org.dromara.design.domain.BusBillofquantities;
|
||||
import org.dromara.design.service.IBusBillofquantitiesService;
|
||||
import org.dromara.tender.domain.BusBillofquantitiesLimitList;
|
||||
import org.dromara.tender.domain.BusTenderPlanningLimitList;
|
||||
import org.dromara.tender.enums.LimitListTypeEnum;
|
||||
import org.dromara.tender.service.IBusBillofquantitiesLimitListService;
|
||||
import org.dromara.tender.service.IBusTenderPlanningLimitListService;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.cailiaoshebei.domain.bo.BusMrpBaseBo;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusMrpBaseVo;
|
||||
import org.dromara.cailiaoshebei.domain.BusMrpBase;
|
||||
import org.dromara.cailiaoshebei.mapper.BusMrpBaseMapper;
|
||||
import org.dromara.cailiaoshebei.service.IBusMrpBaseService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@ -77,9 +70,6 @@ public class BusMrpBaseServiceImpl extends ServiceImpl<BusMrpBaseMapper, BusMrpB
|
||||
|
||||
private final IBusTenderPlanningLimitListService tenderPlanningLimitListService;
|
||||
|
||||
@Lazy
|
||||
@Resource
|
||||
private IMatMaterialReceiveItemService matMaterialReceiveItemService;
|
||||
|
||||
|
||||
/**
|
||||
@ -259,7 +249,7 @@ public class BusMrpBaseServiceImpl extends ServiceImpl<BusMrpBaseMapper, BusMrpB
|
||||
.findFirst()
|
||||
.map(item -> {
|
||||
String name = item.getName() != null ? item.getName() : "";
|
||||
return "名称:“" + name + "”";
|
||||
return "名称:“"+name + "”";
|
||||
})
|
||||
.orElse("未知物料");
|
||||
throw new ServiceException(itemName + "超出数量");
|
||||
@ -309,7 +299,7 @@ public class BusMrpBaseServiceImpl extends ServiceImpl<BusMrpBaseMapper, BusMrpB
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String, Object> remaining(Long projectId, Long limitListId, Long mrpBaseId) {
|
||||
public Map<String, Object> remaining(Long projectId, Long limitListId,Long mrpBaseId) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
List<BusTenderPlanningLimitList> busTenderPlanningLimitLists = tenderPlanningLimitListService.getBaseMapper()
|
||||
.selectList(new LambdaQueryWrapper<BusTenderPlanningLimitList>()
|
||||
@ -323,23 +313,22 @@ public class BusMrpBaseServiceImpl extends ServiceImpl<BusMrpBaseMapper, BusMrpB
|
||||
// 获取数据库中已有的数量
|
||||
List<BusMaterialbatchdemandplan> existingList = planservice.list(
|
||||
Wrappers.lambdaQuery(BusMaterialbatchdemandplan.class)
|
||||
.eq(BusMaterialbatchdemandplan::getSuppliespriceId, limitListId)
|
||||
.ne(mrpBaseId != null, BusMaterialbatchdemandplan::getMrpBaseId, mrpBaseId)// 排除当前批次
|
||||
.eq(BusMaterialbatchdemandplan::getSuppliespriceId ,limitListId)
|
||||
.ne(mrpBaseId!=null,BusMaterialbatchdemandplan::getMrpBaseId, mrpBaseId)// 排除当前批次
|
||||
);
|
||||
BigDecimal reduce = BigDecimal.ZERO;
|
||||
if (CollectionUtil.isNotEmpty(existingList)) {
|
||||
if(CollectionUtil.isNotEmpty(existingList)){
|
||||
reduce = existingList.stream()
|
||||
.map(BusMaterialbatchdemandplan::getDemandQuantity)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
}
|
||||
map.put("remainingQuantity", quantity.subtract(reduce));
|
||||
map.put("suppliespriceId", limitListId);
|
||||
map.put("remainingQuantity",quantity.subtract(reduce));
|
||||
map.put("suppliespriceId",limitListId);
|
||||
if (busBillofquantities != null) {
|
||||
map.put("specification", busBillofquantities.getSpecification());
|
||||
map.put("unit", busBillofquantities.getUnit());
|
||||
map.put("unitPrice", busBillofquantities.getUnitPrice());
|
||||
map.put("remark", busBillofquantities.getRemark());
|
||||
map.put("name", busBillofquantities.getName());
|
||||
map.put("specification",busBillofquantities.getSpecification());
|
||||
map.put("unit",busBillofquantities.getUnit());
|
||||
map.put("remark",busBillofquantities.getRemark());
|
||||
map.put("name",busBillofquantities.getName());
|
||||
}
|
||||
return map;
|
||||
}
|
||||
@ -354,7 +343,7 @@ public class BusMrpBaseServiceImpl extends ServiceImpl<BusMrpBaseMapper, BusMrpB
|
||||
.like(BusMaterialbatchdemandplan::getName, req.getName()));
|
||||
Iterator<BusMaterialbatchdemandplan> iterator = busMaterialbatchdemandplans.iterator();
|
||||
Set<Long> mrpIds = new HashSet<>();
|
||||
while (iterator.hasNext()) {
|
||||
while (iterator.hasNext()){
|
||||
BusMaterialbatchdemandplan next = iterator.next();
|
||||
List<BusPlanDocAssociation> busPlanDocAssociations = planDocAssociationService.getBaseMapper().selectList(new LambdaQueryWrapper<BusPlanDocAssociation>()
|
||||
.eq(BusPlanDocAssociation::getProjectId, req.getProjectId())
|
||||
@ -365,93 +354,15 @@ public class BusMrpBaseServiceImpl extends ServiceImpl<BusMrpBaseMapper, BusMrpB
|
||||
});
|
||||
if (demandQuantity.compareTo(next.getDemandQuantity()) >= 0) {
|
||||
iterator.remove();
|
||||
} else {
|
||||
}else {
|
||||
mrpIds.add(next.getMrpBaseId());
|
||||
}
|
||||
}
|
||||
if (mrpIds.isEmpty()) {
|
||||
if (mrpIds.isEmpty()){
|
||||
return null;
|
||||
}
|
||||
return baseMapper.selectVoList(new LambdaQueryWrapper<BusMrpBase>()
|
||||
.eq(BusMrpBase::getStatus, BusinessStatusEnum.FINISH.getStatus()).in(BusMrpBase::getId, mrpIds));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<designAndArrivalComparisonVo> designAndArrivalComparison(Long projectId) {
|
||||
// 获取施工图一览的所有材料数据
|
||||
List<BusBillofquantitiesLimitList> limitLists = busBillofquantitiesService.getBaseMapper().selectList(new LambdaQueryWrapper<BusBillofquantitiesLimitList>()
|
||||
.eq(BusBillofquantitiesLimitList::getProjectId, projectId)
|
||||
.eq(BusBillofquantitiesLimitList::getType, LimitListTypeEnum.SPECIAL.getCode())
|
||||
.isNotNull(BusBillofquantitiesLimitList::getQuantity));
|
||||
Map<Long, BigDecimal> wuZiMap = getWuZiMap(projectId);
|
||||
// 根据批次需求计划的物资id获取到施工图一览对应数据
|
||||
List<designAndArrivalComparisonVo> list = new ArrayList<>();
|
||||
limitLists.forEach(limitList -> {
|
||||
designAndArrivalComparisonVo vo = new designAndArrivalComparisonVo();
|
||||
vo.setName(limitList.getName());
|
||||
vo.setSpecification(limitList.getSpecification());
|
||||
vo.setUnit(limitList.getUnit());
|
||||
vo.setDesignTotalPrices(limitList.getQuantity());
|
||||
vo.setArrivalTotalPrices(wuZiMap.getOrDefault(limitList.getId(), BigDecimal.ZERO));
|
||||
list.add(vo);
|
||||
});
|
||||
return list;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private Map<Long, BigDecimal> getWuZiMap(Long projectId) {
|
||||
// 获取所有入库数据 mat_material_receive_item
|
||||
List<MatMaterialReceiveItem> matMaterialReceiveItems = matMaterialReceiveItemService.getBaseMapper()
|
||||
.selectList(new LambdaQueryWrapper<MatMaterialReceiveItem>()
|
||||
.eq(MatMaterialReceiveItem::getProjectId, projectId));
|
||||
//将相同计划批次数据进行分组合并
|
||||
Set<Long> planIds = matMaterialReceiveItems.stream()
|
||||
.map(MatMaterialReceiveItem::getPlanId)
|
||||
.collect(Collectors.toSet());
|
||||
if (CollUtil.isEmpty(planIds)) {
|
||||
return new HashMap<>();
|
||||
}
|
||||
Map<Long, BigDecimal> planMap = matMaterialReceiveItems.stream()
|
||||
.filter(matMaterialReceiveItem -> matMaterialReceiveItem.getPlanId() != null)
|
||||
.collect(Collectors.groupingBy(
|
||||
MatMaterialReceiveItem::getPlanId,
|
||||
Collectors.reducing(BigDecimal.ZERO, MatMaterialReceiveItem::getAcceptedQuantity, BigDecimal::add)
|
||||
));
|
||||
// 根据入库数据反查批次需求计划数据 bus_materialbatchdemandplan
|
||||
List<BusMaterialbatchdemandplan> materialbatchdemandplans = planservice.getBaseMapper().selectList(new LambdaQueryWrapper<BusMaterialbatchdemandplan>()
|
||||
.eq(BusMaterialbatchdemandplan::getProjectId, projectId)
|
||||
.in(BusMaterialbatchdemandplan::getId, planIds));
|
||||
Map<Long, BigDecimal> wuZiMap = new HashMap<>();
|
||||
materialbatchdemandplans.forEach(materialbatchdemandplan -> {
|
||||
//merge()方法如果键存在则合并值,否则直接放入
|
||||
wuZiMap.merge(
|
||||
materialbatchdemandplan.getSuppliespriceId(),
|
||||
planMap.get(materialbatchdemandplan.getId()),
|
||||
BigDecimal::add
|
||||
);
|
||||
});
|
||||
return wuZiMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<wzxqysjdhdbVo> wzxqysjdhdb(Long projectId) {
|
||||
// 获取施工图一览的所有材料数据
|
||||
List<BusBillofquantitiesLimitList> limitLists = busBillofquantitiesService.getBaseMapper().selectList(new LambdaQueryWrapper<BusBillofquantitiesLimitList>()
|
||||
.eq(BusBillofquantitiesLimitList::getProjectId, projectId)
|
||||
.eq(BusBillofquantitiesLimitList::getType, LimitListTypeEnum.SPECIAL.getCode())
|
||||
.isNotNull(BusBillofquantitiesLimitList::getQuantity));
|
||||
Map<Long, BigDecimal> wuZiMap = getWuZiMap(projectId);
|
||||
// 根据批次需求计划的物资id获取到施工图一览对应数据
|
||||
List<wzxqysjdhdbVo> list = new ArrayList<>();
|
||||
limitLists.forEach(limitList -> {
|
||||
wzxqysjdhdbVo vo = new wzxqysjdhdbVo();
|
||||
vo.setName(limitList.getName());
|
||||
vo.setSpecification(limitList.getSpecification());
|
||||
vo.setDesignTotalPrices(limitList.getQuantity());
|
||||
vo.setArrivalTotalPrices(wuZiMap.getOrDefault(limitList.getId(), BigDecimal.ZERO));
|
||||
list.add(vo);
|
||||
});
|
||||
return list;
|
||||
.eq(BusMrpBase::getStatus,BusinessStatusEnum.FINISH.getStatus()).in(BusMrpBase::getId,mrpIds));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -111,9 +111,6 @@ public class BusPurchaseDocServiceImpl extends ServiceImpl<BusPurchaseDocMapper,
|
||||
@Override
|
||||
public BusPurchaseDocVo queryById(Long id) {
|
||||
BusPurchaseDocVo busPurchaseDocVo = baseMapper.selectVoById(id);
|
||||
if (busPurchaseDocVo == null){
|
||||
return busPurchaseDocVo;
|
||||
}
|
||||
BusPlanDocAssociationBo busPlanDocAssociationBo = new BusPlanDocAssociationBo();
|
||||
busPlanDocAssociationBo.setDocId(id);
|
||||
List<BusPlanDocAssociationVo> busPlanDocAssociationVos = planDocAssociationService.queryList(busPlanDocAssociationBo);
|
||||
@ -194,7 +191,7 @@ public class BusPurchaseDocServiceImpl extends ServiceImpl<BusPurchaseDocMapper,
|
||||
|
||||
BusPurchaseDoc add = MapstructUtils.convert(bo, BusPurchaseDoc.class);
|
||||
validEntityBeforeSave(add);
|
||||
validNum(bo.getAssociationList(), add.getSupplierId());
|
||||
validNum(bo.getAssociationList(),add.getSupplierId());
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
@ -215,7 +212,7 @@ public class BusPurchaseDocServiceImpl extends ServiceImpl<BusPurchaseDocMapper,
|
||||
|
||||
for (BusPlanDocAssociationBo association : associationList) {
|
||||
|
||||
if (association.getDemandQuantity() == null) {
|
||||
if(association.getDemandQuantity() == null){
|
||||
throw new ServiceException("请填写需求数量");
|
||||
}
|
||||
|
||||
@ -252,13 +249,13 @@ public class BusPurchaseDocServiceImpl extends ServiceImpl<BusPurchaseDocMapper,
|
||||
busMaterialbatchdemandplans.forEach(busMaterialbatchdemandplan -> {
|
||||
planids.add(busMaterialbatchdemandplan.getId());
|
||||
});
|
||||
if (!ids1.isEmpty()) {
|
||||
if (!ids1.isEmpty()){
|
||||
List<BusPlanDocAssociation> list1 = planDocAssociationService.list(Wrappers.lambdaQuery(BusPlanDocAssociation.class)
|
||||
.in(BusPlanDocAssociation::getDocId, ids1));
|
||||
//计算材料已存在的数量
|
||||
BigDecimal cltotal = list1.stream()
|
||||
.filter(Objects::nonNull)
|
||||
.filter(item -> planids.contains(item.getPlanId()))
|
||||
.filter(item->planids.contains(item.getPlanId()))
|
||||
.map(BusPlanDocAssociation::getDemandQuantity)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
if (cltotal.add(association.getDemandQuantity()).compareTo(quantity) > 0) {
|
||||
@ -414,12 +411,7 @@ public class BusPurchaseDocServiceImpl extends ServiceImpl<BusPurchaseDocMapper,
|
||||
.eq(BusPlanDocAssociation::getDocId, purchaseDoc.getId())
|
||||
.list();
|
||||
if (CollUtil.isNotEmpty(planDocAssociationList)) {
|
||||
Map<Long, BigDecimal> map = planDocAssociationList.stream()
|
||||
.peek(item -> {
|
||||
if (item.getDemandQuantity() == null) {
|
||||
item.setDemandQuantity(BigDecimal.ZERO);
|
||||
}
|
||||
}).collect(Collectors.toMap(BusPlanDocAssociation::getPlanId, BusPlanDocAssociation::getDemandQuantity));
|
||||
Map<Long, BigDecimal> map = planDocAssociationList.stream().collect(Collectors.toMap(BusPlanDocAssociation::getPlanId, BusPlanDocAssociation::getDemandQuantity));
|
||||
items = materialbatchdemandplanService.listByIds(map.keySet());
|
||||
items.forEach(item -> item.setDemandQuantity(map.get(item.getId())));
|
||||
}
|
||||
@ -583,25 +575,6 @@ public class BusPurchaseDocServiceImpl extends ServiceImpl<BusPurchaseDocMapper,
|
||||
return updateById(busPurchaseDoc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BusPurchaseDocVo> purchaseNote(Long projectId) {
|
||||
List<BusPurchaseDocVo> busPurchaseDocVos = baseMapper.selectVoList(new LambdaQueryWrapper<BusPurchaseDoc>()
|
||||
.eq(BusPurchaseDoc::getProjectId, projectId)
|
||||
.eq(BusPurchaseDoc::getDocType, "1")
|
||||
.eq(BusPurchaseDoc::getStatus, BusinessStatusEnum.FINISH.getStatus())
|
||||
.orderByDesc(BusPurchaseDoc::getCreateTime));
|
||||
if (busPurchaseDocVos == null){
|
||||
return List.of();
|
||||
}
|
||||
busPurchaseDocVos.forEach(v -> {
|
||||
BusMrpBase byId = mrpBaseService.getById(v.getMrpBaseId());
|
||||
if (byId != null) {
|
||||
v.setPlanCode(byId.getPlanCode());
|
||||
}
|
||||
});
|
||||
return busPurchaseDocVos;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据实体获取替换数据
|
||||
*
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
package org.dromara.cailiaoshebei.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.excel.ExcelReader;
|
||||
import com.alibaba.excel.read.metadata.ReadSheet;
|
||||
@ -105,7 +104,7 @@ public class BusTotalsupplyplanServiceImpl extends ServiceImpl<BusTotalsupplypla
|
||||
private LambdaQueryWrapper<BusTotalsupplyplan> buildQueryWrapper(BusTotalsupplyplanBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BusTotalsupplyplan> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getProjectId() != null, BusTotalsupplyplan::getProjectId, bo.getProjectId());
|
||||
lqw.eq(bo.getProjectId() != null ,BusTotalsupplyplan::getProjectId,bo.getProjectId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getTexture()), BusTotalsupplyplan::getTexture, bo.getTexture());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getBrand()), BusTotalsupplyplan::getBrand, bo.getBrand());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getQualityStandard()), BusTotalsupplyplan::getQualityStandard, bo.getQualityStandard());
|
||||
@ -240,14 +239,7 @@ public class BusTotalsupplyplanServiceImpl extends ServiceImpl<BusTotalsupplypla
|
||||
}
|
||||
// 关闭读取器
|
||||
excelReader.finish();
|
||||
if (CollUtil.isEmpty(allData)) {
|
||||
throw new ServiceException("未读取到有效数据", HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
// 过滤 id 为空的数据
|
||||
allData = allData.stream()
|
||||
.filter(Objects::nonNull)
|
||||
.filter(data -> data.getId() != null).toList();
|
||||
if (CollUtil.isEmpty(allData)) {
|
||||
if (allData.isEmpty()) {
|
||||
throw new ServiceException("未读取到有效数据", HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
// 处理导入的数据
|
||||
@ -256,7 +248,7 @@ public class BusTotalsupplyplanServiceImpl extends ServiceImpl<BusTotalsupplypla
|
||||
return this.updateBatchById(list);
|
||||
} catch (Exception e) {
|
||||
log.error("物资供货总计划,导入Excel文件失败", e);
|
||||
throw new ServiceException("导入失败, " + e.getMessage(), HttpStatus.ERROR);
|
||||
throw new ServiceException("导入失败: " + e.getMessage(), HttpStatus.ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
package org.dromara.common.utils;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.common.core.utils.MessageUtils;
|
||||
@ -10,8 +9,6 @@ import org.dromara.contractor.domain.SubConstructionUser;
|
||||
import org.dromara.mobileAttendanceMachine.DeviceMessageSender;
|
||||
import org.dromara.mobileAttendanceMachine.KqjEntity;
|
||||
import org.dromara.project.domain.BusAttendanceMachine;
|
||||
import org.dromara.project.domain.BusAttendanceMachineRepeat;
|
||||
import org.dromara.project.service.IBusAttendanceMachineRepeatService;
|
||||
import org.dromara.project.service.IBusAttendanceMachineService;
|
||||
import org.dromara.sms4j.api.SmsBlend;
|
||||
import org.dromara.sms4j.api.entity.SmsResponse;
|
||||
@ -22,7 +19,6 @@ import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
|
||||
@ -40,9 +36,6 @@ public class AsyncUtil {
|
||||
@Lazy
|
||||
private IBusAttendanceMachineService attendanceMachineService;
|
||||
|
||||
@Resource
|
||||
private IBusAttendanceMachineRepeatService busAttendanceMachineRepeatService;
|
||||
|
||||
//发送短信
|
||||
@Async
|
||||
public void sendSms(List<String> mobileList, String config) {
|
||||
@ -70,107 +63,22 @@ public class AsyncUtil {
|
||||
public void sendPersonnel(Long teamId, SubConstructionUser constructionUser) {
|
||||
SysOssVo byId = ossService.getById(Long.valueOf(constructionUser.getFacePic()));
|
||||
List<BusAttendanceMachine> list = attendanceMachineService.lambdaQuery().apply("FIND_IN_SET({0}, teams)", teamId).list();
|
||||
|
||||
ArrayList<BusAttendanceMachineRepeat> repeats = new ArrayList<>();
|
||||
for (BusAttendanceMachine machine : list) {
|
||||
Boolean b = deviceMessageSender.sendPersonnelInformation(machine.getSn(),
|
||||
constructionUser.getSysUserId().toString(), constructionUser.getUserName(), byId.getUrl());
|
||||
if (!b) {
|
||||
//记录下来重连时下发
|
||||
BusAttendanceMachineRepeat repeat = new BusAttendanceMachineRepeat();
|
||||
repeat.setSn(machine.getSn());
|
||||
repeat.setUserId(constructionUser.getSysUserId().toString());
|
||||
repeat.setUserName(constructionUser.getUserName());
|
||||
repeat.setUrl(byId.getUrl());
|
||||
repeat.setType("1");
|
||||
repeats.add(repeat);
|
||||
}
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(repeats)) {
|
||||
busAttendanceMachineRepeatService.saveBatch(repeats);
|
||||
deviceMessageSender.sendPersonnelInformation(machine.getSn(), constructionUser.getSysUserId().toString(), constructionUser.getUserName(), byId.getUrl());
|
||||
}
|
||||
}
|
||||
|
||||
//删除考勤人员
|
||||
@Async
|
||||
public void deletePersonnel(SubConstructionUser constructionUser) {
|
||||
ArrayList<BusAttendanceMachineRepeat> repeats = new ArrayList<>();
|
||||
List<BusAttendanceMachine> list = attendanceMachineService.lambdaQuery().apply("FIND_IN_SET({0}, teams)", constructionUser.getTeamId()).list();
|
||||
for (BusAttendanceMachine machine : list) {
|
||||
try {
|
||||
KqjEntity.CommonResponse commonResponse = deviceMessageSender.deleteUser(machine.getSn(), constructionUser.getSysUserId().toString());
|
||||
int code = commonResponse.getData().getCode();
|
||||
if (code != 0) {
|
||||
//记录下来重连时下发
|
||||
BusAttendanceMachineRepeat repeat = new BusAttendanceMachineRepeat();
|
||||
repeat.setSn(machine.getSn());
|
||||
repeat.setUserId(constructionUser.getSysUserId().toString());
|
||||
repeat.setUserName(constructionUser.getUserName());
|
||||
repeat.setUrl(null);
|
||||
repeat.setType("2");
|
||||
repeats.add(repeat);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("删除考勤人员异常", e);
|
||||
BusAttendanceMachineRepeat repeat = new BusAttendanceMachineRepeat();
|
||||
repeat.setSn(machine.getSn());
|
||||
repeat.setUserId(constructionUser.getSysUserId().toString());
|
||||
repeat.setUserName(constructionUser.getUserName());
|
||||
repeat.setUrl(null);
|
||||
repeat.setType("2");
|
||||
repeats.add(repeat);
|
||||
}
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(repeats)) {
|
||||
busAttendanceMachineRepeatService.saveBatch(repeats);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//重新下发人员
|
||||
@Async
|
||||
public void repeatSend(String sn) {
|
||||
List<BusAttendanceMachineRepeat> list = busAttendanceMachineRepeatService.lambdaQuery()
|
||||
.eq(BusAttendanceMachineRepeat::getSn, sn)
|
||||
.eq(BusAttendanceMachineRepeat::getType, "1")
|
||||
.list();
|
||||
List<Long> repeatIds = new ArrayList<>();
|
||||
for (BusAttendanceMachineRepeat repeat : list) {
|
||||
Boolean b = deviceMessageSender.sendPersonnelInformation(repeat.getSn(), repeat.getUserId(), repeat.getUserName(), repeat.getUrl());
|
||||
if (b) {
|
||||
//成功删除记录
|
||||
repeatIds.add(repeat.getId());
|
||||
}
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(repeatIds)) {
|
||||
busAttendanceMachineRepeatService.removeByIds(repeatIds);
|
||||
}
|
||||
}
|
||||
|
||||
//重新删除人员
|
||||
@Async
|
||||
public void repeatDelete(String sn) {
|
||||
List<BusAttendanceMachineRepeat> list = busAttendanceMachineRepeatService.lambdaQuery()
|
||||
.eq(BusAttendanceMachineRepeat::getSn, sn)
|
||||
.eq(BusAttendanceMachineRepeat::getType, "2")
|
||||
.list();
|
||||
List<Long> repeatIds = new ArrayList<>();
|
||||
for (BusAttendanceMachineRepeat repeat : list) {
|
||||
try {
|
||||
KqjEntity.CommonResponse commonResponse = deviceMessageSender.deleteUser(repeat.getSn(), repeat.getUserId());
|
||||
int code = commonResponse.getData().getCode();
|
||||
if (code == 0) {
|
||||
//成功删除记录
|
||||
repeatIds.add(repeat.getId());
|
||||
}
|
||||
deviceMessageSender.deleteUser(machine.getSn(), constructionUser.getSysUserId().toString());
|
||||
} catch (Exception e) {
|
||||
log.error("删除考勤人员异常", e);
|
||||
}
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(repeatIds)) {
|
||||
busAttendanceMachineRepeatService.removeByIds(repeatIds);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -25,26 +25,4 @@ public class BigDecimalUtil {
|
||||
.divide(divisor, 2, RoundingMode.HALF_UP);
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算环比 = (本次 - 上次) / 上次 × 100% 的绝对值
|
||||
*
|
||||
* @param thisNum 本次数量
|
||||
* @param lastNum 上次数量
|
||||
* @return 环比 = (本次 - 上次) / 上次 × 100% 的绝对值
|
||||
*/
|
||||
public static BigDecimal toLoopPercentage(BigDecimal thisNum, BigDecimal lastNum) {
|
||||
if (thisNum == null || lastNum == null) {
|
||||
return BigDecimal.valueOf(0.00);
|
||||
}
|
||||
if (lastNum.compareTo(BigDecimal.ZERO) == 0 && thisNum.compareTo(BigDecimal.ZERO) > 0) {
|
||||
return BigDecimal.valueOf(100.00);
|
||||
} else if (lastNum.compareTo(BigDecimal.ZERO) == 0) {
|
||||
return BigDecimal.valueOf(0.00);
|
||||
}
|
||||
return thisNum.subtract(lastNum)
|
||||
.multiply(new BigDecimal("100"))
|
||||
.divide(lastNum, 2, RoundingMode.HALF_UP)
|
||||
.abs();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -8,7 +8,6 @@ import org.dromara.common.constant.GeoJsonConstant;
|
||||
import org.dromara.common.core.constant.HttpStatus;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.domain.GeoPoint;
|
||||
import org.dromara.facility.domain.FacMatrix;
|
||||
import org.dromara.facility.domain.FacPhotovoltaicPanel;
|
||||
import org.dromara.facility.domain.dto.geojson.FacFeatureByPlane;
|
||||
import org.dromara.facility.domain.dto.geojson.FacFeatureByPoint;
|
||||
@ -339,29 +338,6 @@ public class JSTUtil {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 匹配最近方阵,获取该方阵的信息
|
||||
*
|
||||
* @param pointEntity 点位
|
||||
* @param matrices 方阵列表
|
||||
* @return 最近方阵的信息
|
||||
*/
|
||||
public static FacMatrix findContainingMatrix(
|
||||
RecognizeConvertCoordinateResult pointEntity,
|
||||
List<FacMatrix> matrices
|
||||
) {
|
||||
double lng = Double.parseDouble(pointEntity.getLng());
|
||||
double lat = Double.parseDouble(pointEntity.getLat());
|
||||
Point point = geometryFactory.createPoint(new Coordinate(lng, lat));
|
||||
for (FacMatrix matrix : matrices) {
|
||||
Polygon polygon = parsePolygon(matrix.getPositions());
|
||||
if (polygon.covers(point)) { // covers 包含边界}
|
||||
return matrix;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将 FacPhotovoltaicPanel.positions 转成 Polygon
|
||||
*/
|
||||
@ -400,7 +376,7 @@ public class JSTUtil {
|
||||
List<String> list = new ArrayList<>();
|
||||
list.add(s);
|
||||
List<GeoPoint> matchingRange = findMatchingRange("30.247348", "105.729797", list);
|
||||
System.out.println(matchingRange == null);
|
||||
System.out.println(matchingRange==null);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -79,38 +79,6 @@ public class JtsPointMatcher {
|
||||
return matched;
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算多边形的中心点
|
||||
*
|
||||
* @param points 多边形的顶点坐标
|
||||
* @return 中心点的坐标
|
||||
*/
|
||||
public static List<Double> polygonCentroid(List<List<Double>> points) {
|
||||
double area = 0;
|
||||
double cx = 0;
|
||||
double cy = 0;
|
||||
|
||||
int size = points.size();
|
||||
for (int i = 0; i < size - 1; i++) {
|
||||
double x0 = points.get(i).get(0);
|
||||
double y0 = points.get(i).get(1);
|
||||
double x1 = points.get(i + 1).get(0);
|
||||
double y1 = points.get(i + 1).get(1);
|
||||
|
||||
double cross = x0 * y1 - x1 * y0;
|
||||
area += cross;
|
||||
cx += (x0 + x1) * cross;
|
||||
cy += (y0 + y1) * cross;
|
||||
}
|
||||
|
||||
area *= 0.5;
|
||||
cx /= (6 * area);
|
||||
cy /= (6 * area);
|
||||
|
||||
return List.of(cx, cy);
|
||||
}
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
// A列表:待匹配点
|
||||
List<Coordinate> listA = List.of(
|
||||
|
||||
@ -1,106 +0,0 @@
|
||||
package org.dromara.complaintBox.app.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.domain.model.LoginUser;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.satoken.utils.LoginHelper;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.complaintBox.app.domain.vo.AppDetailsOfTheOpinionVo;
|
||||
import org.dromara.complaintBox.domain.bo.BusComplaintBoxBo;
|
||||
import org.dromara.complaintBox.domain.bo.BusComplaintBoxMessageLoggingBo;
|
||||
import org.dromara.complaintBox.domain.vo.BusComplaintBoxVo;
|
||||
import org.dromara.complaintBox.service.IBusComplaintBoxMessageLoggingService;
|
||||
import org.dromara.complaintBox.service.IBusComplaintBoxService;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 意见箱
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-29
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/app/complaintBox/complaintBox")
|
||||
public class AppBusComplaintBoxController extends BaseController {
|
||||
|
||||
@Lazy
|
||||
private final IBusComplaintBoxService busComplaintBoxService;
|
||||
@Lazy
|
||||
private final IBusComplaintBoxMessageLoggingService busComplaintBoxMessageLoggingService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询意见箱列表
|
||||
*/
|
||||
// @SaCheckPermission("appComplaintBox:complaintBox:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<BusComplaintBoxVo> list(BusComplaintBoxBo bo, PageQuery pageQuery) {
|
||||
LoginUser loginUser = LoginHelper.getLoginUser();
|
||||
if (loginUser != null) {
|
||||
bo.setUserId(loginUser.getUserId());
|
||||
}
|
||||
return busComplaintBoxService.appQueryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取意见箱详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
// @SaCheckPermission("appComplaintBox:complaintBox:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<AppDetailsOfTheOpinionVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(busComplaintBoxService.appQueryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增意见箱
|
||||
*/
|
||||
// @SaCheckPermission("appComplaintBox:complaintBox:add")
|
||||
@Log(title = "意见箱", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody BusComplaintBoxBo bo) {
|
||||
return toAjax(busComplaintBoxService.insertByBo(bo));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增意见回复
|
||||
*/
|
||||
// @SaCheckPermission("appComplaintBox:complaintBox:add")
|
||||
@Log(title = "意见箱", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping("/postAReply")
|
||||
public R<Void> postAReply(@Validated(AddGroup.class) @RequestBody BusComplaintBoxMessageLoggingBo bo) {
|
||||
return toAjax(busComplaintBoxMessageLoggingService.insertAppByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改意见阅读状态
|
||||
*/
|
||||
// @SaCheckPermission("appComplaintBox:complaintBox:edit")
|
||||
@Log(title = "意见箱", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping("/editCheckStatus")
|
||||
public R<Void> editCheckStatus(@Validated(EditGroup.class) @RequestBody BusComplaintBoxBo bo) {
|
||||
return toAjax(busComplaintBoxService.editCheckStatus(bo));
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,16 +0,0 @@
|
||||
package org.dromara.complaintBox.app.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import org.dromara.complaintBox.domain.vo.BusComplaintBoxMessageLoggingVo;
|
||||
import org.dromara.complaintBox.domain.vo.BusComplaintBoxVo;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class AppDetailsOfTheOpinionVo implements Serializable {
|
||||
|
||||
private BusComplaintBoxVo busComplaintBoxVo;
|
||||
|
||||
private List<BusComplaintBoxMessageLoggingVo> messageLoggingVos;
|
||||
}
|
||||
@ -1,124 +0,0 @@
|
||||
package org.dromara.complaintBox.controller;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.dromara.complaintBox.domain.bo.BusComplaintBoxDisposeLoggingBo;
|
||||
import org.dromara.complaintBox.domain.bo.BusComplaintBoxMessageLoggingBo;
|
||||
import org.dromara.complaintBox.domain.vo.BusComplaintBoxDisposeLoggingVo;
|
||||
import org.dromara.complaintBox.domain.vo.ComplaintBoxCountVo;
|
||||
import org.dromara.complaintBox.domain.vo.DetailsOfTheOpinionVo;
|
||||
import org.dromara.complaintBox.service.IBusComplaintBoxDisposeLoggingService;
|
||||
import org.dromara.complaintBox.service.IBusComplaintBoxMessageLoggingService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.complaintBox.domain.vo.BusComplaintBoxVo;
|
||||
import org.dromara.complaintBox.domain.bo.BusComplaintBoxBo;
|
||||
import org.dromara.complaintBox.service.IBusComplaintBoxService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 意见箱
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-29
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/complaintBox/complaintBox")
|
||||
public class BusComplaintBoxController extends BaseController {
|
||||
|
||||
private final IBusComplaintBoxService busComplaintBoxService;
|
||||
@Lazy
|
||||
@Autowired
|
||||
private IBusComplaintBoxMessageLoggingService busComplaintBoxMessageLoggingService;
|
||||
@Lazy
|
||||
@Autowired
|
||||
private IBusComplaintBoxDisposeLoggingService disposeLoggingService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询意见箱列表
|
||||
*/
|
||||
@SaCheckPermission("complaintBox:complaintBox:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<BusComplaintBoxVo> list(BusComplaintBoxBo bo, PageQuery pageQuery) {
|
||||
return busComplaintBoxService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
/**
|
||||
* 查询意见处理记录列表
|
||||
*/
|
||||
@SaCheckPermission("complaintBox:complaintBox:list")
|
||||
@GetMapping("/getDisposeLogList")
|
||||
public TableDataInfo<BusComplaintBoxDisposeLoggingVo> getDisposeLogList(BusComplaintBoxDisposeLoggingBo bo, PageQuery pageQuery) {
|
||||
return disposeLoggingService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
/**
|
||||
* web获取各个处理状态数量
|
||||
*/
|
||||
@SaCheckPermission("complaintBox:complaintBox:list")
|
||||
@GetMapping("/getCount")
|
||||
public R<List<ComplaintBoxCountVo>> getCount(BusComplaintBoxBo bo) {
|
||||
return R.ok(busComplaintBoxService.getCount(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取意见箱详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
// @SaCheckPermission("complaintBox:complaintBox:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<DetailsOfTheOpinionVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(busComplaintBoxService.getInfo(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增意见回复
|
||||
*/
|
||||
@SaCheckPermission("complaintBox:complaintBox:add")
|
||||
@Log(title = "意见箱", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping("/postAReply")
|
||||
public R<Void> postAReply(@Validated(AddGroup.class) @RequestBody BusComplaintBoxMessageLoggingBo bo) {
|
||||
return toAjax(busComplaintBoxMessageLoggingService.insertWebByBo(bo));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改意见阅读状态
|
||||
*/
|
||||
@SaCheckPermission("complaintBox:complaintBox:edit")
|
||||
@Log(title = "意见箱", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping("/editCheckStatus")
|
||||
public R<Void> editCheckStatus(@Validated(EditGroup.class) @RequestBody BusComplaintBoxBo bo) {
|
||||
return toAjax(busComplaintBoxService.editCheckStatus(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改意见阅读状态
|
||||
*/
|
||||
@SaCheckPermission("complaintBox:complaintBox:edit")
|
||||
@Log(title = "意见箱", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping("/editStatus")
|
||||
public R<Void> editStatus(@Validated(EditGroup.class) @RequestBody BusComplaintBoxBo bo) {
|
||||
return toAjax(busComplaintBoxService.editStatus(bo));
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,91 +0,0 @@
|
||||
package org.dromara.complaintBox.domain;
|
||||
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 意见箱对象 bus_complaint_box
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-29
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("bus_complaint_box")
|
||||
public class BusComplaintBox extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 公司id(当前登录人的顶层下一级部门id)
|
||||
*/
|
||||
private Long companyId;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 头像地址
|
||||
*/
|
||||
private Long avatar;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 意见类型(1、功能建议,2、Bug反馈,3、体验问题,4其他意见)
|
||||
*/
|
||||
private String opinionType;
|
||||
|
||||
/**
|
||||
* 详细描述
|
||||
*/
|
||||
private String detail;
|
||||
|
||||
/**
|
||||
* 上传图片(id,id之间使用','分割)
|
||||
*/
|
||||
private String fileId;
|
||||
|
||||
/**
|
||||
* 是否匿名提交(0、否,1、是)
|
||||
*/
|
||||
private String isCryptonym;
|
||||
|
||||
/**
|
||||
* 处理状态(0、待处理,5、处理中,9、已解决,10、退回,14、不予解决())
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 当前处理人id
|
||||
*/
|
||||
private Long currentDisposeUserId;
|
||||
|
||||
|
||||
}
|
||||
@ -1,61 +0,0 @@
|
||||
package org.dromara.complaintBox.domain;
|
||||
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 意见箱-意见处理记录对象 bus_complaint_box_dispose_logging
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-29
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("bus_complaint_box_dispose_logging")
|
||||
public class BusComplaintBoxDisposeLogging extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 意见id
|
||||
*/
|
||||
private Long complaintId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 头像地址
|
||||
*/
|
||||
private Long avatar;
|
||||
|
||||
/**
|
||||
* 是否退回(0、否,1、是)
|
||||
*/
|
||||
private String isRefund;
|
||||
|
||||
/**
|
||||
* 退回原因
|
||||
*/
|
||||
private String cause;
|
||||
|
||||
|
||||
}
|
||||
@ -1,76 +0,0 @@
|
||||
package org.dromara.complaintBox.domain;
|
||||
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 意见箱-意见沟通记录对象 bus_complaint_box_message_logging
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-29
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("bus_complaint_box_message_logging")
|
||||
public class BusComplaintBoxMessageLogging extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 意见id
|
||||
*/
|
||||
private Long complaintId;
|
||||
|
||||
/**
|
||||
* 回复用户id
|
||||
*/
|
||||
private Long replyUserId;
|
||||
|
||||
/**
|
||||
* 回复用户名
|
||||
*/
|
||||
private String replyUserName;
|
||||
|
||||
/**
|
||||
* 回复用户头像地址
|
||||
*/
|
||||
private Long replyAvatar;
|
||||
|
||||
/**
|
||||
* 被回复用户id
|
||||
*/
|
||||
private Long repliedUserId;
|
||||
|
||||
/**
|
||||
* 被回复用户名
|
||||
*/
|
||||
private String repliedUserName;
|
||||
|
||||
/**
|
||||
* 被回复用户头像地址
|
||||
*/
|
||||
private Long repliedAvatar;
|
||||
|
||||
/**
|
||||
* 消息内容
|
||||
*/
|
||||
private String details;
|
||||
|
||||
/**
|
||||
* 处理状态(0、未读,1、已读)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
|
||||
}
|
||||
@ -1,95 +0,0 @@
|
||||
package org.dromara.complaintBox.domain.bo;
|
||||
|
||||
import org.dromara.complaintBox.domain.BusComplaintBox;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 意见箱业务对象 bus_complaint_box
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-29
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = BusComplaintBox.class, reverseConvertGenerate = false)
|
||||
public class BusComplaintBoxBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@NotNull(message = "主键ID不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 公司id(当前登录人的顶层下一级部门id)
|
||||
*/
|
||||
private Long companyId;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@NotNull(message = "主键ID不能为空", groups = { AddGroup.class })
|
||||
private Long userId;
|
||||
/**
|
||||
* 当前处理人id
|
||||
*/
|
||||
private Long currentDisposeUserId;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 头像地址
|
||||
*/
|
||||
private Long avatar;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 意见类型(1、功能建议,2、Bug反馈,3、体验问题,4其他意见)
|
||||
*/
|
||||
private String opinionType;
|
||||
|
||||
/**
|
||||
* 详细描述
|
||||
*/
|
||||
private String detail;
|
||||
|
||||
/**
|
||||
* 上传图片(id,id之间使用','分割)
|
||||
*/
|
||||
private String fileId;
|
||||
|
||||
/**
|
||||
* 是否匿名提交(0、否,1、是)
|
||||
*/
|
||||
private String isCryptonym;
|
||||
|
||||
/**
|
||||
* 处理状态(0、待处理,5、处理中,9、已解决,14、关闭)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 退回原因
|
||||
*/
|
||||
private String cause;
|
||||
|
||||
|
||||
}
|
||||
@ -1,60 +0,0 @@
|
||||
package org.dromara.complaintBox.domain.bo;
|
||||
|
||||
import org.dromara.complaintBox.domain.BusComplaintBoxDisposeLogging;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 意见箱-意见处理记录业务对象 bus_complaint_box_dispose_logging
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-29
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = BusComplaintBoxDisposeLogging.class, reverseConvertGenerate = false)
|
||||
public class BusComplaintBoxDisposeLoggingBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@NotNull(message = "主键ID不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 意见id
|
||||
*/
|
||||
private Long complaintId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 头像地址
|
||||
*/
|
||||
private Long avatar;
|
||||
|
||||
/**
|
||||
* 是否退回(0、否,1、是)
|
||||
*/
|
||||
private String isRefund;
|
||||
|
||||
/**
|
||||
* 退回原因
|
||||
*/
|
||||
private String cause;
|
||||
|
||||
|
||||
}
|
||||
@ -1,80 +0,0 @@
|
||||
package org.dromara.complaintBox.domain.bo;
|
||||
|
||||
import org.dromara.complaintBox.domain.BusComplaintBoxMessageLogging;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 意见箱-意见沟通记录业务对象 bus_complaint_box_message_logging
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-29
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = BusComplaintBoxMessageLogging.class, reverseConvertGenerate = false)
|
||||
public class BusComplaintBoxMessageLoggingBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@NotNull(message = "主键ID不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 意见id
|
||||
*/
|
||||
private Long complaintId;
|
||||
|
||||
/**
|
||||
* 回复用户id
|
||||
*/
|
||||
private Long replyUserId;
|
||||
|
||||
/**
|
||||
* 回复用户名
|
||||
*/
|
||||
private String replyUserName;
|
||||
|
||||
/**
|
||||
* 回复用户头像地址
|
||||
*/
|
||||
private Long replyAvatar;
|
||||
|
||||
/**
|
||||
* 被回复用户id
|
||||
*/
|
||||
private Long repliedUserId;
|
||||
|
||||
/**
|
||||
* 被回复用户名
|
||||
*/
|
||||
private String repliedUserName;
|
||||
|
||||
/**
|
||||
* 被回复用户头像地址
|
||||
*/
|
||||
private Long repliedAvatar;
|
||||
|
||||
/**
|
||||
* 消息内容
|
||||
*/
|
||||
private String details;
|
||||
|
||||
/**
|
||||
* 处理状态(0、未读,1、已读)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 上一条沟通记录id
|
||||
*/
|
||||
private Long oldId;
|
||||
|
||||
|
||||
}
|
||||
@ -1,82 +0,0 @@
|
||||
package org.dromara.complaintBox.domain.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import org.dromara.complaintBox.domain.BusComplaintBoxDisposeLogging;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 意见箱-意见处理记录视图对象 bus_complaint_box_dispose_logging
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-29
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = BusComplaintBoxDisposeLogging.class)
|
||||
public class BusComplaintBoxDisposeLoggingVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 意见id
|
||||
*/
|
||||
@ExcelProperty(value = "意见id")
|
||||
private Long complaintId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@ExcelProperty(value = "用户id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
@ExcelProperty(value = "用户名")
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 头像地址
|
||||
*/
|
||||
@ExcelProperty(value = "头像地址")
|
||||
private Long avatar;
|
||||
|
||||
/**
|
||||
* 是否退回(0、否,1、是)
|
||||
*/
|
||||
@ExcelProperty(value = "是否退回", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "0=、否,1、是")
|
||||
private String isRefund;
|
||||
|
||||
/**
|
||||
* 退回原因
|
||||
*/
|
||||
@ExcelProperty(value = "退回原因")
|
||||
private String cause;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
|
||||
}
|
||||
@ -1,99 +0,0 @@
|
||||
package org.dromara.complaintBox.domain.vo;
|
||||
|
||||
import org.dromara.complaintBox.domain.BusComplaintBoxMessageLogging;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 意见箱-意见沟通记录视图对象 bus_complaint_box_message_logging
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-29
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = BusComplaintBoxMessageLogging.class)
|
||||
public class BusComplaintBoxMessageLoggingVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 意见id
|
||||
*/
|
||||
@ExcelProperty(value = "意见id")
|
||||
private Long complaintId;
|
||||
|
||||
/**
|
||||
* 回复用户id
|
||||
*/
|
||||
private Long replyUserId;
|
||||
|
||||
/**
|
||||
* 回复用户名
|
||||
*/
|
||||
private String replyUserName;
|
||||
|
||||
/**
|
||||
* 回复用户头像地址
|
||||
*/
|
||||
private Long replyAvatar;
|
||||
private String replyAvatarUrl;
|
||||
|
||||
/**
|
||||
* 被回复用户id
|
||||
*/
|
||||
private Long repliedUserId;
|
||||
|
||||
/**
|
||||
* 被回复用户名
|
||||
*/
|
||||
private String repliedUserName;
|
||||
|
||||
/**
|
||||
* 被回复用户头像地址
|
||||
*/
|
||||
private Long repliedAvatar;
|
||||
private String repliedAvatarUrl;
|
||||
|
||||
/**
|
||||
* 消息内容
|
||||
*/
|
||||
@ExcelProperty(value = "消息内容")
|
||||
private String details;
|
||||
|
||||
/**
|
||||
* 处理状态(0、未读,1、已读)
|
||||
*/
|
||||
@ExcelProperty(value = "处理状态", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "0=、未读,1、已读")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 发起人类型(0、发起人,1、处理人)
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
|
||||
}
|
||||
@ -1,125 +0,0 @@
|
||||
package org.dromara.complaintBox.domain.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import org.dromara.complaintBox.domain.BusComplaintBox;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 意见箱视图对象 bus_complaint_box
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-29
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = BusComplaintBox.class)
|
||||
public class BusComplaintBoxVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 公司id(当前登录人的顶层下一级部门id)
|
||||
*/
|
||||
@ExcelProperty(value = "公司id", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "当=前登录人的顶层下一级部门id")
|
||||
private Long companyId;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
@ExcelProperty(value = "项目id")
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@ExcelProperty(value = "用户id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
@ExcelProperty(value = "用户名")
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 头像地址
|
||||
*/
|
||||
@ExcelProperty(value = "头像地址")
|
||||
private Long avatar;
|
||||
private String avatarUrl;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
@ExcelProperty(value = "标题")
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 意见类型(1、功能建议,2、Bug反馈,3、体验问题,4其他意见)
|
||||
*/
|
||||
@ExcelProperty(value = "意见类型", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "1=、功能建议,2、Bug反馈,3、体验问题,4其他意见")
|
||||
private String opinionType;
|
||||
|
||||
/**
|
||||
* 详细描述
|
||||
*/
|
||||
@ExcelProperty(value = "详细描述")
|
||||
private String detail;
|
||||
|
||||
/**
|
||||
* 上传图片(id,id之间使用','分割)
|
||||
*/
|
||||
@ExcelProperty(value = "上传图片", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "i=d,id之间使用','分割")
|
||||
private String fileId;
|
||||
private List<String> fileUrls;
|
||||
|
||||
/**
|
||||
* 是否匿名提交(0、否,1、是)
|
||||
*/
|
||||
@ExcelProperty(value = "是否匿名提交", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "0=、否,1、是")
|
||||
private String isCryptonym;
|
||||
|
||||
/**
|
||||
* 处理状态(0、待处理,5、处理中,9、已解决,14、关闭)
|
||||
*/
|
||||
@ExcelProperty(value = "处理状态", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "0=、待处理,5、处理中,9、已解决,14、关闭")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 当前处理人id
|
||||
*/
|
||||
private Long currentDisposeUserId;
|
||||
|
||||
private Integer count;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
|
||||
}
|
||||
@ -1,18 +0,0 @@
|
||||
package org.dromara.complaintBox.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import org.dromara.common.translation.annotation.Translation;
|
||||
import org.dromara.common.translation.constant.TransConstant;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class ComplaintBoxCountVo implements Serializable {
|
||||
|
||||
private String type;
|
||||
|
||||
// @Translation(type = TransConstant.DICT_TYPE_TO_LABEL, mapper = "type",other = "opinion_processing_status")
|
||||
private String typeName;
|
||||
|
||||
private Integer count;
|
||||
}
|
||||
@ -1,14 +0,0 @@
|
||||
package org.dromara.complaintBox.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class DetailsOfTheOpinionVo implements Serializable {
|
||||
|
||||
private BusComplaintBoxVo busComplaintBoxVo;
|
||||
|
||||
private List<BusComplaintBoxMessageLoggingVo> messageLoggingVos;
|
||||
}
|
||||
@ -1,15 +0,0 @@
|
||||
package org.dromara.complaintBox.mapper;
|
||||
|
||||
import org.dromara.complaintBox.domain.BusComplaintBoxDisposeLogging;
|
||||
import org.dromara.complaintBox.domain.vo.BusComplaintBoxDisposeLoggingVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 意见箱-意见处理记录Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-29
|
||||
*/
|
||||
public interface BusComplaintBoxDisposeLoggingMapper extends BaseMapperPlus<BusComplaintBoxDisposeLogging, BusComplaintBoxDisposeLoggingVo> {
|
||||
|
||||
}
|
||||
@ -1,26 +0,0 @@
|
||||
package org.dromara.complaintBox.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.dromara.complaintBox.domain.BusComplaintBox;
|
||||
import org.dromara.complaintBox.domain.bo.BusComplaintBoxBo;
|
||||
import org.dromara.complaintBox.domain.vo.BusComplaintBoxVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
import org.dromara.complaintBox.domain.vo.ComplaintBoxCountVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 意见箱Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-29
|
||||
*/
|
||||
public interface BusComplaintBoxMapper extends BaseMapperPlus<BusComplaintBox, BusComplaintBoxVo> {
|
||||
|
||||
Page<BusComplaintBoxVo> selectVoPageList(@Param("page") Page<BusComplaintBoxVo> page, @Param("bo") BusComplaintBoxBo bo);
|
||||
|
||||
Page<BusComplaintBoxVo> selectVoPageWebList(@Param("page") Page<BusComplaintBoxVo> page, @Param("bo") BusComplaintBoxBo bo);
|
||||
|
||||
List<ComplaintBoxCountVo> getCount(@Param("bo") BusComplaintBoxBo bo);
|
||||
}
|
||||
@ -1,15 +0,0 @@
|
||||
package org.dromara.complaintBox.mapper;
|
||||
|
||||
import org.dromara.complaintBox.domain.BusComplaintBoxMessageLogging;
|
||||
import org.dromara.complaintBox.domain.vo.BusComplaintBoxMessageLoggingVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 意见箱-意见沟通记录Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-29
|
||||
*/
|
||||
public interface BusComplaintBoxMessageLoggingMapper extends BaseMapperPlus<BusComplaintBoxMessageLogging, BusComplaintBoxMessageLoggingVo> {
|
||||
|
||||
}
|
||||
@ -1,70 +0,0 @@
|
||||
package org.dromara.complaintBox.service;
|
||||
|
||||
import org.dromara.complaintBox.domain.vo.BusComplaintBoxDisposeLoggingVo;
|
||||
import org.dromara.complaintBox.domain.bo.BusComplaintBoxDisposeLoggingBo;
|
||||
import org.dromara.complaintBox.domain.BusComplaintBoxDisposeLogging;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 意见箱-意见处理记录Service接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-29
|
||||
*/
|
||||
public interface IBusComplaintBoxDisposeLoggingService extends IService<BusComplaintBoxDisposeLogging>{
|
||||
|
||||
/**
|
||||
* 查询意见箱-意见处理记录
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 意见箱-意见处理记录
|
||||
*/
|
||||
BusComplaintBoxDisposeLoggingVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询意见箱-意见处理记录列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 意见箱-意见处理记录分页列表
|
||||
*/
|
||||
TableDataInfo<BusComplaintBoxDisposeLoggingVo> queryPageList(BusComplaintBoxDisposeLoggingBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的意见箱-意见处理记录列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 意见箱-意见处理记录列表
|
||||
*/
|
||||
List<BusComplaintBoxDisposeLoggingVo> queryList(BusComplaintBoxDisposeLoggingBo bo);
|
||||
|
||||
/**
|
||||
* 新增意见箱-意见处理记录
|
||||
*
|
||||
* @param bo 意见箱-意见处理记录
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(BusComplaintBoxDisposeLoggingBo bo);
|
||||
|
||||
/**
|
||||
* 修改意见箱-意见处理记录
|
||||
*
|
||||
* @param bo 意见箱-意见处理记录
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(BusComplaintBoxDisposeLoggingBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除意见箱-意见处理记录信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@ -1,84 +0,0 @@
|
||||
package org.dromara.complaintBox.service;
|
||||
|
||||
import org.dromara.complaintBox.domain.vo.BusComplaintBoxMessageLoggingVo;
|
||||
import org.dromara.complaintBox.domain.bo.BusComplaintBoxMessageLoggingBo;
|
||||
import org.dromara.complaintBox.domain.BusComplaintBoxMessageLogging;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 意见箱-意见沟通记录Service接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-29
|
||||
*/
|
||||
public interface IBusComplaintBoxMessageLoggingService extends IService<BusComplaintBoxMessageLogging>{
|
||||
|
||||
/**
|
||||
* 查询意见箱-意见沟通记录
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 意见箱-意见沟通记录
|
||||
*/
|
||||
BusComplaintBoxMessageLoggingVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询意见箱-意见沟通记录列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 意见箱-意见沟通记录分页列表
|
||||
*/
|
||||
TableDataInfo<BusComplaintBoxMessageLoggingVo> queryPageList(BusComplaintBoxMessageLoggingBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的意见箱-意见沟通记录列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 意见箱-意见沟通记录列表
|
||||
*/
|
||||
List<BusComplaintBoxMessageLoggingVo> queryList(BusComplaintBoxMessageLoggingBo bo);
|
||||
|
||||
/**
|
||||
* 新增意见箱-意见沟通记录
|
||||
*
|
||||
* @param bo 意见箱-意见沟通记录
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertAppByBo(BusComplaintBoxMessageLoggingBo bo);
|
||||
/**
|
||||
* 新增意见箱-意见沟通记录
|
||||
*
|
||||
* @param bo 意见箱-意见沟通记录
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertWebByBo(BusComplaintBoxMessageLoggingBo bo);
|
||||
|
||||
/**
|
||||
* 修改意见箱-意见沟通记录
|
||||
*
|
||||
* @param bo 意见箱-意见沟通记录
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(BusComplaintBoxMessageLoggingBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除意见箱-意见沟通记录信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* 通过意见id获取沟通记录
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
List<BusComplaintBoxMessageLoggingVo> getMessageLogListByComplaintId(Long id);
|
||||
}
|
||||
@ -1,117 +0,0 @@
|
||||
package org.dromara.complaintBox.service;
|
||||
|
||||
import org.dromara.complaintBox.app.domain.vo.AppDetailsOfTheOpinionVo;
|
||||
import org.dromara.complaintBox.domain.vo.BusComplaintBoxVo;
|
||||
import org.dromara.complaintBox.domain.bo.BusComplaintBoxBo;
|
||||
import org.dromara.complaintBox.domain.BusComplaintBox;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.dromara.complaintBox.domain.vo.ComplaintBoxCountVo;
|
||||
import org.dromara.complaintBox.domain.vo.DetailsOfTheOpinionVo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 意见箱Service接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-29
|
||||
*/
|
||||
public interface IBusComplaintBoxService extends IService<BusComplaintBox>{
|
||||
|
||||
/**
|
||||
* 查询意见箱
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 意见箱
|
||||
*/
|
||||
BusComplaintBoxVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询意见箱列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 意见箱分页列表
|
||||
*/
|
||||
TableDataInfo<BusComplaintBoxVo> queryPageList(BusComplaintBoxBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的意见箱列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 意见箱列表
|
||||
*/
|
||||
List<BusComplaintBoxVo> queryList(BusComplaintBoxBo bo);
|
||||
|
||||
/**
|
||||
* 新增意见箱
|
||||
*
|
||||
* @param bo 意见箱
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(BusComplaintBoxBo bo);
|
||||
|
||||
/**
|
||||
* 修改意见箱
|
||||
*
|
||||
* @param bo 意见箱
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(BusComplaintBoxBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除意见箱信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* app获取当前用户提出意见列表
|
||||
* @param bo
|
||||
* @param pageQuery
|
||||
* @return
|
||||
*/
|
||||
TableDataInfo<BusComplaintBoxVo> appQueryPageList(BusComplaintBoxBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* APP获取当前意见详情
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
AppDetailsOfTheOpinionVo appQueryById(Long id);
|
||||
|
||||
/**
|
||||
* 获取当前意见详情
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
DetailsOfTheOpinionVo getInfo(Long id);
|
||||
|
||||
/**
|
||||
* 修改沟通记录阅读状态
|
||||
* @param bo
|
||||
* @return
|
||||
*/
|
||||
int editCheckStatus(BusComplaintBoxBo bo);
|
||||
|
||||
/**
|
||||
* web获取各个处理状态数量
|
||||
* @param bo
|
||||
* @return
|
||||
*/
|
||||
List<ComplaintBoxCountVo> getCount(BusComplaintBoxBo bo);
|
||||
|
||||
/**
|
||||
* 修改意见状态
|
||||
* @param bo
|
||||
* @return
|
||||
*/
|
||||
int editStatus(BusComplaintBoxBo bo);
|
||||
}
|
||||
@ -1,134 +0,0 @@
|
||||
package org.dromara.complaintBox.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.complaintBox.domain.bo.BusComplaintBoxDisposeLoggingBo;
|
||||
import org.dromara.complaintBox.domain.vo.BusComplaintBoxDisposeLoggingVo;
|
||||
import org.dromara.complaintBox.domain.BusComplaintBoxDisposeLogging;
|
||||
import org.dromara.complaintBox.mapper.BusComplaintBoxDisposeLoggingMapper;
|
||||
import org.dromara.complaintBox.service.IBusComplaintBoxDisposeLoggingService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 意见箱-意见处理记录Service业务层处理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-29
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class BusComplaintBoxDisposeLoggingServiceImpl extends ServiceImpl<BusComplaintBoxDisposeLoggingMapper, BusComplaintBoxDisposeLogging> implements IBusComplaintBoxDisposeLoggingService {
|
||||
|
||||
private final BusComplaintBoxDisposeLoggingMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询意见箱-意见处理记录
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 意见箱-意见处理记录
|
||||
*/
|
||||
@Override
|
||||
public BusComplaintBoxDisposeLoggingVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询意见箱-意见处理记录列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 意见箱-意见处理记录分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BusComplaintBoxDisposeLoggingVo> queryPageList(BusComplaintBoxDisposeLoggingBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BusComplaintBoxDisposeLogging> lqw = buildQueryWrapper(bo);
|
||||
Page<BusComplaintBoxDisposeLoggingVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的意见箱-意见处理记录列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 意见箱-意见处理记录列表
|
||||
*/
|
||||
@Override
|
||||
public List<BusComplaintBoxDisposeLoggingVo> queryList(BusComplaintBoxDisposeLoggingBo bo) {
|
||||
LambdaQueryWrapper<BusComplaintBoxDisposeLogging> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BusComplaintBoxDisposeLogging> buildQueryWrapper(BusComplaintBoxDisposeLoggingBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BusComplaintBoxDisposeLogging> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByDesc(BusComplaintBoxDisposeLogging::getCreateTime);
|
||||
lqw.eq(bo.getComplaintId() != null, BusComplaintBoxDisposeLogging::getComplaintId, bo.getComplaintId());
|
||||
lqw.eq(bo.getUserId() != null, BusComplaintBoxDisposeLogging::getUserId, bo.getUserId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getUserName()), BusComplaintBoxDisposeLogging::getUserName, bo.getUserName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getIsRefund()), BusComplaintBoxDisposeLogging::getIsRefund, bo.getIsRefund());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增意见箱-意见处理记录
|
||||
*
|
||||
* @param bo 意见箱-意见处理记录
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(BusComplaintBoxDisposeLoggingBo bo) {
|
||||
BusComplaintBoxDisposeLogging add = MapstructUtils.convert(bo, BusComplaintBoxDisposeLogging.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改意见箱-意见处理记录
|
||||
*
|
||||
* @param bo 意见箱-意见处理记录
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(BusComplaintBoxDisposeLoggingBo bo) {
|
||||
BusComplaintBoxDisposeLogging update = MapstructUtils.convert(bo, BusComplaintBoxDisposeLogging.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BusComplaintBoxDisposeLogging entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除意见箱-意见处理记录信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@ -1,223 +0,0 @@
|
||||
package org.dromara.complaintBox.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.dromara.common.core.domain.model.LoginUser;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.satoken.utils.LoginHelper;
|
||||
import org.dromara.complaintBox.domain.BusComplaintBox;
|
||||
import org.dromara.complaintBox.mapper.BusComplaintBoxMapper;
|
||||
import org.dromara.complaintBox.service.IBusComplaintBoxService;
|
||||
import org.dromara.system.domain.vo.SysUserVo;
|
||||
import org.dromara.system.service.ISysUserService;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.complaintBox.domain.bo.BusComplaintBoxMessageLoggingBo;
|
||||
import org.dromara.complaintBox.domain.vo.BusComplaintBoxMessageLoggingVo;
|
||||
import org.dromara.complaintBox.domain.BusComplaintBoxMessageLogging;
|
||||
import org.dromara.complaintBox.mapper.BusComplaintBoxMessageLoggingMapper;
|
||||
import org.dromara.complaintBox.service.IBusComplaintBoxMessageLoggingService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 意见箱-意见沟通记录Service业务层处理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-29
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class BusComplaintBoxMessageLoggingServiceImpl extends ServiceImpl<BusComplaintBoxMessageLoggingMapper, BusComplaintBoxMessageLogging> implements IBusComplaintBoxMessageLoggingService {
|
||||
|
||||
private final BusComplaintBoxMessageLoggingMapper baseMapper;
|
||||
@Lazy
|
||||
private final ISysUserService sysUserService;
|
||||
// @Lazy
|
||||
private final BusComplaintBoxMapper busComplaintBoxMapper;
|
||||
|
||||
/**
|
||||
* 查询意见箱-意见沟通记录
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 意见箱-意见沟通记录
|
||||
*/
|
||||
@Override
|
||||
public BusComplaintBoxMessageLoggingVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询意见箱-意见沟通记录列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 意见箱-意见沟通记录分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BusComplaintBoxMessageLoggingVo> queryPageList(BusComplaintBoxMessageLoggingBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BusComplaintBoxMessageLogging> lqw = buildQueryWrapper(bo);
|
||||
Page<BusComplaintBoxMessageLoggingVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的意见箱-意见沟通记录列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 意见箱-意见沟通记录列表
|
||||
*/
|
||||
@Override
|
||||
public List<BusComplaintBoxMessageLoggingVo> queryList(BusComplaintBoxMessageLoggingBo bo) {
|
||||
LambdaQueryWrapper<BusComplaintBoxMessageLogging> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BusComplaintBoxMessageLogging> buildQueryWrapper(BusComplaintBoxMessageLoggingBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BusComplaintBoxMessageLogging> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByDesc(BusComplaintBoxMessageLogging::getId);
|
||||
lqw.eq(bo.getComplaintId() != null, BusComplaintBoxMessageLogging::getComplaintId, bo.getComplaintId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDetails()), BusComplaintBoxMessageLogging::getDetails, bo.getDetails());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), BusComplaintBoxMessageLogging::getStatus, bo.getStatus());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增意见箱-意见沟通记录
|
||||
*
|
||||
* @param bo 意见箱-意见沟通记录
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertAppByBo(BusComplaintBoxMessageLoggingBo bo) {
|
||||
LoginUser loginUser = LoginHelper.getLoginUser();
|
||||
if (loginUser == null) {
|
||||
throw new ServiceException("登录信息出错,请重新登录!!!");
|
||||
}
|
||||
BusComplaintBox busComplaintBox = busComplaintBoxMapper.selectById(bo.getComplaintId());
|
||||
if (busComplaintBox == null) {
|
||||
throw new ServiceException("意见信息找不到!!!");
|
||||
}
|
||||
if ("14".equals(busComplaintBox.getStatus()) || "9".equals(busComplaintBox.getStatus())) {
|
||||
throw new ServiceException("意见已关闭!!!");
|
||||
}
|
||||
SysUserVo sysUserVo = sysUserService.selectUserById(loginUser.getUserId());
|
||||
bo.setReplyUserId(sysUserVo.getUserId());
|
||||
bo.setReplyUserName(sysUserVo.getNickName());
|
||||
bo.setReplyAvatar(sysUserVo.getAvatar());
|
||||
BusComplaintBoxMessageLogging add = MapstructUtils.convert(bo, BusComplaintBoxMessageLogging.class);
|
||||
if (busComplaintBox.getCurrentDisposeUserId() != null) {
|
||||
SysUserVo userVo = sysUserService.selectUserById(busComplaintBox.getCurrentDisposeUserId());
|
||||
if (userVo != null) {
|
||||
add.setRepliedUserId(userVo.getUserId());
|
||||
add.setRepliedUserName(userVo.getUserName());
|
||||
add.setRepliedAvatar(userVo.getAvatar());
|
||||
}
|
||||
}
|
||||
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean insertWebByBo(BusComplaintBoxMessageLoggingBo bo) {
|
||||
LoginUser loginUser = LoginHelper.getLoginUser();
|
||||
if (loginUser == null) {
|
||||
throw new ServiceException("登录信息出错,请重新登录!!!");
|
||||
}
|
||||
BusComplaintBox busComplaintBox = busComplaintBoxMapper.selectById(bo.getComplaintId());
|
||||
if (busComplaintBox == null) {
|
||||
throw new ServiceException("意见信息找不到!!!");
|
||||
}
|
||||
if (busComplaintBox.getCurrentDisposeUserId()!= null && !loginUser.getUserId().equals(busComplaintBox.getCurrentDisposeUserId())) {
|
||||
throw new ServiceException("处理人异常");
|
||||
}
|
||||
if ("0".equals(busComplaintBox.getStatus())){
|
||||
throw new ServiceException("意见未处理,不能发布信息");
|
||||
}
|
||||
if ("14".equals(busComplaintBox.getStatus()) || "9".equals(busComplaintBox.getStatus())) {
|
||||
throw new ServiceException("意见已关闭!!!");
|
||||
}
|
||||
SysUserVo sysUserVo = sysUserService.selectUserById(loginUser.getUserId());
|
||||
bo.setReplyUserId(sysUserVo.getUserId());
|
||||
bo.setReplyUserName(sysUserVo.getNickName());
|
||||
bo.setReplyAvatar(sysUserVo.getAvatar());
|
||||
BusComplaintBoxMessageLogging add = MapstructUtils.convert(bo, BusComplaintBoxMessageLogging.class);
|
||||
add.setRepliedUserId(busComplaintBox.getUserId());
|
||||
add.setRepliedUserName(busComplaintBox.getUserName());
|
||||
add.setRepliedAvatar(busComplaintBox.getAvatar());
|
||||
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
// if ("0".equals(busComplaintBox.getStatus())){
|
||||
// busComplaintBox.setStatus("5");
|
||||
// busComplaintBox.setCurrentDisposeUserId(sysUserVo.getUserId());
|
||||
// busComplaintBoxMapper.updateById(busComplaintBox);
|
||||
// }
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改意见箱-意见沟通记录
|
||||
*
|
||||
* @param bo 意见箱-意见沟通记录
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(BusComplaintBoxMessageLoggingBo bo) {
|
||||
BusComplaintBoxMessageLogging update = MapstructUtils.convert(bo, BusComplaintBoxMessageLogging.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BusComplaintBoxMessageLogging entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除意见箱-意见沟通记录信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据意见id获取沟通记录
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<BusComplaintBoxMessageLoggingVo> getMessageLogListByComplaintId(Long id) {
|
||||
return baseMapper.selectVoList(new LambdaQueryWrapper<BusComplaintBoxMessageLogging>().eq(BusComplaintBoxMessageLogging::getComplaintId, id));
|
||||
}
|
||||
}
|
||||
@ -1,380 +0,0 @@
|
||||
package org.dromara.complaintBox.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.dromara.common.core.domain.model.LoginUser;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.satoken.utils.LoginHelper;
|
||||
import org.dromara.complaintBox.app.domain.vo.AppDetailsOfTheOpinionVo;
|
||||
import org.dromara.complaintBox.domain.BusComplaintBoxDisposeLogging;
|
||||
import org.dromara.complaintBox.domain.BusComplaintBoxMessageLogging;
|
||||
import org.dromara.complaintBox.domain.vo.BusComplaintBoxMessageLoggingVo;
|
||||
import org.dromara.complaintBox.domain.vo.ComplaintBoxCountVo;
|
||||
import org.dromara.complaintBox.domain.vo.DetailsOfTheOpinionVo;
|
||||
import org.dromara.complaintBox.mapper.BusComplaintBoxMessageLoggingMapper;
|
||||
import org.dromara.complaintBox.service.IBusComplaintBoxDisposeLoggingService;
|
||||
import org.dromara.complaintBox.service.IBusComplaintBoxMessageLoggingService;
|
||||
import org.dromara.system.domain.vo.SysDeptVo;
|
||||
import org.dromara.system.domain.vo.SysOssVo;
|
||||
import org.dromara.system.domain.vo.SysUserVo;
|
||||
import org.dromara.system.service.ISysDeptService;
|
||||
import org.dromara.system.service.ISysOssService;
|
||||
import org.dromara.system.service.ISysUserService;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.complaintBox.domain.bo.BusComplaintBoxBo;
|
||||
import org.dromara.complaintBox.domain.vo.BusComplaintBoxVo;
|
||||
import org.dromara.complaintBox.domain.BusComplaintBox;
|
||||
import org.dromara.complaintBox.mapper.BusComplaintBoxMapper;
|
||||
import org.dromara.complaintBox.service.IBusComplaintBoxService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 意见箱Service业务层处理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-11-29
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class BusComplaintBoxServiceImpl extends ServiceImpl<BusComplaintBoxMapper, BusComplaintBox> implements IBusComplaintBoxService {
|
||||
|
||||
private final BusComplaintBoxMapper baseMapper;
|
||||
// @Lazy
|
||||
private final BusComplaintBoxMessageLoggingMapper messageLoggingMapper;
|
||||
@Lazy
|
||||
@Resource
|
||||
private ISysUserService sysUserService;
|
||||
@Lazy
|
||||
@Resource
|
||||
private ISysDeptService sysDeptService;
|
||||
@Lazy
|
||||
@Resource
|
||||
private ISysOssService sysOssService;
|
||||
@Lazy
|
||||
@Resource
|
||||
private IBusComplaintBoxDisposeLoggingService disposeLoggingService;
|
||||
|
||||
/**
|
||||
* 查询意见箱
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 意见箱
|
||||
*/
|
||||
@Override
|
||||
public BusComplaintBoxVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询意见箱列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 意见箱分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BusComplaintBoxVo> queryPageList(BusComplaintBoxBo bo, PageQuery pageQuery) {
|
||||
Page<BusComplaintBoxVo> result = baseMapper.selectVoPageWebList(pageQuery.build(), bo);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的意见箱列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 意见箱列表
|
||||
*/
|
||||
@Override
|
||||
public List<BusComplaintBoxVo> queryList(BusComplaintBoxBo bo) {
|
||||
LambdaQueryWrapper<BusComplaintBox> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BusComplaintBox> buildQueryWrapper(BusComplaintBoxBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BusComplaintBox> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByDesc(BusComplaintBox::getId);
|
||||
lqw.eq(bo.getCompanyId() != null, BusComplaintBox::getCompanyId, bo.getCompanyId());
|
||||
lqw.eq(bo.getProjectId() != null, BusComplaintBox::getProjectId, bo.getProjectId());
|
||||
lqw.eq(bo.getUserId() != null, BusComplaintBox::getUserId, bo.getUserId());
|
||||
lqw.eq(bo.getCurrentDisposeUserId() != null,
|
||||
BusComplaintBox::getCurrentDisposeUserId, bo.getCurrentDisposeUserId())
|
||||
.or()
|
||||
.isNull(BusComplaintBox::getCurrentDisposeUserId);
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getTitle()), BusComplaintBox::getTitle, bo.getTitle());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getOpinionType()), BusComplaintBox::getOpinionType, bo.getOpinionType());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDetail()), BusComplaintBox::getDetail, bo.getDetail());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getFileId()), BusComplaintBox::getFileId, bo.getFileId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getIsCryptonym()), BusComplaintBox::getIsCryptonym, bo.getIsCryptonym());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), BusComplaintBox::getStatus, bo.getStatus());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增意见箱
|
||||
*
|
||||
* @param bo 意见箱
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(BusComplaintBoxBo bo) {
|
||||
BusComplaintBox add = MapstructUtils.convert(bo, BusComplaintBox.class);
|
||||
//获取用户信息进行填充
|
||||
SysUserVo sysUserVo = sysUserService.selectUserById(add.getUserId());
|
||||
add.setAvatar(sysUserVo.getAvatar());
|
||||
add.setUserName(sysUserVo.getNickName());
|
||||
//获取部门信息
|
||||
SysDeptVo sysDeptVo =sysDeptService.selectDeptById(sysUserVo.getDeptId());
|
||||
if (sysDeptVo != null) {
|
||||
String[] split = sysDeptVo.getAncestors().split(",");
|
||||
if (split.length > 0) {
|
||||
//当祖级列表长度大于3时取第2个作为公司id
|
||||
if (split.length > 1) {
|
||||
add.setCompanyId(Long.parseLong(split[1]));
|
||||
}else {
|
||||
add.setCompanyId(Long.parseLong(split[0]));
|
||||
}
|
||||
}
|
||||
}
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改意见箱
|
||||
*
|
||||
* @param bo 意见箱
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(BusComplaintBoxBo bo) {
|
||||
BusComplaintBox update = MapstructUtils.convert(bo, BusComplaintBox.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BusComplaintBox entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除意见箱信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* app获取当前用户提出意见列表
|
||||
* @param bo
|
||||
* @param pageQuery
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BusComplaintBoxVo> appQueryPageList(BusComplaintBoxBo bo, PageQuery pageQuery) {
|
||||
Page<BusComplaintBoxVo> result = baseMapper.selectVoPageList(pageQuery.build(), bo);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* app获取当前意见详情
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AppDetailsOfTheOpinionVo appQueryById(Long id) {
|
||||
AppDetailsOfTheOpinionVo vo = new AppDetailsOfTheOpinionVo();
|
||||
BusComplaintBoxVo busComplaintBoxVo = baseMapper.selectVoById(id);
|
||||
if(busComplaintBoxVo == null){
|
||||
throw new ServiceException("找不到意见信息!!!");
|
||||
}
|
||||
if (busComplaintBoxVo.getAvatar() != null){
|
||||
SysOssVo ossVo = sysOssService.getById(busComplaintBoxVo.getAvatar());
|
||||
if (ossVo != null){
|
||||
busComplaintBoxVo.setAvatarUrl(ossVo.getUrl());
|
||||
}
|
||||
}
|
||||
if (busComplaintBoxVo.getFileId() != null){
|
||||
String[] split = busComplaintBoxVo.getFileId().split(",");
|
||||
List<Long> fileIds = Arrays.stream(split)
|
||||
.filter(str -> str != null && !str.trim().isEmpty()) // 过滤空值和空白字符串
|
||||
.map(str -> {
|
||||
try {
|
||||
return Long.valueOf(str.trim());
|
||||
} catch (NumberFormatException e) {
|
||||
// 转换失败时可返回null,后续再过滤
|
||||
return null;
|
||||
}
|
||||
})
|
||||
.filter(Objects::nonNull) // 过滤转换失败的null值
|
||||
.toList();
|
||||
List<SysOssVo> sysOssVos = sysOssService.listByIds(fileIds);
|
||||
List<String> urls = new ArrayList<>();
|
||||
sysOssVos.forEach(sysOssVo -> {
|
||||
if (sysOssVo != null){
|
||||
urls.add(sysOssVo.getUrl());
|
||||
}
|
||||
});
|
||||
busComplaintBoxVo.setFileUrls(urls);
|
||||
}
|
||||
vo.setBusComplaintBoxVo(busComplaintBoxVo);
|
||||
List<BusComplaintBoxMessageLoggingVo> messageLoggingVos = messageLoggingMapper.selectVoList(new LambdaQueryWrapper<BusComplaintBoxMessageLogging>().eq(BusComplaintBoxMessageLogging::getComplaintId, id));
|
||||
if(CollectionUtils.isNotEmpty(messageLoggingVos)){
|
||||
messageLoggingVos.forEach(mvo->{
|
||||
if (mvo.getReplyAvatar() != null){
|
||||
SysOssVo ossVo = sysOssService.getById(mvo.getReplyAvatar());
|
||||
if (ossVo != null){
|
||||
mvo.setReplyAvatarUrl(ossVo.getUrl());
|
||||
}
|
||||
}
|
||||
if (mvo.getRepliedAvatar() != null){
|
||||
SysOssVo ossVo = sysOssService.getById(mvo.getRepliedAvatar());
|
||||
if (ossVo != null){
|
||||
mvo.setRepliedAvatarUrl(ossVo.getUrl());
|
||||
}
|
||||
}
|
||||
});
|
||||
vo.setMessageLoggingVos(messageLoggingVos);
|
||||
}
|
||||
return vo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DetailsOfTheOpinionVo getInfo(Long id) {
|
||||
DetailsOfTheOpinionVo vo = new DetailsOfTheOpinionVo();
|
||||
BusComplaintBoxVo busComplaintBoxVo = baseMapper.selectVoById(id);
|
||||
if(busComplaintBoxVo == null){
|
||||
throw new ServiceException("找不到意见信息!!!");
|
||||
}
|
||||
vo.setBusComplaintBoxVo(busComplaintBoxVo);
|
||||
List<BusComplaintBoxMessageLoggingVo> messageLoggingVos = messageLoggingMapper.selectVoList(new LambdaQueryWrapper<BusComplaintBoxMessageLogging>().eq(BusComplaintBoxMessageLogging::getComplaintId, id));
|
||||
if(CollectionUtils.isNotEmpty(messageLoggingVos)){
|
||||
messageLoggingVos.forEach(messageLoggingVo->{
|
||||
messageLoggingVo.setType(messageLoggingVo.getReplyUserId().equals(busComplaintBoxVo.getUserId()) ? 0 : 1);
|
||||
if (messageLoggingVo.getReplyAvatar() != null){
|
||||
SysOssVo ossVo = sysOssService.getById(messageLoggingVo.getReplyAvatar());
|
||||
if (ossVo != null){
|
||||
messageLoggingVo.setReplyAvatarUrl(ossVo.getUrl());
|
||||
}
|
||||
}
|
||||
if (messageLoggingVo.getRepliedAvatar() != null){
|
||||
SysOssVo ossVo = sysOssService.getById(messageLoggingVo.getRepliedAvatar());
|
||||
if (ossVo != null){
|
||||
messageLoggingVo.setRepliedAvatarUrl(ossVo.getUrl());
|
||||
}
|
||||
}
|
||||
});
|
||||
vo.setMessageLoggingVos(messageLoggingVos);
|
||||
}
|
||||
return vo;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* app修改沟通记录阅读状态
|
||||
* @param bo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int editCheckStatus(BusComplaintBoxBo bo) {
|
||||
if (bo.getId() == null || bo.getUserId() == null) {
|
||||
return 1;
|
||||
}
|
||||
Long count = messageLoggingMapper.selectCount(new LambdaQueryWrapper<BusComplaintBoxMessageLogging>()
|
||||
.eq(BusComplaintBoxMessageLogging::getStatus,"0")
|
||||
.eq(BusComplaintBoxMessageLogging::getComplaintId, bo.getId())
|
||||
.eq(BusComplaintBoxMessageLogging::getRepliedUserId, bo.getUserId()));
|
||||
if (count == 0) {
|
||||
return 1;
|
||||
}
|
||||
return messageLoggingMapper.update(new LambdaUpdateWrapper<BusComplaintBoxMessageLogging>()
|
||||
.set(BusComplaintBoxMessageLogging::getStatus,"1")
|
||||
.eq(BusComplaintBoxMessageLogging::getComplaintId,bo.getId())
|
||||
.eq(BusComplaintBoxMessageLogging::getRepliedUserId,bo.getUserId()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ComplaintBoxCountVo> getCount(BusComplaintBoxBo bo) {
|
||||
|
||||
return baseMapper.getCount(bo);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int editStatus(BusComplaintBoxBo bo) {
|
||||
if (bo.getStatus() == null){
|
||||
throw new ServiceException("意见状态不能为空");
|
||||
}
|
||||
BusComplaintBoxVo busComplaintBoxVo = baseMapper.selectVoById(bo.getId());
|
||||
if (busComplaintBoxVo == null){
|
||||
throw new ServiceException("找不到意见!!");
|
||||
}
|
||||
if ("14".equals(busComplaintBoxVo.getStatus())){
|
||||
throw new ServiceException("该意见已经关闭,不允许再修改状态");
|
||||
}
|
||||
LambdaUpdateWrapper<BusComplaintBox> lqw = new LambdaUpdateWrapper<BusComplaintBox>();
|
||||
lqw.set(BusComplaintBox::getStatus, bo.getStatus());
|
||||
lqw.eq(BusComplaintBox::getId, bo.getId());
|
||||
if ("5".equals(bo.getStatus())){
|
||||
BusComplaintBoxDisposeLogging logging = new BusComplaintBoxDisposeLogging();
|
||||
logging.setComplaintId(bo.getId());
|
||||
LoginUser loginUser = LoginHelper.getLoginUser();
|
||||
SysUserVo sysUserVo = sysUserService.selectUserById(loginUser.getUserId());
|
||||
if (sysUserVo == null){
|
||||
throw new ServiceException("找不到当前登录用户信息!");
|
||||
}
|
||||
lqw.set(BusComplaintBox::getCurrentDisposeUserId, loginUser.getUserId());
|
||||
logging.setUserId(loginUser.getUserId());
|
||||
logging.setUserName(sysUserVo.getNickName());
|
||||
logging.setAvatar(sysUserVo.getAvatar());
|
||||
disposeLoggingService.save(logging);
|
||||
}
|
||||
if ("0".equals(bo.getStatus())){
|
||||
lqw.set(BusComplaintBox::getCurrentDisposeUserId, null);
|
||||
BusComplaintBoxDisposeLogging logging = disposeLoggingService.getBaseMapper()
|
||||
.selectOne(new LambdaQueryWrapper<BusComplaintBoxDisposeLogging>()
|
||||
.eq(BusComplaintBoxDisposeLogging::getComplaintId, bo.getId())
|
||||
.eq(BusComplaintBoxDisposeLogging::getUserId, busComplaintBoxVo.getCurrentDisposeUserId())
|
||||
.eq(BusComplaintBoxDisposeLogging::getIsRefund, "0"));
|
||||
if (logging == null){
|
||||
throw new ServiceException("找不到处理人记录");
|
||||
}
|
||||
logging.setIsRefund("1");
|
||||
logging.setCause(bo.getCause());
|
||||
disposeLoggingService.updateById(logging);
|
||||
}
|
||||
return baseMapper.update(lqw);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,65 +0,0 @@
|
||||
package org.dromara.contractor.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.contractor.domain.dto.attendancemachineuser.SubAttendanceMachineSendInfoUserReq;
|
||||
import org.dromara.contractor.domain.dto.attendancemachineuser.SubAttendanceMachineUserQueryReq;
|
||||
import org.dromara.contractor.domain.dto.attendancemachineuser.SubAttendanceMachineUserRemoveReq;
|
||||
import org.dromara.contractor.domain.vo.SubAttendanceMachineUserVo;
|
||||
import org.dromara.contractor.service.ISubAttendanceMachineUserService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 分包考勤机用户
|
||||
*
|
||||
* @author lilemy
|
||||
* @date 2025-11-21 15:38
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/contractor/attendanceMachineUser")
|
||||
public class SubAttendanceMachineUserController extends BaseController {
|
||||
|
||||
private final ISubAttendanceMachineUserService subAttendanceMachineUserService;
|
||||
|
||||
/**
|
||||
* 查询考勤机用户列表
|
||||
*/
|
||||
@SaCheckPermission("contractor:attendanceMachineUser:list")
|
||||
@GetMapping("/list")
|
||||
public R<List<SubAttendanceMachineUserVo>> list(SubAttendanceMachineUserQueryReq req) {
|
||||
return R.ok(subAttendanceMachineUserService.queryList(req));
|
||||
}
|
||||
|
||||
/**
|
||||
* 下发用户到考勤机中
|
||||
*/
|
||||
@SaCheckPermission("contractor:attendanceMachineUser:add")
|
||||
@Log(title = "分包考勤机用户", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping("/send")
|
||||
public R<String> sendPersonInfo(@Validated @RequestBody SubAttendanceMachineSendInfoUserReq req) {
|
||||
return R.ok(subAttendanceMachineUserService.sendPersonInfo(req));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除考勤机用户
|
||||
*/
|
||||
@SaCheckPermission("contractor:attendanceMachineUser:remove")
|
||||
@Log(title = "分包考勤机用户", businessType = BusinessType.DELETE)
|
||||
@RepeatSubmit()
|
||||
@DeleteMapping()
|
||||
public R<Void> remove(@Validated @RequestBody SubAttendanceMachineUserRemoveReq req) {
|
||||
return toAjax(subAttendanceMachineUserService.remove(req));
|
||||
}
|
||||
|
||||
}
|
||||
@ -140,7 +140,7 @@ public class SubConstructionUserController extends BaseController {
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
// @SaCheckPermission("contractor:constructionUser:query")
|
||||
@SaCheckPermission("contractor:constructionUser:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<SubConstructionUserVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
@ -397,7 +397,6 @@ public class SubConstructionUserController extends BaseController {
|
||||
vo.setUploadFile("部分上传");
|
||||
}
|
||||
dataList.add(vo);
|
||||
order++;
|
||||
}
|
||||
// 写入当前Sheet的数据
|
||||
excelWriter.write(dataList, writeSheet);
|
||||
@ -442,9 +441,7 @@ public class SubConstructionUserController extends BaseController {
|
||||
} else {
|
||||
vo.setUploadFile("部分上传");
|
||||
}
|
||||
vo.setTeamName(null);
|
||||
dataList.add(vo);
|
||||
order++;
|
||||
}
|
||||
// 写入当前Sheet的数据
|
||||
excelWriter.write(dataList, writeSheet);
|
||||
|
||||
@ -21,7 +21,6 @@ import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 施工人员文件存储
|
||||
@ -46,21 +45,6 @@ public class SubConstructionUserFileController extends BaseController {
|
||||
return R.ok(constructionUserFileService.queryList(req));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 下载用户文件的ZIP(按类型分文件夹)
|
||||
* @param userId 用户ID
|
||||
*/
|
||||
@GetMapping("/downloadFiles")
|
||||
public void downloadUserFilesByType(Long userId,String type, HttpServletResponse response) {
|
||||
try {
|
||||
constructionUserFileService.generateTypeGroupZip(userId,type, response);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出施工人员文件存储列表
|
||||
*/
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
package org.dromara.contractor.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
@ -39,9 +38,9 @@ public class SubSubcontractController extends BaseController {
|
||||
private ISubSubcontractService subcontractService;
|
||||
|
||||
/**
|
||||
* 查询分包合同列表 project:projectTeam:addTeam
|
||||
* 查询分包合同列表
|
||||
*/
|
||||
@SaCheckPermission(value = {"contractor:subcontract:list", "project:projectTeam:addTeam"}, mode = SaMode.OR)
|
||||
@SaCheckPermission("contractor:subcontract:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<SubSubcontractVo> list(SubSubcontractQueryReq req, PageQuery pageQuery) {
|
||||
return subcontractService.queryPageList(req, pageQuery);
|
||||
|
||||
@ -1,32 +0,0 @@
|
||||
package org.dromara.contractor.domain.dto.attendancemachineuser;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lilemy
|
||||
* @date 2025-11-21 15:36
|
||||
*/
|
||||
@Data
|
||||
public class SubAttendanceMachineSendInfoUserReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -6517799483848691652L;
|
||||
|
||||
/**
|
||||
* 考勤机主键ID
|
||||
*/
|
||||
@NotNull(message = "考勤机不能为空")
|
||||
private Long machineId;
|
||||
|
||||
/**
|
||||
* 用户ID列表
|
||||
*/
|
||||
@NotNull(message = "用户列表不能为空")
|
||||
private List<Long> userIds;
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user