Compare commits
26 Commits
55b96c059e
...
prod
Author | SHA1 | Date | |
---|---|---|---|
a8d8a76fd2 | |||
a661d4f24c | |||
118b1820cf | |||
f44904a5f1 | |||
8326c3110f | |||
fa5dc0e7ac | |||
6bce3c3dea | |||
33de0ea8eb | |||
0233c59e32 | |||
b9bad1c006 | |||
1cc9186022 | |||
01678fda6a | |||
e706540fe3 | |||
55090acb64 | |||
9173e02471 | |||
7a9a648d9a | |||
92d5fefc26 | |||
5199f104b9 | |||
a716991576 | |||
bb7fa6f71e | |||
1a7ba72978 | |||
e4d1be276b | |||
f3d0db70f8 | |||
ee88d9ea09 | |||
604d1b6da2 | |||
3aa5c53149 |
@ -53,13 +53,13 @@ spring:
|
||||
username: xinnengyuandev
|
||||
password: StRWCZdZirysNSs2
|
||||
# 从库数据源
|
||||
slave:
|
||||
lazy: true
|
||||
type: ${spring.datasource.type}
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://192.168.110.2:13386/zmkgdev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
||||
username: zmkgdev
|
||||
password: JhYxREf25AXdy3h8
|
||||
# slave:
|
||||
# lazy: true
|
||||
# type: ${spring.datasource.type}
|
||||
# driverClassName: com.mysql.cj.jdbc.Driver
|
||||
# url: jdbc:mysql://192.168.110.2:13386/zmkgdev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
||||
# username: zmkgdev
|
||||
# password: JhYxREf25AXdy3h8
|
||||
# oracle:
|
||||
# type: ${spring.datasource.type}
|
||||
# driverClassName: oracle.jdbc.OracleDriver
|
||||
|
289
xinnengyuan/ruoyi-admin/src/main/resources/application-local.yml
Normal file
289
xinnengyuan/ruoyi-admin/src/main/resources/application-local.yml
Normal file
@ -0,0 +1,289 @@
|
||||
--- # 临时文件存储位置 避免临时文件被系统清理报错
|
||||
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:
|
||||
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/xinnengyuanlocal?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
||||
username: xinnengyuanlocal
|
||||
password: 5Rff6TrihXZAAT5M
|
||||
# # 从库数据源
|
||||
# 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: 6
|
||||
# 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: true
|
||||
# 短信拦截限制单手机号每分钟最大发送,只对开启了拦截的配置有效
|
||||
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: 您的accessKey
|
||||
access-key-secret: 您的accessKeySecret
|
||||
signature: 您的短信签名
|
||||
sdk-app-id: 您的sdkAppId
|
||||
|
||||
--- # 三方授权
|
||||
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: 3acf9f1a43dc4209841e0893003db0a2
|
||||
app-secret: 4bbf3e9394f55d3af6e3af27b2d3db36
|
||||
# 斯巴达算法
|
||||
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:50070
|
@ -22,7 +22,7 @@ captcha:
|
||||
# 开发环境配置
|
||||
server:
|
||||
# 服务器的HTTP端口,默认为8080
|
||||
port: 8898
|
||||
port: 8899
|
||||
servlet:
|
||||
# 应用的访问路径
|
||||
context-path: /
|
||||
@ -259,6 +259,8 @@ springdoc:
|
||||
packages-to-scan: org.dromara.cailiaoshebei
|
||||
- group: 18.产值模块
|
||||
packages-to-scan: org.dromara.out
|
||||
- group: 19.消息模块
|
||||
packages-to-scan: org.dromara.message
|
||||
# knife4j的增强配置,不需要增强可以不配
|
||||
knife4j:
|
||||
enable: true
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -2,12 +2,21 @@ package org.dromara.test;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.formalities.domain.bo.AddBusFormalitiesAreConsolidatedBo;
|
||||
import org.dromara.formalities.domain.bo.BusFormalitiesAreConsolidatedBo;
|
||||
import org.dromara.formalities.domain.bo.BusListOfFormalitiesBo;
|
||||
import org.dromara.formalities.domain.vo.BusListOfFormalitiesVo;
|
||||
import org.dromara.formalities.service.IBusFormalitiesAreConsolidatedService;
|
||||
import org.dromara.formalities.service.IBusListOfFormalitiesService;
|
||||
import org.dromara.manager.ys7manager.Ys7Manager;
|
||||
import org.dromara.manager.ys7manager.Ys7RequestUtils;
|
||||
import org.dromara.manager.ys7manager.vo.Ys7QueryDeviceResponseVo;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -34,4 +43,56 @@ public class Ys7Test {
|
||||
System.out.println(pic);
|
||||
}
|
||||
|
||||
@Resource
|
||||
private IBusListOfFormalitiesService busListOfFormalitiesService;
|
||||
|
||||
@Test
|
||||
public void test111(){
|
||||
BusListOfFormalitiesBo busListOfFormalitiesBo = new BusListOfFormalitiesBo();
|
||||
// busListOfFormalitiesBo.setName("test1");
|
||||
// busListOfFormalitiesBo.setPid(1955976169241026561L);
|
||||
// busListOfFormalitiesService.insertByBo(busListOfFormalitiesBo);
|
||||
// List<BusListOfFormalitiesVo> tree = busListOfFormalitiesService.getTree(busListOfFormalitiesBo);
|
||||
// System.out.println(tree);
|
||||
Boolean b = busListOfFormalitiesService.deleteWithValidByIds(1955976169241026561L, true);
|
||||
System.out.println(b);
|
||||
|
||||
}
|
||||
|
||||
@Resource
|
||||
private IBusFormalitiesAreConsolidatedService formalitiesAreConsolidatedService;
|
||||
|
||||
@Test
|
||||
public void test222(){
|
||||
BusFormalitiesAreConsolidatedBo busFormalitiesAreConsolidatedBo = new BusFormalitiesAreConsolidatedBo();
|
||||
// List<AddBusFormalitiesAreConsolidatedBo> addBusFormalitiesAreConsolidatedBos = new ArrayList<>();
|
||||
// AddBusFormalitiesAreConsolidatedBo bo1 = new AddBusFormalitiesAreConsolidatedBo();
|
||||
// bo1.setFormalitiesId(1955977461032103939L);
|
||||
// AddBusFormalitiesAreConsolidatedBo bo2 = new AddBusFormalitiesAreConsolidatedBo();
|
||||
// bo2.setFormalitiesId(1955977461032103940L);
|
||||
// bo2.setFormalitiesPid(1955977461032103939L);
|
||||
// AddBusFormalitiesAreConsolidatedBo bo3 = new AddBusFormalitiesAreConsolidatedBo();
|
||||
// bo3.setFormalitiesId(1955977461032103941L);
|
||||
// bo3.setFormalitiesPid(1955977461032103939L);
|
||||
// AddBusFormalitiesAreConsolidatedBo bo4 = new AddBusFormalitiesAreConsolidatedBo();
|
||||
// bo4.setFormalitiesId(1955977461032103942L);
|
||||
// bo4.setFormalitiesPid(1955977461032103939L);
|
||||
// addBusFormalitiesAreConsolidatedBos.add(bo1);
|
||||
// addBusFormalitiesAreConsolidatedBos.add(bo2);
|
||||
// addBusFormalitiesAreConsolidatedBos.add(bo3);
|
||||
// addBusFormalitiesAreConsolidatedBos.add(bo4);
|
||||
// busFormalitiesAreConsolidatedBo.setAddBusFormalitiesAreConsolidatedBos(addBusFormalitiesAreConsolidatedBos);
|
||||
// busFormalitiesAreConsolidatedBo.setProjectId(1555L);
|
||||
// Boolean b = formalitiesAreConsolidatedService.insertByBo(busFormalitiesAreConsolidatedBo);
|
||||
// System.out.println(b);
|
||||
// busFormalitiesAreConsolidatedBo.setId(1956013379818409985L);
|
||||
// busFormalitiesAreConsolidatedBo.setHead("舟山");
|
||||
// busFormalitiesAreConsolidatedBo.setPlanTheStartTime(new Date());
|
||||
// busFormalitiesAreConsolidatedBo.setRemark("asdasd");
|
||||
// busFormalitiesAreConsolidatedBo.setStatus(0);
|
||||
// MultipartFile[] files = {};
|
||||
// Boolean b = formalitiesAreConsolidatedService.updateByBo(busFormalitiesAreConsolidatedBo, files);
|
||||
// System.out.println(b);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -24,37 +24,37 @@ public enum BusinessStatusEnum {
|
||||
/**
|
||||
* 已撤销
|
||||
*/
|
||||
CANCEL("cancel", "已撤销"),
|
||||
CANCEL("cancel", "已撤销",6),
|
||||
|
||||
/**
|
||||
* 草稿
|
||||
*/
|
||||
DRAFT("draft", "草稿"),
|
||||
DRAFT("draft", "草稿",3),
|
||||
|
||||
/**
|
||||
* 待审核
|
||||
*/
|
||||
WAITING("waiting", "待审核"),
|
||||
WAITING("waiting", "待审核",2),
|
||||
|
||||
/**
|
||||
* 已完成
|
||||
*/
|
||||
FINISH("finish", "已完成"),
|
||||
FINISH("finish", "已完成",1),
|
||||
|
||||
/**
|
||||
* 已作废
|
||||
*/
|
||||
INVALID("invalid", "已作废"),
|
||||
INVALID("invalid", "已作废",7),
|
||||
|
||||
/**
|
||||
* 已退回
|
||||
*/
|
||||
BACK("back", "已退回"),
|
||||
BACK("back", "已退回",4),
|
||||
|
||||
/**
|
||||
* 已终止
|
||||
*/
|
||||
TERMINATION("termination", "已终止");
|
||||
TERMINATION("termination", "已终止",5);
|
||||
|
||||
/**
|
||||
* 状态
|
||||
@ -66,6 +66,11 @@ public enum BusinessStatusEnum {
|
||||
*/
|
||||
private final String desc;
|
||||
|
||||
/**
|
||||
* 排序字段
|
||||
*/
|
||||
private final int order;
|
||||
|
||||
private static final Map<String, BusinessStatusEnum> STATUS_MAP = Arrays.stream(BusinessStatusEnum.values())
|
||||
.collect(Collectors.toConcurrentMap(BusinessStatusEnum::getStatus, Function.identity()));
|
||||
|
||||
|
@ -0,0 +1,226 @@
|
||||
package org.dromara.common.excel.coryUtils;
|
||||
|
||||
import org.apache.poi.hssf.usermodel.HSSFSheet;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
import org.apache.poi.xssf.usermodel.XSSFSheet;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 工程量清单解析
|
||||
* @Author 铁憨憨
|
||||
* @Date 2025/8/11 16:29
|
||||
* @Version 1.0
|
||||
*/
|
||||
public class BillOfQuantitiesUtils {
|
||||
// 中文数字正则表达式,用于检测顶层节点
|
||||
private static final String CHINESE_NUMBERS_REGEX = "[一二三四五六七八九十]+";
|
||||
// 标记是否已找到中文数字开头的行
|
||||
private static boolean foundChineseStart = false;
|
||||
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
// 文件路径,请根据实际情况修改
|
||||
FileInputStream file = new FileInputStream(new File(
|
||||
"E:\\cory\\app\\xwechat_files\\wxid_8q1mhp57yu6p22_50ad\\msg\\file\\2025-08\\设计管理模块说明\\8、工程量清单表.xls"));
|
||||
|
||||
HSSFWorkbook workbook = new HSSFWorkbook(file);
|
||||
|
||||
for (int sheetIndex = 0; sheetIndex < workbook.getNumberOfSheets(); sheetIndex++) {
|
||||
HSSFSheet sheet = workbook.getSheetAt(sheetIndex);
|
||||
System.out.println("===== 工作表: " + sheet.getSheetName() + " =====");
|
||||
|
||||
// 重置标记,处理新工作表时重新开始检测
|
||||
foundChineseStart = false;
|
||||
List<List<String>> data = new ArrayList<>();
|
||||
|
||||
boolean isFirstRow = true;
|
||||
for (Row row : sheet) {
|
||||
// 跳过表头行
|
||||
if (isFirstRow) {
|
||||
isFirstRow = false;
|
||||
continue;
|
||||
}
|
||||
|
||||
List<String> rowData = new ArrayList<>();
|
||||
// 读取A到E列(索引0到4)
|
||||
for (int cellIndex = 0; cellIndex < 5; cellIndex++) {
|
||||
Cell cell = row.getCell(cellIndex, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK);
|
||||
rowData.add(getCellValue(cell));
|
||||
}
|
||||
|
||||
// 检查是否找到中文数字开头的行
|
||||
String aColumnValue = rowData.get(0).trim();
|
||||
if (aColumnValue.matches(CHINESE_NUMBERS_REGEX)) {
|
||||
foundChineseStart = true;
|
||||
}
|
||||
|
||||
// 只有找到中文数字开头的行之后,才开始收集数据
|
||||
if (foundChineseStart) {
|
||||
data.add(rowData);
|
||||
}
|
||||
}
|
||||
|
||||
if (!data.isEmpty()) {
|
||||
// 构建树形结构
|
||||
TreeNode root = new TreeNode(new ArrayList<>());
|
||||
Map<String, TreeNode> nodeMap = new HashMap<>();
|
||||
nodeMap.put("", root);
|
||||
List<String> nonEmptyKeys = new ArrayList<>(); // 记录非空A列值的顺序
|
||||
|
||||
for (List<String> row : data) {
|
||||
String key = row.get(0).trim();
|
||||
TreeNode node = new TreeNode(row);
|
||||
|
||||
if (!key.isEmpty()) {
|
||||
String parentKey = getParentKey(key);
|
||||
TreeNode parent = nodeMap.get(parentKey);
|
||||
|
||||
if (parent == null) {
|
||||
parent = new TreeNode(new ArrayList<>());
|
||||
nodeMap.put(parentKey, parent);
|
||||
TreeNode grandParent = nodeMap.get(getParentKey(parentKey));
|
||||
if (grandParent != null) {
|
||||
grandParent.addChild(parent);
|
||||
} else {
|
||||
// 如果没有更高级别的父节点,就挂到根节点
|
||||
root.addChild(parent);
|
||||
}
|
||||
}
|
||||
|
||||
parent.addChild(node);
|
||||
nodeMap.put(key, node);
|
||||
nonEmptyKeys.add(key);
|
||||
} else {
|
||||
// A列为空,挂到上一个非空节点下
|
||||
if (!nonEmptyKeys.isEmpty()) {
|
||||
String lastKey = nonEmptyKeys.get(nonEmptyKeys.size() - 1);
|
||||
TreeNode parent = nodeMap.get(lastKey);
|
||||
if (parent != null) {
|
||||
parent.addChild(node);
|
||||
}
|
||||
} else {
|
||||
root.addChild(node);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 打印树形结构
|
||||
printTree(root, 0);
|
||||
} else {
|
||||
System.out.println("该工作表中未找到以中文数字(一、二、三...)开头的数据行");
|
||||
}
|
||||
}
|
||||
|
||||
workbook.close();
|
||||
file.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取单元格的值,处理不同数据类型
|
||||
*/
|
||||
private static String getCellValue(Cell cell) {
|
||||
if (cell == null) {
|
||||
return "";
|
||||
}
|
||||
|
||||
switch (cell.getCellType()) {
|
||||
case STRING:
|
||||
return cell.getStringCellValue().trim();
|
||||
case NUMERIC:
|
||||
// 处理数字,移除不必要的.0后缀
|
||||
String numericValue = String.valueOf(cell.getNumericCellValue());
|
||||
if (numericValue.endsWith(".0")) {
|
||||
return numericValue.substring(0, numericValue.length() - 2);
|
||||
}
|
||||
return numericValue;
|
||||
case BOOLEAN:
|
||||
return String.valueOf(cell.getBooleanCellValue());
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据A列的值确定父节点的键
|
||||
*/
|
||||
private static String getParentKey(String key) {
|
||||
// 中文数字(一、二、三...)的父节点是根节点
|
||||
if (key.matches(CHINESE_NUMBERS_REGEX)) {
|
||||
return "";
|
||||
}
|
||||
|
||||
// 数字格式(1、1.1、1.2.1等)的父节点是上一级
|
||||
if (key.matches("\\d+(\\.\\d+)*")) {
|
||||
int lastDotIndex = key.lastIndexOf('.');
|
||||
if (lastDotIndex > 0) {
|
||||
return key.substring(0, lastDotIndex);
|
||||
} else {
|
||||
// 一级数字(如1、2)的父节点是根节点或最近的中文数字节点
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
// 其他格式默认父节点是根节点
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* 以可视化方式打印树形结构
|
||||
*/
|
||||
private static void printTree(TreeNode node, int depth) {
|
||||
// 跳过空的中间节点
|
||||
if (node.data.isEmpty() && node.children.size() == 1) {
|
||||
printTree(node.children.get(0), depth);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!node.data.isEmpty()) {
|
||||
// 打印层级连接线
|
||||
for (int i = 0; i < depth; i++) {
|
||||
// 最后一级节点用└──,其他用├──
|
||||
if (i == depth - 1) {
|
||||
System.out.print("└── ");
|
||||
} else {
|
||||
System.out.print("│ ");
|
||||
}
|
||||
}
|
||||
// 打印数据,突出显示A列的值
|
||||
System.out.println("[" + node.data.get(0) + "] " + node.data.subList(1, node.data.size()));
|
||||
}
|
||||
|
||||
// 递归打印子节点
|
||||
for (TreeNode child : node.children) {
|
||||
printTree(child, depth + 1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 树形节点类
|
||||
*/
|
||||
static class TreeNode {
|
||||
List<String> data;
|
||||
List<TreeNode> children;
|
||||
|
||||
TreeNode(List<String> data) {
|
||||
this.data = data;
|
||||
this.children = new ArrayList<>();
|
||||
}
|
||||
|
||||
void addChild(TreeNode child) {
|
||||
this.children.add(child);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,484 @@
|
||||
package org.dromara.common.excel.coryUtils;
|
||||
|
||||
import org.apache.poi.hssf.usermodel.HSSFSheet;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
import org.apache.poi.xssf.usermodel.XSSFSheet;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author 铁憨憨
|
||||
* @Date 2025/8/11 16:44
|
||||
* @Version 1.0
|
||||
*/
|
||||
public class ExcelReader {
|
||||
// 中文数字正则表达式,用于检测顶层节点
|
||||
public static final String CHINESE_NUMBERS_REGEX = "[一二三四五六七八九十]+";
|
||||
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
// 1. 读取Excel中所有sheet的完整数据
|
||||
String filePath = "E:\\cory\\app\\xwechat_files\\wxid_8q1mhp57yu6p22_50ad\\msg\\file\\2025-08\\设计管理模块说明\\8、工程量清单表.xls";
|
||||
ExcelData excelData = readExcelData(filePath);
|
||||
// ExcelData excelData = ExcelReader.readExcelFromMultipartFile(file);
|
||||
|
||||
// 2. 处理每个sheet的数据并打印树形结构
|
||||
for (SheetData sheetData : excelData.getSheetDataList()) {
|
||||
System.out.println("===== 工作表: " + sheetData.getSheetName() + " =====");
|
||||
|
||||
if (sheetData.getData().isEmpty()) {
|
||||
System.out.println("该工作表中未找到以中文数字(一、二、三...)开头的数据行");
|
||||
continue;
|
||||
}
|
||||
|
||||
// 构建树形结构
|
||||
TreeNode root = buildTree(sheetData.getData());
|
||||
|
||||
// 打印树形结构
|
||||
printTree(root, 0);
|
||||
}
|
||||
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 从MultipartFile读取Excel数据
|
||||
*/
|
||||
public static ExcelData readExcelFromMultipartFile(MultipartFile file) throws IOException {
|
||||
if (file.isEmpty()) {
|
||||
throw new IllegalArgumentException("上传的文件为空");
|
||||
}
|
||||
|
||||
ExcelData excelData = new ExcelData();
|
||||
List<SheetData> sheetDataList = new ArrayList<>();
|
||||
|
||||
// 获取文件名判断文件类型
|
||||
String fileName = file.getOriginalFilename();
|
||||
if (fileName == null || (!fileName.toLowerCase().endsWith(".xls") && !fileName.toLowerCase().endsWith(".xlsx"))) {
|
||||
throw new IllegalArgumentException("不支持的文件类型,仅支持xls和xlsx格式");
|
||||
}
|
||||
|
||||
boolean isXlsx = fileName.toLowerCase().endsWith(".xlsx");
|
||||
|
||||
// 从MultipartFile获取输入流
|
||||
try (InputStream stream = file.getInputStream();
|
||||
org.apache.poi.ss.usermodel.Workbook workbook = isXlsx ?
|
||||
new XSSFWorkbook(stream) : new HSSFWorkbook(stream)) {
|
||||
|
||||
for (int sheetIndex = 0; sheetIndex < workbook.getNumberOfSheets(); sheetIndex++) {
|
||||
org.apache.poi.ss.usermodel.Sheet sheet = workbook.getSheetAt(sheetIndex);
|
||||
SheetData sheetData = new SheetData();
|
||||
sheetData.setSheetName(sheet.getSheetName());
|
||||
|
||||
processSheetData(sheet, sheetData);
|
||||
sheetDataList.add(sheetData);
|
||||
}
|
||||
}
|
||||
|
||||
excelData.setSheetDataList(sheetDataList);
|
||||
return excelData;
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件路径来读取
|
||||
* 读取Excel文件的完整数据并封装为实体
|
||||
*/
|
||||
public static ExcelData readExcelData(String filePath) throws IOException {
|
||||
ExcelData excelData = new ExcelData();
|
||||
List<SheetData> sheetDataList = new ArrayList<>();
|
||||
|
||||
FileInputStream file = new FileInputStream(new File(filePath));
|
||||
boolean isXlsx = filePath.toLowerCase().endsWith(".xlsx");
|
||||
|
||||
// 根据文件后缀选择对应的Workbook实现
|
||||
try (org.apache.poi.ss.usermodel.Workbook workbook = isXlsx ?
|
||||
new XSSFWorkbook(file) : new HSSFWorkbook(file)) {
|
||||
|
||||
for (int sheetIndex = 0; sheetIndex < workbook.getNumberOfSheets(); sheetIndex++) {
|
||||
org.apache.poi.ss.usermodel.Sheet sheet = workbook.getSheetAt(sheetIndex);
|
||||
SheetData sheetData = new SheetData();
|
||||
sheetData.setSheetName(sheet.getSheetName());
|
||||
|
||||
// 处理单个sheet的数据
|
||||
processSheetData(sheet, sheetData);
|
||||
|
||||
sheetDataList.add(sheetData);
|
||||
}
|
||||
} finally {
|
||||
file.close();
|
||||
}
|
||||
|
||||
excelData.setSheetDataList(sheetDataList);
|
||||
return excelData;
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理单个工作表的数据
|
||||
*/
|
||||
private static void processSheetData(org.apache.poi.ss.usermodel.Sheet sheet, SheetData sheetData) {
|
||||
boolean foundChineseStart = false;
|
||||
List<List<String>> data = new ArrayList<>();
|
||||
boolean isFirstRow = true;
|
||||
|
||||
for (Row row : sheet) {
|
||||
// 跳过表头行
|
||||
if (isFirstRow) {
|
||||
isFirstRow = false;
|
||||
continue;
|
||||
}
|
||||
|
||||
List<String> rowData = new ArrayList<>();
|
||||
// 读取A到E列(索引0到4)
|
||||
for (int cellIndex = 0; cellIndex < 5; cellIndex++) {
|
||||
Cell cell = row.getCell(cellIndex, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK);
|
||||
rowData.add(getCellValue(cell));
|
||||
}
|
||||
|
||||
// 检查是否找到中文数字开头的行
|
||||
String aColumnValue = rowData.get(0).trim();
|
||||
if (aColumnValue.matches(CHINESE_NUMBERS_REGEX)) {
|
||||
foundChineseStart = true;
|
||||
}
|
||||
|
||||
// 只有找到中文数字开头的行之后,才开始收集数据
|
||||
if (foundChineseStart) {
|
||||
data.add(rowData);
|
||||
}
|
||||
}
|
||||
|
||||
sheetData.setData(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据数据构建树形结构
|
||||
*/
|
||||
public static TreeNode buildTree(List<List<String>> data) {
|
||||
TreeNode root = new TreeNode(new ArrayList<>());
|
||||
Map<String, TreeNode> nodeMap = new HashMap<>();
|
||||
nodeMap.put("", root);
|
||||
List<String> nonEmptyKeys = new ArrayList<>(); // 记录非空A列值的顺序
|
||||
Map<String, String> lastChineseNumberMap = new HashMap<>(); // 记录各级别最近的中文数字节点
|
||||
|
||||
// 初始化根级中文数字节点
|
||||
lastChineseNumberMap.put("", "");
|
||||
|
||||
for (List<String> row : data) {
|
||||
String key = row.get(0).trim();
|
||||
TreeNode node = new TreeNode(row);
|
||||
|
||||
if (!key.isEmpty()) {
|
||||
String parentKey = getParentKey(key, lastChineseNumberMap, nonEmptyKeys);
|
||||
|
||||
// 更新最近的中文数字节点记录
|
||||
if (key.matches(CHINESE_NUMBERS_REGEX)) {
|
||||
String currentLevelParentKey = getParentKey(key, lastChineseNumberMap, nonEmptyKeys);
|
||||
lastChineseNumberMap.put(key, key);
|
||||
lastChineseNumberMap.put(parentKey + ".children", key);
|
||||
}
|
||||
|
||||
TreeNode parent = nodeMap.get(parentKey);
|
||||
|
||||
if (parent == null) {
|
||||
parent = new TreeNode(new ArrayList<>());
|
||||
nodeMap.put(parentKey, parent);
|
||||
TreeNode grandParent = nodeMap.get(getParentKey(parentKey, lastChineseNumberMap, nonEmptyKeys));
|
||||
if (grandParent != null) {
|
||||
parent.setParent(grandParent);
|
||||
grandParent.addChild(parent);
|
||||
} else {
|
||||
// 如果没有更高级别的父节点,就挂到根节点
|
||||
parent.setParent(root);
|
||||
root.addChild(parent);
|
||||
}
|
||||
}
|
||||
|
||||
node.setParent(parent);
|
||||
parent.addChild(node);
|
||||
nodeMap.put(key, node);
|
||||
nonEmptyKeys.add(key);
|
||||
} else {
|
||||
// A列为空,挂到上一个非空节点下
|
||||
if (!nonEmptyKeys.isEmpty()) {
|
||||
String lastKey = nonEmptyKeys.get(nonEmptyKeys.size() - 1);
|
||||
TreeNode parent = nodeMap.get(lastKey);
|
||||
if (parent != null) {
|
||||
node.setParent(parent);
|
||||
parent.addChild(node);
|
||||
}
|
||||
} else {
|
||||
node.setParent(root);
|
||||
root.addChild(node);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return root;
|
||||
}
|
||||
// public static TreeNode buildTree(List<List<String>> data) {
|
||||
// TreeNode root = new TreeNode(new ArrayList<>());
|
||||
// Map<String, TreeNode> nodeMap = new HashMap<>();
|
||||
// nodeMap.put("", root);
|
||||
// List<String> nonEmptyKeys = new ArrayList<>(); // 记录非空A列值的顺序
|
||||
//
|
||||
// for (List<String> row : data) {
|
||||
// String key = row.get(0).trim();
|
||||
// TreeNode node = new TreeNode(row);
|
||||
//
|
||||
// if (!key.isEmpty()) {
|
||||
// String parentKey = getParentKey(key);
|
||||
// TreeNode parent = nodeMap.get(parentKey);
|
||||
//
|
||||
// if (parent == null) {
|
||||
// parent = new TreeNode(new ArrayList<>());
|
||||
// nodeMap.put(parentKey, parent);
|
||||
// TreeNode grandParent = nodeMap.get(getParentKey(parentKey));
|
||||
// if (grandParent != null) {
|
||||
// grandParent.addChild(parent);
|
||||
// } else {
|
||||
// // 如果没有更高级别的父节点,就挂到根节点
|
||||
// root.addChild(parent);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// parent.addChild(node);
|
||||
// nodeMap.put(key, node);
|
||||
// nonEmptyKeys.add(key);
|
||||
// } else {
|
||||
// // A列为空,挂到上一个非空节点下
|
||||
// if (!nonEmptyKeys.isEmpty()) {
|
||||
// String lastKey = nonEmptyKeys.get(nonEmptyKeys.size() - 1);
|
||||
// TreeNode parent = nodeMap.get(lastKey);
|
||||
// if (parent != null) {
|
||||
// parent.addChild(node);
|
||||
// }
|
||||
// } else {
|
||||
// root.addChild(node);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return root;
|
||||
// }
|
||||
|
||||
/**
|
||||
* 以可视化方式打印树形结构
|
||||
*/
|
||||
public static void printTree(TreeNode node, int depth) {
|
||||
// 跳过空的中间节点
|
||||
if (node.data.isEmpty() && node.children.size() == 1) {
|
||||
printTree(node.children.get(0), depth);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!node.data.isEmpty()) {
|
||||
// 打印层级连接线
|
||||
for (int i = 0; i < depth; i++) {
|
||||
// 最后一级节点用└──,其他用├──
|
||||
if (i == depth - 1) {
|
||||
System.out.print("└── ");
|
||||
} else {
|
||||
System.out.print("│ ");
|
||||
}
|
||||
}
|
||||
// 打印数据,突出显示A列的值
|
||||
System.out.println("[" + node.data.get(0) + "] " + node.data.subList(1, node.data.size()));
|
||||
}
|
||||
|
||||
// 递归打印子节点
|
||||
for (TreeNode child : node.children) {
|
||||
printTree(child, depth + 1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取单元格的值,处理不同数据类型
|
||||
*/
|
||||
private static String getCellValue(Cell cell) {
|
||||
if (cell == null) {
|
||||
return "";
|
||||
}
|
||||
|
||||
switch (cell.getCellType()) {
|
||||
case STRING:
|
||||
return cell.getStringCellValue().trim();
|
||||
case NUMERIC:
|
||||
// 处理数字,移除不必要的.0后缀
|
||||
String numericValue = String.valueOf(cell.getNumericCellValue());
|
||||
if (numericValue.endsWith(".0")) {
|
||||
return numericValue.substring(0, numericValue.length() - 2);
|
||||
}
|
||||
return numericValue;
|
||||
case BOOLEAN:
|
||||
return String.valueOf(cell.getBooleanCellValue());
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据A列的值确定父节点的键
|
||||
*/
|
||||
private static String getParentKey(String key, Map<String, String> lastChineseNumberMap, List<String> nonEmptyKeys) {
|
||||
// 中文数字(一、二、三...)的父节点是根节点
|
||||
if (key.matches(CHINESE_NUMBERS_REGEX)) {
|
||||
return "";
|
||||
}
|
||||
|
||||
// 数字格式(1、1.1、1.2.1等)的父节点是上一级
|
||||
if (key.matches("\\d+(\\.\\d+)*")) {
|
||||
int lastDotIndex = key.lastIndexOf('.');
|
||||
if (lastDotIndex > 0) {
|
||||
return key.substring(0, lastDotIndex);
|
||||
} else {
|
||||
// 一级数字(如1、2)的父节点是最近的中文数字节点
|
||||
if (!nonEmptyKeys.isEmpty()) {
|
||||
// 查找最近的中文数字节点作为父节点
|
||||
for (int i = nonEmptyKeys.size() - 1; i >= 0; i--) {
|
||||
String prevKey = nonEmptyKeys.get(i);
|
||||
if (prevKey.matches(CHINESE_NUMBERS_REGEX)) {
|
||||
return prevKey;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 如果没有找到中文数字节点,使用根节点
|
||||
return lastChineseNumberMap.getOrDefault("", "");
|
||||
}
|
||||
}
|
||||
|
||||
// 其他格式默认父节点是根节点
|
||||
return "";
|
||||
}
|
||||
// private static String getParentKey(String key) {
|
||||
// // 中文数字(一、二、三...)的父节点是根节点
|
||||
// if (key.matches(CHINESE_NUMBERS_REGEX)) {
|
||||
// return "";
|
||||
// }
|
||||
//
|
||||
// // 数字格式(1、1.1、1.2.1等)的父节点是上一级
|
||||
// if (key.matches("\\d+(\\.\\d+)*")) {
|
||||
// int lastDotIndex = key.lastIndexOf('.');
|
||||
// if (lastDotIndex > 0) {
|
||||
// return key.substring(0, lastDotIndex);
|
||||
// } else {
|
||||
// // 一级数字(如1、2)的父节点是根节点或最近的中文数字节点
|
||||
// return "";
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // 其他格式默认父节点是根节点
|
||||
// return "";
|
||||
// }
|
||||
|
||||
/**
|
||||
* Excel数据实体类,包含所有工作表数据
|
||||
*/
|
||||
public static class ExcelData {
|
||||
private List<SheetData> sheetDataList;
|
||||
|
||||
public List<SheetData> getSheetDataList() {
|
||||
return sheetDataList;
|
||||
}
|
||||
|
||||
public void setSheetDataList(List<SheetData> sheetDataList) {
|
||||
this.sheetDataList = sheetDataList;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 工作表数据实体类,包含单个工作表的名称和数据
|
||||
*/
|
||||
public static class SheetData {
|
||||
private String sheetName;
|
||||
private List<List<String>> data;
|
||||
|
||||
public String getSheetName() {
|
||||
return sheetName;
|
||||
}
|
||||
|
||||
public void setSheetName(String sheetName) {
|
||||
this.sheetName = sheetName;
|
||||
}
|
||||
|
||||
public List<List<String>> getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(List<List<String>> data) {
|
||||
this.data = data;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 树形节点类
|
||||
*/
|
||||
/**
|
||||
* 树形节点类,增加了父节点引用
|
||||
*/
|
||||
public static class TreeNode {
|
||||
List<String> data;
|
||||
List<TreeNode> children;
|
||||
TreeNode parent; // 新增:父节点引用
|
||||
|
||||
public TreeNode(List<String> data) {
|
||||
this.data = data;
|
||||
this.children = new ArrayList<>();
|
||||
this.parent = null;
|
||||
}
|
||||
|
||||
public void addChild(TreeNode child) {
|
||||
this.children.add(child);
|
||||
}
|
||||
|
||||
public List<String> getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public List<TreeNode> getChildren() {
|
||||
return children;
|
||||
}
|
||||
|
||||
public TreeNode getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
public void setParent(TreeNode parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
}
|
||||
// public static class TreeNode {
|
||||
// List<String> data;
|
||||
// List<TreeNode> children;
|
||||
//
|
||||
// public TreeNode(List<String> data) {
|
||||
// this.data = data;
|
||||
// this.children = new ArrayList<>();
|
||||
// }
|
||||
//
|
||||
// public void addChild(TreeNode child) {
|
||||
// this.children.add(child);
|
||||
// }
|
||||
//
|
||||
// public List<String> getData() {
|
||||
// return data;
|
||||
// }
|
||||
//
|
||||
// public List<TreeNode> getChildren() {
|
||||
// return children;
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package org.dromara.common.excel.coryUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author 铁憨憨
|
||||
* @Date 2025/8/11 16:44
|
||||
* @Version 1.0
|
||||
*/
|
||||
public class TreeNode {
|
||||
List<String> data;
|
||||
List<TreeNode> children;
|
||||
|
||||
TreeNode(List<String> data) {
|
||||
this.data = data;
|
||||
this.children = new ArrayList<>();
|
||||
}
|
||||
|
||||
void addChild(TreeNode child) {
|
||||
this.children.add(child);
|
||||
}
|
||||
}
|
@ -77,6 +77,7 @@ public class RedisUtils {
|
||||
public static <T> void publish(String channelKey, T msg, Consumer<T> consumer) {
|
||||
RTopic topic = CLIENT.getTopic(channelKey);
|
||||
topic.publish(msg);
|
||||
System.out.println("发布通道消息---------"+msg.toString());
|
||||
consumer.accept(msg);
|
||||
}
|
||||
|
||||
|
@ -134,6 +134,8 @@ public class SseEmitterManager {
|
||||
SseMessageDto broadcastMessage = new SseMessageDto();
|
||||
broadcastMessage.setMessage(sseMessageDto.getMessage());
|
||||
broadcastMessage.setUserIds(sseMessageDto.getUserIds());
|
||||
broadcastMessage.setRoute(sseMessageDto.getRoute());
|
||||
broadcastMessage.setDetailId(sseMessageDto.getDetailId());
|
||||
RedisUtils.publish(SSE_TOPIC, broadcastMessage, consumer -> {
|
||||
log.info("SSE发送主题订阅消息topic:{} session keys:{} message:{}",
|
||||
SSE_TOPIC, sseMessageDto.getUserIds(), sseMessageDto.getMessage());
|
||||
|
@ -26,4 +26,15 @@ public class SseMessageDto implements Serializable {
|
||||
* 需要发送的消息
|
||||
*/
|
||||
private String message;
|
||||
|
||||
/**
|
||||
* 路由
|
||||
*/
|
||||
private String route;
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
private String detailId;
|
||||
|
||||
}
|
||||
|
@ -7,6 +7,9 @@ import org.dromara.common.core.utils.SpringUtils;
|
||||
import org.dromara.common.sse.core.SseEmitterManager;
|
||||
import org.dromara.common.sse.dto.SseMessageDto;
|
||||
|
||||
import java.lang.reflect.Array;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* SSE工具类
|
||||
*
|
||||
|
@ -5,13 +5,13 @@ import lombok.RequiredArgsConstructor;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.dromara.cailiaoshebei.domain.BusCailiaoshebeiPici;
|
||||
import org.dromara.cailiaoshebei.domain.BusSuppliesprice;
|
||||
import org.dromara.cailiaoshebei.domain.bo.*;
|
||||
import org.dromara.cailiaoshebei.domain.vo.*;
|
||||
import org.dromara.cailiaoshebei.service.IBusCailiaoshebeiPiciService;
|
||||
import org.dromara.cailiaoshebei.service.IBusSuppliespriceService;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.utils.BatchNumberGenerator;
|
||||
import org.dromara.design.domain.bo.ObtainTheListReq;
|
||||
import org.dromara.design.domain.vo.ObtainTheListRes;
|
||||
import org.dromara.design.service.IBusBillofquantitiesVersionsService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
@ -49,7 +49,7 @@ public class BusCailiaoshebeiController extends BaseController {
|
||||
* 设计-新增批次号
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:cailiaoshebei:pcAdd")
|
||||
@Log(title = "设计-批次号列表", businessType = BusinessType.INSERT)
|
||||
@Log(title = "设计-新增批次号", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping("/pcAdd")
|
||||
public R<Void> pcAdd(@Validated(AddGroup.class) @RequestBody BusCailiaoshebeiPiciAddReq bo) {
|
||||
@ -235,5 +235,17 @@ public class BusCailiaoshebeiController extends BaseController {
|
||||
return toAjax(busCailiaoshebeiService.updateByPlanBo(bo));
|
||||
}
|
||||
|
||||
//===============================物资-工程量清单===============================
|
||||
|
||||
private final IBusBillofquantitiesVersionsService busBillofquantitiesVersionsService;
|
||||
|
||||
/**
|
||||
* 获取工程量清单
|
||||
*/
|
||||
@SaCheckPermission("design:cailiaoshebei:obtainTheList")
|
||||
@GetMapping("/obtainTheList")
|
||||
public R<List<ObtainTheListRes>> obtainTheList(ObtainTheListReq bo, PageQuery pageQuery) {
|
||||
return R.ok(busBillofquantitiesVersionsService.obtainTheList(bo));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,131 @@
|
||||
package org.dromara.cailiaoshebei.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.dromara.cailiaoshebei.domain.dto.BusLtnDto;
|
||||
import org.dromara.common.utils.logistics.LogisticsInquiryDemo;
|
||||
import org.dromara.common.utils.logistics.LogisticsInquiryUtil;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusLtnVo;
|
||||
import org.dromara.cailiaoshebei.domain.bo.BusLtnBo;
|
||||
import org.dromara.cailiaoshebei.service.IBusLtnService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 物资-物流单号
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-14
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/cailiaoshebei/ltn")
|
||||
public class BusLtnController extends BaseController {
|
||||
|
||||
private final IBusLtnService busLtnService;
|
||||
|
||||
/**
|
||||
* 查询物资-物流单号列表
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:ltn:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<BusLtnVo> list(BusLtnBo bo, PageQuery pageQuery) {
|
||||
return busLtnService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出物资-物流单号列表
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:ltn:export")
|
||||
@Log(title = "物资-物流单号", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(BusLtnBo bo, HttpServletResponse response) {
|
||||
List<BusLtnVo> list = busLtnService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "物资-物流单号", BusLtnVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取物资-物流单号详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:ltn:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<BusLtnVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(busLtnService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增物资-物流单号
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:ltn:add")
|
||||
@Log(title = "物资-物流单号", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody BusLtnBo bo) {
|
||||
return toAjax(busLtnService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物资-物流单号
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:ltn:edit")
|
||||
@Log(title = "物资-物流单号", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody BusLtnBo bo) {
|
||||
return toAjax(busLtnService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除物资-物流单号
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:ltn:remove")
|
||||
@Log(title = "物资-物流单号", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(busLtnService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增物资-物流单号
|
||||
*/
|
||||
@Log(title = "物资-物流单号", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping("/link")
|
||||
public R<Void> linkAdd(@RequestBody BusLtnDto dto) {
|
||||
return toAjax(busLtnService.linkAdd(dto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取物流信息
|
||||
*
|
||||
* @param ltn 物流单号
|
||||
*/
|
||||
@GetMapping("/logistics/{ltn}")
|
||||
public R<LogisticsInquiryDemo> getInfo(@NotNull(message = "物流单号不能为空")
|
||||
@PathVariable String ltn) {
|
||||
return R.ok(LogisticsInquiryUtil.aLiLogisticsInquiry(ltn));
|
||||
}
|
||||
|
||||
}
|
@ -183,6 +183,4 @@ public class BusMaterialbatchdemandplanController extends BaseController {
|
||||
// return toAjax(busMaterialbatchdemandplanService.deleteWithValidByIds(List.of(ids), true));
|
||||
// }
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,132 @@
|
||||
package org.dromara.cailiaoshebei.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.dromara.cailiaoshebei.domain.dto.BusMrpDto;
|
||||
import org.dromara.cailiaoshebei.domain.dto.BusMrpExportDto;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusMrpVo;
|
||||
import org.dromara.design.domain.dto.desCollect.DesCollectBatchDto;
|
||||
import org.dromara.design.domain.vo.DesCollectVo;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusMrpBaseVo;
|
||||
import org.dromara.cailiaoshebei.domain.bo.BusMrpBaseBo;
|
||||
import org.dromara.cailiaoshebei.service.IBusMrpBaseService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 物资-批次需求计划基础信息
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/cailiaoshebei/mrpBase")
|
||||
public class BusMrpBaseController extends BaseController {
|
||||
|
||||
private final IBusMrpBaseService busMrpBaseService;
|
||||
|
||||
/**
|
||||
* 查询物资-批次需求计划基础信息列表
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:mrpBase:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<BusMrpBaseVo> list(BusMrpBaseBo bo, PageQuery pageQuery) {
|
||||
return busMrpBaseService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出物资-批次需求计划基础信息列表
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:mrpBase:export")
|
||||
@Log(title = "物资-批次需求计划基础信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(BusMrpBaseBo bo, HttpServletResponse response) {
|
||||
List<BusMrpBaseVo> list = busMrpBaseService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "物资-批次需求计划基础信息", BusMrpBaseVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取物资-批次需求计划基础信息详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:mrpBase:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<BusMrpVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(busMrpBaseService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增物资-批次需求计划基础信息
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:mrpBase:add")
|
||||
@Log(title = "物资-批次需求计划基础信息", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody BusMrpBaseBo bo) {
|
||||
return toAjax(busMrpBaseService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物资-批次需求计划基础信息
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:mrpBase:edit")
|
||||
@Log(title = "物资-批次需求计划基础信息", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody BusMrpBaseBo bo) {
|
||||
return toAjax(busMrpBaseService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除物资-批次需求计划基础信息
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:mrpBase:remove")
|
||||
@Log(title = "物资-批次需求计划基础信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(busMrpBaseService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量新增或修改
|
||||
*/
|
||||
@RepeatSubmit()
|
||||
@PostMapping("/batch")
|
||||
public R<Void> batchAddOrUpdate(@RequestBody BusMrpDto dto) {
|
||||
return toAjax(busMrpBaseService.batchAddOrUpdate(dto));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导入物资需求批次计划
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:mrpBase:add")
|
||||
@Log(title = "物资-批次需求计划基础信息", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping("/import")
|
||||
public R<Void> importData(BusMrpExportDto dto) {
|
||||
return toAjax(busMrpBaseService.importData(dto));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,105 @@
|
||||
package org.dromara.cailiaoshebei.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusPhysicalsupplyVo;
|
||||
import org.dromara.cailiaoshebei.domain.bo.BusPhysicalsupplyBo;
|
||||
import org.dromara.cailiaoshebei.service.IBusPhysicalsupplyService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 物资-使用情况
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-14
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/cailiaoshebei/physicalsupply")
|
||||
public class BusPhysicalsupplyController extends BaseController {
|
||||
|
||||
private final IBusPhysicalsupplyService busPhysicalsupplyService;
|
||||
|
||||
/**
|
||||
* 查询物资-使用情况列表
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:physicalsupply:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<BusPhysicalsupplyVo> list(BusPhysicalsupplyBo bo, PageQuery pageQuery) {
|
||||
return busPhysicalsupplyService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出物资-使用情况列表
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:physicalsupply:export")
|
||||
@Log(title = "物资-使用情况", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(BusPhysicalsupplyBo bo, HttpServletResponse response) {
|
||||
List<BusPhysicalsupplyVo> list = busPhysicalsupplyService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "物资-使用情况", BusPhysicalsupplyVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取物资-使用情况详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:physicalsupply:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<BusPhysicalsupplyVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(busPhysicalsupplyService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增物资-使用情况
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:physicalsupply:add")
|
||||
@Log(title = "物资-使用情况", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody BusPhysicalsupplyBo bo) {
|
||||
return toAjax(busPhysicalsupplyService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物资-使用情况
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:physicalsupply:edit")
|
||||
@Log(title = "物资-使用情况", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody BusPhysicalsupplyBo bo) {
|
||||
return toAjax(busPhysicalsupplyService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除物资-使用情况
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:physicalsupply:remove")
|
||||
@Log(title = "物资-使用情况", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(busPhysicalsupplyService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
@ -0,0 +1,105 @@
|
||||
package org.dromara.cailiaoshebei.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusPhysicalsupplySonVo;
|
||||
import org.dromara.cailiaoshebei.domain.bo.BusPhysicalsupplySonBo;
|
||||
import org.dromara.cailiaoshebei.service.IBusPhysicalsupplySonService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 物资-使用情况子数据
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-14
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/cailiaoshebei/physicalsupplySon")
|
||||
public class BusPhysicalsupplySonController extends BaseController {
|
||||
|
||||
private final IBusPhysicalsupplySonService busPhysicalsupplySonService;
|
||||
|
||||
/**
|
||||
* 查询物资-使用情况子数据列表
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:physicalsupplySon:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<BusPhysicalsupplySonVo> list(BusPhysicalsupplySonBo bo, PageQuery pageQuery) {
|
||||
return busPhysicalsupplySonService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出物资-使用情况子数据列表
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:physicalsupplySon:export")
|
||||
@Log(title = "物资-使用情况子数据", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(BusPhysicalsupplySonBo bo, HttpServletResponse response) {
|
||||
List<BusPhysicalsupplySonVo> list = busPhysicalsupplySonService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "物资-使用情况子数据", BusPhysicalsupplySonVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取物资-使用情况子数据详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:physicalsupplySon:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<BusPhysicalsupplySonVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(busPhysicalsupplySonService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增物资-使用情况子数据
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:physicalsupplySon:add")
|
||||
@Log(title = "物资-使用情况子数据", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody BusPhysicalsupplySonBo bo) {
|
||||
return toAjax(busPhysicalsupplySonService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物资-使用情况子数据
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:physicalsupplySon:edit")
|
||||
@Log(title = "物资-使用情况子数据", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody BusPhysicalsupplySonBo bo) {
|
||||
return toAjax(busPhysicalsupplySonService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除物资-使用情况子数据
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:physicalsupplySon:remove")
|
||||
@Log(title = "物资-使用情况子数据", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(busPhysicalsupplySonService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
@ -0,0 +1,105 @@
|
||||
package org.dromara.cailiaoshebei.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusPlanDocAssociationVo;
|
||||
import org.dromara.cailiaoshebei.domain.bo.BusPlanDocAssociationBo;
|
||||
import org.dromara.cailiaoshebei.service.IBusPlanDocAssociationService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 物资-批次需求计划与采购单关联
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/cailiaoshebei/planDocAssociation")
|
||||
public class BusPlanDocAssociationController extends BaseController {
|
||||
|
||||
private final IBusPlanDocAssociationService busPlanDocAssociationService;
|
||||
|
||||
/**
|
||||
* 查询物资-批次需求计划与采购单关联列表
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:planDocAssociation:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<BusPlanDocAssociationVo> list(BusPlanDocAssociationBo bo, PageQuery pageQuery) {
|
||||
return busPlanDocAssociationService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出物资-批次需求计划与采购单关联列表
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:planDocAssociation:export")
|
||||
@Log(title = "物资-批次需求计划与采购单关联", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(BusPlanDocAssociationBo bo, HttpServletResponse response) {
|
||||
List<BusPlanDocAssociationVo> list = busPlanDocAssociationService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "物资-批次需求计划与采购单关联", BusPlanDocAssociationVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取物资-批次需求计划与采购单关联详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:planDocAssociation:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<BusPlanDocAssociationVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(busPlanDocAssociationService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增物资-批次需求计划与采购单关联
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:planDocAssociation:add")
|
||||
@Log(title = "物资-批次需求计划与采购单关联", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody BusPlanDocAssociationBo bo) {
|
||||
return toAjax(busPlanDocAssociationService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物资-批次需求计划与采购单关联
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:planDocAssociation:edit")
|
||||
@Log(title = "物资-批次需求计划与采购单关联", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody BusPlanDocAssociationBo bo) {
|
||||
return toAjax(busPlanDocAssociationService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除物资-批次需求计划与采购单关联
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:planDocAssociation:remove")
|
||||
@Log(title = "物资-批次需求计划与采购单关联", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(busPlanDocAssociationService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
@ -0,0 +1,146 @@
|
||||
package org.dromara.cailiaoshebei.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.cailiaoshebei.domain.BusPlanDocAssociation;
|
||||
import org.dromara.cailiaoshebei.domain.bo.BusMaterialbatchdemandplanBo;
|
||||
import org.dromara.cailiaoshebei.domain.bo.BusPurchaseDocBo;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusMaterialbatchdemandplanVo;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusPurchaseDocVo;
|
||||
import org.dromara.cailiaoshebei.service.IBusMaterialbatchdemandplanService;
|
||||
import org.dromara.cailiaoshebei.service.IBusPlanDocAssociationService;
|
||||
import org.dromara.cailiaoshebei.service.IBusPurchaseDocService;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 物资-采购联系单
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/cailiaoshebei/purchaseDoc")
|
||||
public class BusPurchaseDocController extends BaseController {
|
||||
|
||||
private final IBusPurchaseDocService busPurchaseDocService;
|
||||
|
||||
private final IBusMaterialbatchdemandplanService materialbatchdemandplanService;
|
||||
|
||||
private final IBusPlanDocAssociationService planDocAssociationService;
|
||||
|
||||
/**
|
||||
* 查询物资-采购联系单列表
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:purchaseDoc:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<BusPurchaseDocVo> list(BusPurchaseDocBo bo, PageQuery pageQuery) {
|
||||
return busPurchaseDocService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出物资-采购联系单列表
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:purchaseDoc:export")
|
||||
@Log(title = "物资-采购联系单", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(BusPurchaseDocBo bo, HttpServletResponse response) {
|
||||
List<BusPurchaseDocVo> list = busPurchaseDocService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "物资-采购联系单", BusPurchaseDocVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据主键导出物资-采购联系单
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:purchaseDoc:downloadWord")
|
||||
@Log(title = "物资-采购联系单", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export/word")
|
||||
public void exportWordById(@NotNull(message = "主键不能为空") Long id,
|
||||
HttpServletResponse response) {
|
||||
busPurchaseDocService.exportWordById(id, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取物资-采购联系单详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:purchaseDoc:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<BusPurchaseDocVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(busPurchaseDocService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增物资-采购联系单
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:purchaseDoc:add")
|
||||
@Log(title = "物资-采购联系单", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody BusPurchaseDocBo bo) {
|
||||
return toAjax(busPurchaseDocService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物资-采购联系单
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:purchaseDoc:edit")
|
||||
@Log(title = "物资-采购联系单", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody BusPurchaseDocBo bo) {
|
||||
return toAjax(busPurchaseDocService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除物资-采购联系单
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:purchaseDoc:remove")
|
||||
@Log(title = "物资-采购联系单", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(busPurchaseDocService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询采购单关联的计划
|
||||
*/
|
||||
@GetMapping("/planList/{id}")
|
||||
public R<List<BusMaterialbatchdemandplanVo>> list(@NotNull(message = "主键不能为空")
|
||||
@PathVariable("id") Long id) {
|
||||
List<BusPlanDocAssociation> list = planDocAssociationService.list(Wrappers.lambdaQuery(BusPlanDocAssociation.class)
|
||||
.eq(BusPlanDocAssociation::getDocId, id));
|
||||
List<Long> list1 = list.stream().map(BusPlanDocAssociation::getPlanId).toList();
|
||||
if (list1.isEmpty()) {
|
||||
return R.ok(new ArrayList<>());
|
||||
}
|
||||
BusMaterialbatchdemandplanBo bo = new BusMaterialbatchdemandplanBo();
|
||||
bo.setIds(list1);
|
||||
return R.ok(materialbatchdemandplanService.queryList(bo));
|
||||
}
|
||||
}
|
@ -0,0 +1,130 @@
|
||||
package org.dromara.cailiaoshebei.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusPurchaseUserVo;
|
||||
import org.dromara.cailiaoshebei.domain.bo.BusPurchaseUserBo;
|
||||
import org.dromara.cailiaoshebei.service.IBusPurchaseUserService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 物资采购人员
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/cailiaoshebei/purchaseUser")
|
||||
public class BusPurchaseUserController extends BaseController {
|
||||
|
||||
private final IBusPurchaseUserService busPurchaseUserService;
|
||||
|
||||
/**
|
||||
* 查询物资采购人员列表
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:purchaseUser:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<BusPurchaseUserVo> list(BusPurchaseUserBo bo, PageQuery pageQuery) {
|
||||
return busPurchaseUserService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出物资采购人员列表
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:purchaseUser:export")
|
||||
@Log(title = "物资采购人员", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(BusPurchaseUserBo bo, HttpServletResponse response) {
|
||||
List<BusPurchaseUserVo> list = busPurchaseUserService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "物资采购人员", BusPurchaseUserVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取物资采购人员详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:purchaseUser:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<BusPurchaseUserVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(busPurchaseUserService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增物资采购人员
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:purchaseUser:add")
|
||||
@Log(title = "物资采购人员", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody BusPurchaseUserBo bo) {
|
||||
return toAjax(busPurchaseUserService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物资采购人员
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:purchaseUser:edit")
|
||||
@Log(title = "物资采购人员", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody BusPurchaseUserBo bo) {
|
||||
return toAjax(busPurchaseUserService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除物资采购人员
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:purchaseUser:remove")
|
||||
@Log(title = "物资采购人员", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(busPurchaseUserService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增或修改物资采购人员
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:purchaseUser:add")
|
||||
@Log(title = "物资采购人员", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping("/addOrUpdate")
|
||||
public R<Void> addOrUpdate(@Validated(AddGroup.class) @RequestBody BusPurchaseUserBo bo) {
|
||||
return toAjax(busPurchaseUserService.addOrUpdate(bo));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据项目获取物资采购人员详细信息
|
||||
*
|
||||
* @param projectId 项目id
|
||||
*/
|
||||
@SaCheckPermission("cailiaoshebei:purchaseUser:query")
|
||||
@GetMapping("/byProject/{projectId}")
|
||||
public R<BusPurchaseUserVo> getInfoByProject(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long projectId) {
|
||||
return R.ok(busPurchaseUserService.getInfoByProject(projectId));
|
||||
}
|
||||
}
|
@ -0,0 +1,131 @@
|
||||
package org.dromara.cailiaoshebei.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.dromara.cailiaoshebei.domain.bo.BusTotalsupplyplanAuditBo;
|
||||
import org.dromara.cailiaoshebei.domain.bo.MasterDataReq;
|
||||
import org.dromara.cailiaoshebei.domain.bo.TotalsupplyplanQueryListReq;
|
||||
import org.dromara.cailiaoshebei.domain.dto.MasterDataReqDto;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusTotalsupplyplanAuditVo;
|
||||
import org.dromara.cailiaoshebei.service.IBusTotalsupplyplanAuditService;
|
||||
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.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusTotalsupplyplanVo;
|
||||
import org.dromara.cailiaoshebei.domain.bo.BusTotalsupplyplanBo;
|
||||
import org.dromara.cailiaoshebei.service.IBusTotalsupplyplanService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 物资-总供应计划
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/design/totalsupplyplan")
|
||||
public class BusTotalsupplyplanController extends BaseController {
|
||||
|
||||
private final IBusTotalsupplyplanService busTotalsupplyplanService;
|
||||
private final IBusTotalsupplyplanAuditService busTotalsupplyplanAuditService;
|
||||
|
||||
/**
|
||||
* 获取主数据列表
|
||||
*/
|
||||
@SaCheckPermission("design:totalsupplyplan:queryList")
|
||||
@GetMapping("/queryList")
|
||||
public R<List<BusTotalsupplyplanAuditVo>> queryList(TotalsupplyplanQueryListReq bo) {
|
||||
BusTotalsupplyplanAuditBo busTotalsupplyplanAuditBo = BeanUtil.copyProperties(bo, BusTotalsupplyplanAuditBo.class);
|
||||
return R.ok(busTotalsupplyplanAuditService.queryList(busTotalsupplyplanAuditBo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据主数据获取到详情
|
||||
*/
|
||||
@SaCheckPermission("design:totalsupplyplan:masterData")
|
||||
@GetMapping("/masterData")
|
||||
public R<MasterDataReqDto> masterData(MasterDataReq bo) {
|
||||
return R.ok(busTotalsupplyplanService.masterData(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询物资-总供应计划列表
|
||||
*/
|
||||
@SaCheckPermission("design:totalsupplyplan:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<BusTotalsupplyplanVo> list(BusTotalsupplyplanBo bo, PageQuery pageQuery) {
|
||||
return busTotalsupplyplanService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出物资-总供应计划列表
|
||||
*/
|
||||
@SaCheckPermission("design:totalsupplyplan:export")
|
||||
@Log(title = "物资-总供应计划", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(BusTotalsupplyplanBo bo, HttpServletResponse response) {
|
||||
List<BusTotalsupplyplanVo> list = busTotalsupplyplanService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "物资-总供应计划", BusTotalsupplyplanVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取物资-总供应计划详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("design:totalsupplyplan:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<BusTotalsupplyplanVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(busTotalsupplyplanService.queryById(id));
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 新增物资-总供应计划
|
||||
// */
|
||||
// @SaCheckPermission("design:totalsupplyplan:add")
|
||||
// @Log(title = "物资-总供应计划", businessType = BusinessType.INSERT)
|
||||
// @RepeatSubmit()
|
||||
// @PostMapping()
|
||||
// public R<Void> add(@Validated(AddGroup.class) @RequestBody BusTotalsupplyplanBo bo) {
|
||||
// return toAjax(busTotalsupplyplanService.insertByBo(bo));
|
||||
// }
|
||||
|
||||
/**
|
||||
* 修改物资-总供应计划
|
||||
*/
|
||||
@SaCheckPermission("design:totalsupplyplan:edit")
|
||||
@Log(title = "物资-总供应计划", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody BusTotalsupplyplanBo bo) {
|
||||
return toAjax(busTotalsupplyplanService.updateByBo(bo));
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 删除物资-总供应计划
|
||||
// *
|
||||
// * @param ids 主键串
|
||||
// */
|
||||
// @SaCheckPermission("design:totalsupplyplan:remove")
|
||||
// @Log(title = "物资-总供应计划", businessType = BusinessType.DELETE)
|
||||
// @DeleteMapping("/{ids}")
|
||||
// public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
// @PathVariable Long[] ids) {
|
||||
// return toAjax(busTotalsupplyplanService.deleteWithValidByIds(List.of(ids), true));
|
||||
// }
|
||||
}
|
@ -10,4 +10,5 @@ public class constant {
|
||||
public static final String MaterialsPlans = "materialsPlans"; //计划
|
||||
public static final String BatchRequirements = "batchRequirements"; //需求
|
||||
public static final String EquipmentOrdering = "equipmentOrdering"; //订货
|
||||
public static final String PURCHASE_DOC_TEMPLATE_PATH = "template/物资采购联系单模版.docx"; // 采购联系单文件路径
|
||||
}
|
||||
|
@ -0,0 +1,57 @@
|
||||
package org.dromara.cailiaoshebei.domain;
|
||||
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 物资-物流单号对象 bus_ltn
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-14
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("bus_ltn")
|
||||
public class BusLtn extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 采购联系单id
|
||||
*/
|
||||
private Long docId;
|
||||
|
||||
/**
|
||||
* 计划id
|
||||
*/
|
||||
private Long planId;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private BigDecimal num;
|
||||
|
||||
/**
|
||||
* 物流单号
|
||||
*/
|
||||
private String ltn;
|
||||
|
||||
|
||||
}
|
@ -49,6 +49,11 @@ public class BusMaterialbatchdemandplan extends BaseEntity {
|
||||
*/
|
||||
private Long suppliespriceId;
|
||||
|
||||
/**
|
||||
* 基础信息ID
|
||||
*/
|
||||
private Long mrpBaseId;
|
||||
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
@ -94,5 +99,10 @@ public class BusMaterialbatchdemandplan extends BaseEntity {
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 质量标准
|
||||
*/
|
||||
private String qs;
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,57 @@
|
||||
package org.dromara.cailiaoshebei.domain;
|
||||
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* 物资-批次需求计划基础信息对象 bus_mrp_base
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("bus_mrp_base")
|
||||
public class BusMrpBase extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 计划编号
|
||||
*/
|
||||
private String planCode;
|
||||
|
||||
/**
|
||||
* 物资类别
|
||||
*/
|
||||
private String matCat;
|
||||
|
||||
/**
|
||||
* 编制日期
|
||||
*/
|
||||
private LocalDate preparedDate;
|
||||
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,98 @@
|
||||
package org.dromara.cailiaoshebei.domain;
|
||||
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 物资-使用情况对象 bus_physicalsupply
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-14
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("bus_physicalsupply")
|
||||
public class BusPhysicalsupply extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 材料名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
private String specification;
|
||||
|
||||
/**
|
||||
* 供应商
|
||||
*/
|
||||
private String supplier;
|
||||
|
||||
/**
|
||||
* 合同签订时间
|
||||
*/
|
||||
private Date contractSigning;
|
||||
|
||||
/**
|
||||
* 供货要求
|
||||
*/
|
||||
private String supplyRequirements;
|
||||
|
||||
/**
|
||||
* 生产周期
|
||||
*/
|
||||
private Long productionPhase;
|
||||
|
||||
/**
|
||||
* 运算周期
|
||||
*/
|
||||
private Long executionCycle;
|
||||
|
||||
/**
|
||||
* 安装量
|
||||
*/
|
||||
private String installationQuantity;
|
||||
|
||||
/**
|
||||
* 安装比列
|
||||
*/
|
||||
private String installationRatio;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 采购提交
|
||||
*/
|
||||
private String purchaseSubmission;
|
||||
|
||||
/**
|
||||
* 材料提交
|
||||
*/
|
||||
private String submissionMaterials;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,168 @@
|
||||
package org.dromara.cailiaoshebei.domain;
|
||||
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 物资-使用情况子数据对象 bus_physicalsupply_son
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-14
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("bus_physicalsupply_son")
|
||||
public class BusPhysicalsupplySon extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 使用情况ID
|
||||
*/
|
||||
private Long physicalsupplyId;
|
||||
|
||||
/**
|
||||
* 到货要求
|
||||
*/
|
||||
private String deliveryRequirements;
|
||||
|
||||
/**
|
||||
* 转换为合同
|
||||
*/
|
||||
private String transition;
|
||||
|
||||
/**
|
||||
* 批次
|
||||
*/
|
||||
private String batch;
|
||||
|
||||
/**
|
||||
* 联系单下达时间
|
||||
*/
|
||||
private Date issuanceTime;
|
||||
|
||||
/**
|
||||
* 要求到货时间
|
||||
*/
|
||||
private Date requireDelivery;
|
||||
|
||||
/**
|
||||
* 要求到货数量
|
||||
*/
|
||||
private String requiredQuantity;
|
||||
|
||||
/**
|
||||
* 采购备注
|
||||
*/
|
||||
private String cgRemark;
|
||||
|
||||
/**
|
||||
* 计划到货时间
|
||||
*/
|
||||
private Date scheduledDelivery;
|
||||
|
||||
/**
|
||||
* 计划到货数量
|
||||
*/
|
||||
private String plannedQuantity;
|
||||
|
||||
/**
|
||||
* 差异量
|
||||
*/
|
||||
private String differenceQuantity;
|
||||
|
||||
/**
|
||||
* 供应商备注
|
||||
*/
|
||||
private String gysRemark;
|
||||
|
||||
/**
|
||||
* 实际到货时间
|
||||
*/
|
||||
private Date actualDelivery;
|
||||
|
||||
/**
|
||||
* 验收移交时间
|
||||
*/
|
||||
private Date acceptanceCheck;
|
||||
|
||||
/**
|
||||
* 交接方式
|
||||
*/
|
||||
private String associate;
|
||||
|
||||
/**
|
||||
* 实际到货验收数量
|
||||
*/
|
||||
private String actualAcceptance;
|
||||
|
||||
/**
|
||||
* 到货差异量
|
||||
*/
|
||||
private String dhDifferenceQuantity;
|
||||
|
||||
/**
|
||||
* 逾期状态
|
||||
*/
|
||||
private String expectedState;
|
||||
|
||||
/**
|
||||
* 到货备注
|
||||
*/
|
||||
private String dhRemark;
|
||||
|
||||
/**
|
||||
* 货物金额
|
||||
*/
|
||||
private String cargoAmount;
|
||||
|
||||
/**
|
||||
* 结算金额
|
||||
*/
|
||||
private String settlementAmount;
|
||||
|
||||
/**
|
||||
* 预付款
|
||||
*/
|
||||
private String advance;
|
||||
|
||||
/**
|
||||
* 投料款
|
||||
*/
|
||||
private String feed;
|
||||
|
||||
/**
|
||||
* 到货验收款
|
||||
*/
|
||||
private String acceptancePayment;
|
||||
|
||||
/**
|
||||
* 质保金
|
||||
*/
|
||||
private String qualityGuarantee;
|
||||
|
||||
/**
|
||||
* 调试款
|
||||
*/
|
||||
private String debugging;
|
||||
|
||||
/**
|
||||
* 结算备注
|
||||
*/
|
||||
private String jsRemark;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package org.dromara.cailiaoshebei.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_plan_doc_association
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("bus_plan_doc_association")
|
||||
public class BusPlanDocAssociation extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 计划id
|
||||
*/
|
||||
private Long planId;
|
||||
|
||||
/**
|
||||
* 采购联系单id
|
||||
*/
|
||||
private Long docId;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,135 @@
|
||||
package org.dromara.cailiaoshebei.domain;
|
||||
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* 物资-采购联系单对象 bus_purchase_doc
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("bus_purchase_doc")
|
||||
public class BusPurchaseDoc extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 1-采购单,2-补货单
|
||||
*/
|
||||
private String docType;
|
||||
|
||||
/**
|
||||
* 采购单编号
|
||||
*/
|
||||
private String docCode;
|
||||
|
||||
/**
|
||||
* 供应商id
|
||||
*/
|
||||
private Long supplierId;
|
||||
|
||||
/**
|
||||
* 供应商
|
||||
*/
|
||||
private String supplier;
|
||||
|
||||
/**
|
||||
* 事由
|
||||
*/
|
||||
private String reason;
|
||||
|
||||
/**
|
||||
* 设备统称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 到货日期
|
||||
*/
|
||||
private LocalDate arrivalDate;
|
||||
|
||||
/**
|
||||
* 设计负责人联系方式
|
||||
*/
|
||||
private String designDirectorTel;
|
||||
|
||||
/**
|
||||
* 现场技术负责人联系方式
|
||||
*/
|
||||
private String technicalDirectorTel;
|
||||
|
||||
/**
|
||||
* 收货地址
|
||||
*/
|
||||
private String receivingAddress;
|
||||
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
private String contacts;
|
||||
|
||||
/**
|
||||
* 项目负责人
|
||||
*/
|
||||
private String projectDirector;
|
||||
|
||||
/**
|
||||
* 采购经办人
|
||||
*/
|
||||
private String purchasingAgent;
|
||||
|
||||
/**
|
||||
* 日期
|
||||
*/
|
||||
private LocalDate preparedDate;
|
||||
|
||||
/**
|
||||
* 反馈文件地址
|
||||
*/
|
||||
private String feedbackUrl;
|
||||
|
||||
/**
|
||||
* 签收单位
|
||||
*/
|
||||
private String signingUnit;
|
||||
|
||||
/**
|
||||
* 签收人
|
||||
*/
|
||||
private String signingPerson;
|
||||
|
||||
/**
|
||||
* 签收日期
|
||||
*/
|
||||
private LocalDate signingDate;
|
||||
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 计划基础ID
|
||||
*/
|
||||
private Long mrpBaseId;
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package org.dromara.cailiaoshebei.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_purchase_user
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("bus_purchase_user")
|
||||
public class BusPurchaseUser extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 采购人员id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 采购人员姓名
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,119 @@
|
||||
package org.dromara.cailiaoshebei.domain;
|
||||
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 物资-总供应计划对象 bus_totalsupplyplan
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("bus_totalsupplyplan")
|
||||
public class BusTotalsupplyplan extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目Id
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
private String batchNumber;
|
||||
|
||||
/**
|
||||
* 编制日期
|
||||
*/
|
||||
private LocalDate compileDate;
|
||||
|
||||
/**
|
||||
* 计划编号
|
||||
*/
|
||||
private String planNumber;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private String num;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
private String specification;
|
||||
|
||||
/**
|
||||
* 材质
|
||||
*/
|
||||
private String texture;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private Long quantity;
|
||||
|
||||
/**
|
||||
* 品牌
|
||||
*/
|
||||
private String brand;
|
||||
|
||||
/**
|
||||
* 质量标准
|
||||
*/
|
||||
private String qualityStandard;
|
||||
|
||||
/**
|
||||
* 预计使用日期
|
||||
*/
|
||||
private Date dateService;
|
||||
|
||||
/**
|
||||
* 交货地点
|
||||
*/
|
||||
private String deliveryPoints;
|
||||
|
||||
/**
|
||||
* 使用部位
|
||||
*/
|
||||
private String partUsed;
|
||||
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package org.dromara.cailiaoshebei.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_totalsupplyplan_audit
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("bus_totalsupplyplan_audit")
|
||||
public class BusTotalsupplyplanAudit extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目Id
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
private String batchNumber;
|
||||
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
package org.dromara.cailiaoshebei.domain.bo;
|
||||
|
||||
import org.dromara.cailiaoshebei.domain.BusLtn;
|
||||
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.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 物资-物流单号业务对象 bus_ltn
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-14
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = BusLtn.class, reverseConvertGenerate = false)
|
||||
public class BusLtnBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@NotNull(message = "主键ID不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 采购联系单id
|
||||
*/
|
||||
@NotNull(message = "采购联系单id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long docId;
|
||||
|
||||
/**
|
||||
* 计划id
|
||||
*/
|
||||
@NotNull(message = "计划id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long planId;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private BigDecimal num;
|
||||
|
||||
/**
|
||||
* 物流单号
|
||||
*/
|
||||
@NotBlank(message = "物流单号不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String ltn;
|
||||
|
||||
|
||||
}
|
@ -11,6 +11,8 @@ import jakarta.validation.constraints.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
/**
|
||||
@ -33,7 +35,6 @@ public class BusMaterialbatchdemandplanBo extends BaseEntity {
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
@NotBlank(message = "批次号不能为空")
|
||||
private String batchNumber;
|
||||
|
||||
/**
|
||||
@ -41,6 +42,11 @@ public class BusMaterialbatchdemandplanBo extends BaseEntity {
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 基础信息ID
|
||||
*/
|
||||
private Long mrpBaseId;
|
||||
|
||||
/**
|
||||
* 材料设备ID
|
||||
*/
|
||||
@ -97,4 +103,14 @@ public class BusMaterialbatchdemandplanBo extends BaseEntity {
|
||||
private String remark;
|
||||
|
||||
|
||||
/**
|
||||
* 质量标准
|
||||
*/
|
||||
private String qs;
|
||||
|
||||
|
||||
/**
|
||||
* 主键集合
|
||||
*/
|
||||
private List<Long> ids;
|
||||
}
|
||||
|
@ -0,0 +1,59 @@
|
||||
package org.dromara.cailiaoshebei.domain.bo;
|
||||
|
||||
import org.dromara.cailiaoshebei.domain.BusMrpBase;
|
||||
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.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* 物资-批次需求计划基础信息业务对象 bus_mrp_base
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = BusMrpBase.class, reverseConvertGenerate = false)
|
||||
public class BusMrpBaseBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@NotNull(message = "主键ID不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
@NotNull(message = "项目ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 计划编号
|
||||
*/
|
||||
@NotBlank(message = "计划编号不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String planCode;
|
||||
|
||||
/**
|
||||
* 物资类别
|
||||
*/
|
||||
private String matCat;
|
||||
|
||||
/**
|
||||
* 编制日期
|
||||
*/
|
||||
private LocalDate preparedDate;
|
||||
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,102 @@
|
||||
package org.dromara.cailiaoshebei.domain.bo;
|
||||
|
||||
import org.dromara.cailiaoshebei.domain.BusPhysicalsupply;
|
||||
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.*;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
/**
|
||||
* 物资-使用情况业务对象 bus_physicalsupply
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-14
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = BusPhysicalsupply.class, reverseConvertGenerate = false)
|
||||
public class BusPhysicalsupplyBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 采购1 或 材料2 或 查询所有3
|
||||
*/
|
||||
private String findType;
|
||||
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 材料名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
private String specification;
|
||||
|
||||
/**
|
||||
* 供应商
|
||||
*/
|
||||
private String supplier;
|
||||
|
||||
/**
|
||||
* 合同签订时间
|
||||
*/
|
||||
private Date contractSigning;
|
||||
|
||||
/**
|
||||
* 供货要求
|
||||
*/
|
||||
private String supplyRequirements;
|
||||
|
||||
/**
|
||||
* 生产周期
|
||||
*/
|
||||
private Long productionPhase;
|
||||
|
||||
/**
|
||||
* 运算周期
|
||||
*/
|
||||
private Long executionCycle;
|
||||
|
||||
/**
|
||||
* 安装量
|
||||
*/
|
||||
private String installationQuantity;
|
||||
|
||||
/**
|
||||
* 安装比列
|
||||
*/
|
||||
private String installationRatio;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 采购提交
|
||||
*/
|
||||
private String purchaseSubmission;
|
||||
|
||||
/**
|
||||
* 材料提交
|
||||
*/
|
||||
private String submissionMaterials;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,167 @@
|
||||
package org.dromara.cailiaoshebei.domain.bo;
|
||||
|
||||
import org.dromara.cailiaoshebei.domain.BusPhysicalsupplySon;
|
||||
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.*;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
/**
|
||||
* 物资-使用情况子数据业务对象 bus_physicalsupply_son
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-14
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = BusPhysicalsupplySon.class, reverseConvertGenerate = false)
|
||||
public class BusPhysicalsupplySonBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@NotNull(message = "主键ID不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 使用情况ID
|
||||
*/
|
||||
private Long physicalsupplyId;
|
||||
|
||||
/**
|
||||
* 到货要求
|
||||
*/
|
||||
private String deliveryRequirements;
|
||||
|
||||
/**
|
||||
* 转换为合同
|
||||
*/
|
||||
private String transition;
|
||||
|
||||
/**
|
||||
* 批次
|
||||
*/
|
||||
private String batch;
|
||||
|
||||
/**
|
||||
* 联系单下达时间
|
||||
*/
|
||||
private Date issuanceTime;
|
||||
|
||||
/**
|
||||
* 要求到货时间
|
||||
*/
|
||||
private Date requireDelivery;
|
||||
|
||||
/**
|
||||
* 要求到货数量
|
||||
*/
|
||||
private String requiredQuantity;
|
||||
|
||||
/**
|
||||
* 采购备注
|
||||
*/
|
||||
private String cgRemark;
|
||||
|
||||
/**
|
||||
* 计划到货时间
|
||||
*/
|
||||
private Date scheduledDelivery;
|
||||
|
||||
/**
|
||||
* 计划到货数量
|
||||
*/
|
||||
private String plannedQuantity;
|
||||
|
||||
/**
|
||||
* 差异量
|
||||
*/
|
||||
private String differenceQuantity;
|
||||
|
||||
/**
|
||||
* 供应商备注
|
||||
*/
|
||||
private String gysRemark;
|
||||
|
||||
/**
|
||||
* 实际到货时间
|
||||
*/
|
||||
private Date actualDelivery;
|
||||
|
||||
/**
|
||||
* 验收移交时间
|
||||
*/
|
||||
private Date acceptanceCheck;
|
||||
|
||||
/**
|
||||
* 交接方式
|
||||
*/
|
||||
private String associate;
|
||||
|
||||
/**
|
||||
* 实际到货验收数量
|
||||
*/
|
||||
private String actualAcceptance;
|
||||
|
||||
/**
|
||||
* 到货差异量
|
||||
*/
|
||||
private String dhDifferenceQuantity;
|
||||
|
||||
/**
|
||||
* 逾期状态
|
||||
*/
|
||||
private String expectedState;
|
||||
|
||||
/**
|
||||
* 到货备注
|
||||
*/
|
||||
private String dhRemark;
|
||||
|
||||
/**
|
||||
* 货物金额
|
||||
*/
|
||||
private String cargoAmount;
|
||||
|
||||
/**
|
||||
* 结算金额
|
||||
*/
|
||||
private String settlementAmount;
|
||||
|
||||
/**
|
||||
* 预付款
|
||||
*/
|
||||
private String advance;
|
||||
|
||||
/**
|
||||
* 投料款
|
||||
*/
|
||||
private String feed;
|
||||
|
||||
/**
|
||||
* 到货验收款
|
||||
*/
|
||||
private String acceptancePayment;
|
||||
|
||||
/**
|
||||
* 质保金
|
||||
*/
|
||||
private String qualityGuarantee;
|
||||
|
||||
/**
|
||||
* 调试款
|
||||
*/
|
||||
private String debugging;
|
||||
|
||||
/**
|
||||
* 结算备注
|
||||
*/
|
||||
private String jsRemark;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
package org.dromara.cailiaoshebei.domain.bo;
|
||||
|
||||
import org.dromara.cailiaoshebei.domain.BusPlanDocAssociation;
|
||||
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_plan_doc_association
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = BusPlanDocAssociation.class, reverseConvertGenerate = false)
|
||||
public class BusPlanDocAssociationBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@NotNull(message = "主键ID不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 计划id
|
||||
*/
|
||||
private Long planId;
|
||||
|
||||
/**
|
||||
* 采购联系单id
|
||||
*/
|
||||
private Long docId;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,136 @@
|
||||
package org.dromara.cailiaoshebei.domain.bo;
|
||||
|
||||
import org.dromara.cailiaoshebei.domain.BusPurchaseDoc;
|
||||
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.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 物资-采购联系单业务对象 bus_purchase_doc
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = BusPurchaseDoc.class, reverseConvertGenerate = false)
|
||||
public class BusPurchaseDocBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@NotNull(message = "主键ID不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 采购单编号
|
||||
*/
|
||||
private String docCode;
|
||||
|
||||
/**
|
||||
* 供应商id
|
||||
*/
|
||||
private Long supplierId;
|
||||
|
||||
/**
|
||||
* 供应商
|
||||
*/
|
||||
private String supplier;
|
||||
|
||||
/**
|
||||
* 事由
|
||||
*/
|
||||
private String reason;
|
||||
|
||||
/**
|
||||
* 设备统称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 到货日期
|
||||
*/
|
||||
private LocalDate arrivalDate;
|
||||
|
||||
/**
|
||||
* 设计负责人联系方式
|
||||
*/
|
||||
private String designDirectorTel;
|
||||
|
||||
/**
|
||||
* 现场技术负责人联系方式
|
||||
*/
|
||||
private String technicalDirectorTel;
|
||||
|
||||
/**
|
||||
* 收货地址
|
||||
*/
|
||||
private String receivingAddress;
|
||||
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
private String contacts;
|
||||
|
||||
/**
|
||||
* 项目负责人
|
||||
*/
|
||||
private String projectDirector;
|
||||
|
||||
/**
|
||||
* 采购经办人
|
||||
*/
|
||||
private String purchasingAgent;
|
||||
|
||||
/**
|
||||
* 日期
|
||||
*/
|
||||
private LocalDate preparedDate;
|
||||
|
||||
/**
|
||||
* 反馈文件地址
|
||||
*/
|
||||
private String feedbackUrl;
|
||||
|
||||
/**
|
||||
* 签收单位
|
||||
*/
|
||||
private String signingUnit;
|
||||
|
||||
/**
|
||||
* 签收人
|
||||
*/
|
||||
private String signingPerson;
|
||||
|
||||
/**
|
||||
* 签收日期
|
||||
*/
|
||||
private LocalDate signingDate;
|
||||
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 计划基础ID
|
||||
*/
|
||||
private Long mrpBaseId;
|
||||
|
||||
/**
|
||||
* 关联计划
|
||||
*/
|
||||
private List<BusPlanDocAssociationBo> associationList;
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
package org.dromara.cailiaoshebei.domain.bo;
|
||||
|
||||
import org.dromara.cailiaoshebei.domain.BusPurchaseUser;
|
||||
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_purchase_user
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = BusPurchaseUser.class, reverseConvertGenerate = false)
|
||||
public class BusPurchaseUserBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@NotNull(message = "不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
@NotNull(message = "项目id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 采购人员id
|
||||
*/
|
||||
@NotNull(message = "采购人员id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 采购人员姓名
|
||||
*/
|
||||
@NotBlank(message = "采购人员姓名不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String userName;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
package org.dromara.cailiaoshebei.domain.bo;
|
||||
|
||||
import org.dromara.cailiaoshebei.domain.BusTotalsupplyplanAudit;
|
||||
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_totalsupplyplan_audit
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = BusTotalsupplyplanAudit.class, reverseConvertGenerate = false)
|
||||
public class BusTotalsupplyplanAuditBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@NotNull(message = "主键ID不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目Id
|
||||
*/
|
||||
@NotNull(message = "项目Id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
@NotBlank(message = "批次号不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String batchNumber;
|
||||
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,72 @@
|
||||
package org.dromara.cailiaoshebei.domain.bo;
|
||||
|
||||
import org.dromara.cailiaoshebei.domain.BusTotalsupplyplan;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 物资-总供应计划业务对象 bus_totalsupplyplan
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = BusTotalsupplyplan.class, reverseConvertGenerate = false)
|
||||
public class BusTotalsupplyplanBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@NotNull(message = "主键ID不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
private String batchNumber;
|
||||
|
||||
/**
|
||||
* 预计使用日期
|
||||
*/
|
||||
private LocalDate dateService;
|
||||
|
||||
/**
|
||||
* 交货地点
|
||||
*/
|
||||
private String deliveryPoints;
|
||||
|
||||
/**
|
||||
* 使用部位
|
||||
*/
|
||||
private String partUsed;
|
||||
|
||||
/**
|
||||
* 品牌
|
||||
*/
|
||||
private String brand;
|
||||
|
||||
/**
|
||||
* 质量标准
|
||||
*/
|
||||
private String qualityStandard;
|
||||
|
||||
/**
|
||||
* 材质
|
||||
*/
|
||||
private String texture;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package org.dromara.cailiaoshebei.domain.bo;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Author 铁憨憨
|
||||
* @Date 2025/8/14 11:21
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class MasterDataReq implements Serializable {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@NotNull(message = "主键ID不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package org.dromara.cailiaoshebei.domain.bo;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Author 铁憨憨
|
||||
* @Date 2025/8/14 11:32
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class TotalsupplyplanQueryListReq implements Serializable {
|
||||
|
||||
/**
|
||||
* 项目Id
|
||||
*/
|
||||
@NotNull(message = "项目Id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long projectId;
|
||||
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
package org.dromara.cailiaoshebei.domain.dto;
|
||||
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.dromara.cailiaoshebei.domain.BusLtn;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 物资-物流单号业务对象 bus_ltn
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-14
|
||||
*/
|
||||
@Data
|
||||
|
||||
public class BusLtnDto {
|
||||
|
||||
|
||||
/**
|
||||
* 采购联系单id
|
||||
*/
|
||||
private Long docId;
|
||||
|
||||
/**
|
||||
* 供应商
|
||||
*/
|
||||
private String supplier;
|
||||
|
||||
/**
|
||||
* 物流信息
|
||||
*/
|
||||
private List<BusLtnListDto> list;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
package org.dromara.cailiaoshebei.domain.dto;
|
||||
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.dromara.cailiaoshebei.domain.BusLtn;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 物资-物流单号业务对象 bus_ltn
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-14
|
||||
*/
|
||||
@Data
|
||||
public class BusLtnListDto{
|
||||
|
||||
/**
|
||||
* 计划id不
|
||||
*/
|
||||
@NotNull(message = "计划id不能为空")
|
||||
private Long planId;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private BigDecimal num;
|
||||
|
||||
/**
|
||||
* 物流单号
|
||||
*/
|
||||
@NotBlank(message = "物流单号不能为空")
|
||||
private String ltn;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
package org.dromara.cailiaoshebei.domain.dto;
|
||||
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.dromara.cailiaoshebei.domain.BusMaterialbatchdemandplan;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 物资-批次需求计划业务对象 bus_materialbatchdemandplan
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-02
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = BusMaterialbatchdemandplan.class, reverseConvertGenerate = false)
|
||||
public class BusMaterialbatchdemandplanExportDto extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 设备材料名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 规格型号
|
||||
*/
|
||||
private String specification;
|
||||
|
||||
/**
|
||||
* 计量单位
|
||||
*/
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 需求数量
|
||||
*/
|
||||
private Long demandQuantity;
|
||||
|
||||
/**
|
||||
* 质量标准
|
||||
*/
|
||||
private String qs;
|
||||
|
||||
/**
|
||||
* 计划到场时间
|
||||
*/
|
||||
private LocalDate arrivalTime;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package org.dromara.cailiaoshebei.domain.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author lilemy
|
||||
* @date 2025-08-18 16:37
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class BusMaterialbatchdemandplanWordDto {
|
||||
|
||||
private Integer num;
|
||||
private String childName;
|
||||
private String specification;
|
||||
private String unit;
|
||||
private Long demandQuantity;
|
||||
private String remark;
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package org.dromara.cailiaoshebei.domain.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import org.dromara.cailiaoshebei.domain.bo.BusMaterialbatchdemandplanBo;
|
||||
import org.dromara.cailiaoshebei.domain.bo.BusMrpBaseBo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class BusMrpDto {
|
||||
|
||||
private BusMrpBaseBo mrpBaseBo;
|
||||
|
||||
private List<BusMaterialbatchdemandplanBo> planList;
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package org.dromara.cailiaoshebei.domain.dto;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import org.dromara.cailiaoshebei.domain.bo.BusMaterialbatchdemandplanBo;
|
||||
import org.dromara.cailiaoshebei.domain.bo.BusMrpBaseBo;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class BusMrpExportDto {
|
||||
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
@NotNull(message = "项目ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 计划编号
|
||||
*/
|
||||
@NotBlank(message = "计划编号不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String planCode;
|
||||
|
||||
/**
|
||||
* 物资类别
|
||||
*/
|
||||
private String matCat;
|
||||
|
||||
/**
|
||||
* 编制日期
|
||||
*/
|
||||
private LocalDate preparedDate;
|
||||
|
||||
|
||||
|
||||
private MultipartFile file;
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package org.dromara.cailiaoshebei.domain.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lilemy
|
||||
* @date 2025-08-18 16:31
|
||||
*/
|
||||
@Data
|
||||
public class BusPurchaseDocWordDto {
|
||||
|
||||
private String projectName;
|
||||
private String docCode;
|
||||
private String supplier;
|
||||
private String reason;
|
||||
private String name;
|
||||
private String arrivalDate;
|
||||
private String designDirectorTel;
|
||||
private String technicalDirectorTel;
|
||||
private String receivingAddress;
|
||||
private String contacts;
|
||||
private String projectDirector;
|
||||
private String purchasingAgent;
|
||||
private String preparedDate;
|
||||
private String signingUnit;
|
||||
private String signingPerson;
|
||||
private String signingDate;
|
||||
|
||||
private List<BusMaterialbatchdemandplanWordDto> items;
|
||||
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
package org.dromara.cailiaoshebei.domain.dto;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.dromara.cailiaoshebei.domain.BusTotalsupplyplan;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author 铁憨憨
|
||||
* @Date 2025/8/14 11:24
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class MasterDataReqDto implements Serializable {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目Id
|
||||
*/
|
||||
@ExcelProperty(value = "项目Id")
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
@ExcelProperty(value = "批次号")
|
||||
private String batchNumber;
|
||||
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
@ExcelProperty(value = "审核状态")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 子数据
|
||||
*/
|
||||
private List<BusTotalsupplyplan> subData;
|
||||
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
package org.dromara.cailiaoshebei.domain.vo;
|
||||
|
||||
import org.dromara.cailiaoshebei.domain.BusLtn;
|
||||
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.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 物资-物流单号视图对象 bus_ltn
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-14
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = BusLtn.class)
|
||||
public class BusLtnVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
@ExcelProperty(value = "项目ID")
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 采购联系单id
|
||||
*/
|
||||
@ExcelProperty(value = "采购联系单id")
|
||||
private Long docId;
|
||||
|
||||
/**
|
||||
* 计划id
|
||||
*/
|
||||
@ExcelProperty(value = "计划id")
|
||||
private Long planId;
|
||||
|
||||
/**
|
||||
* 物资名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
@ExcelProperty(value = "数量")
|
||||
private BigDecimal num;
|
||||
|
||||
/**
|
||||
* 物流单号
|
||||
*/
|
||||
@ExcelProperty(value = "物流单号")
|
||||
private String ltn;
|
||||
|
||||
|
||||
}
|
@ -43,6 +43,11 @@ public class BusMaterialbatchdemandplanVo implements Serializable {
|
||||
@ExcelProperty(value = "批次ID")
|
||||
private String batchId;
|
||||
|
||||
/**
|
||||
* 基础信息ID
|
||||
*/
|
||||
private Long mrpBaseId;
|
||||
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
@ -115,5 +120,9 @@ public class BusMaterialbatchdemandplanVo implements Serializable {
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 质量标准
|
||||
*/
|
||||
private String qs;
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,73 @@
|
||||
package org.dromara.cailiaoshebei.domain.vo;
|
||||
|
||||
import org.dromara.cailiaoshebei.domain.BusMrpBase;
|
||||
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.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 物资-批次需求计划基础信息视图对象 bus_mrp_base
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = BusMrpBase.class)
|
||||
public class BusMrpBaseVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
@ExcelProperty(value = "项目ID")
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 计划编号
|
||||
*/
|
||||
@ExcelProperty(value = "计划编号")
|
||||
private String planCode;
|
||||
|
||||
/**
|
||||
* 物资类别
|
||||
*/
|
||||
@ExcelProperty(value = "物资类别")
|
||||
private String matCat;
|
||||
|
||||
/**
|
||||
* 编制日期
|
||||
*/
|
||||
@ExcelProperty(value = "编制日期")
|
||||
private LocalDate preparedDate;
|
||||
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
@ExcelProperty(value = "审核状态")
|
||||
private String status;
|
||||
|
||||
|
||||
/**
|
||||
* 计划详情
|
||||
*/
|
||||
private List<BusMaterialbatchdemandplanVo> planList;
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package org.dromara.cailiaoshebei.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import org.dromara.cailiaoshebei.domain.bo.BusMaterialbatchdemandplanBo;
|
||||
import org.dromara.cailiaoshebei.domain.bo.BusMrpBaseBo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class BusMrpVo {
|
||||
|
||||
private BusMrpBaseVo mrpBaseBo;
|
||||
|
||||
private List<BusMaterialbatchdemandplanVo> planList;
|
||||
}
|
@ -0,0 +1,202 @@
|
||||
package org.dromara.cailiaoshebei.domain.vo;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.dromara.cailiaoshebei.domain.BusPhysicalsupplySon;
|
||||
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_physicalsupply_son
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-14
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = BusPhysicalsupplySon.class)
|
||||
public class BusPhysicalsupplySonVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 使用情况ID
|
||||
*/
|
||||
@ExcelProperty(value = "使用情况ID")
|
||||
private Long physicalsupplyId;
|
||||
|
||||
/**
|
||||
* 到货要求
|
||||
*/
|
||||
@ExcelProperty(value = "到货要求")
|
||||
private String deliveryRequirements;
|
||||
|
||||
/**
|
||||
* 转换为合同
|
||||
*/
|
||||
@ExcelProperty(value = "转换为合同")
|
||||
private String transition;
|
||||
|
||||
/**
|
||||
* 批次
|
||||
*/
|
||||
@ExcelProperty(value = "批次")
|
||||
private String batch;
|
||||
|
||||
/**
|
||||
* 联系单下达时间
|
||||
*/
|
||||
@ExcelProperty(value = "联系单下达时间")
|
||||
private Date issuanceTime;
|
||||
|
||||
/**
|
||||
* 要求到货时间
|
||||
*/
|
||||
@ExcelProperty(value = "要求到货时间")
|
||||
private Date requireDelivery;
|
||||
|
||||
/**
|
||||
* 要求到货数量
|
||||
*/
|
||||
@ExcelProperty(value = "要求到货数量")
|
||||
private String requiredQuantity;
|
||||
|
||||
/**
|
||||
* 采购备注
|
||||
*/
|
||||
@ExcelProperty(value = "采购备注")
|
||||
private String cgRemark;
|
||||
|
||||
/**
|
||||
* 计划到货时间
|
||||
*/
|
||||
@ExcelProperty(value = "计划到货时间")
|
||||
private Date scheduledDelivery;
|
||||
|
||||
/**
|
||||
* 计划到货数量
|
||||
*/
|
||||
@ExcelProperty(value = "计划到货数量")
|
||||
private String plannedQuantity;
|
||||
|
||||
/**
|
||||
* 差异量
|
||||
*/
|
||||
@ExcelProperty(value = "差异量")
|
||||
private String differenceQuantity;
|
||||
|
||||
/**
|
||||
* 供应商备注
|
||||
*/
|
||||
@ExcelProperty(value = "供应商备注")
|
||||
private String gysRemark;
|
||||
|
||||
/**
|
||||
* 实际到货时间
|
||||
*/
|
||||
@ExcelProperty(value = "实际到货时间")
|
||||
private Date actualDelivery;
|
||||
|
||||
/**
|
||||
* 验收移交时间
|
||||
*/
|
||||
@ExcelProperty(value = "验收移交时间")
|
||||
private Date acceptanceCheck;
|
||||
|
||||
/**
|
||||
* 交接方式
|
||||
*/
|
||||
@ExcelProperty(value = "交接方式")
|
||||
private String associate;
|
||||
|
||||
/**
|
||||
* 实际到货验收数量
|
||||
*/
|
||||
@ExcelProperty(value = "实际到货验收数量")
|
||||
private String actualAcceptance;
|
||||
|
||||
/**
|
||||
* 到货差异量
|
||||
*/
|
||||
@ExcelProperty(value = "到货差异量")
|
||||
private String dhDifferenceQuantity;
|
||||
|
||||
/**
|
||||
* 逾期状态
|
||||
*/
|
||||
@ExcelProperty(value = "逾期状态")
|
||||
private String expectedState;
|
||||
|
||||
/**
|
||||
* 到货备注
|
||||
*/
|
||||
@ExcelProperty(value = "到货备注")
|
||||
private String dhRemark;
|
||||
|
||||
/**
|
||||
* 货物金额
|
||||
*/
|
||||
@ExcelProperty(value = "货物金额")
|
||||
private String cargoAmount;
|
||||
|
||||
/**
|
||||
* 结算金额
|
||||
*/
|
||||
@ExcelProperty(value = "结算金额")
|
||||
private String settlementAmount;
|
||||
|
||||
/**
|
||||
* 预付款
|
||||
*/
|
||||
@ExcelProperty(value = "预付款")
|
||||
private String advance;
|
||||
|
||||
/**
|
||||
* 投料款
|
||||
*/
|
||||
@ExcelProperty(value = "投料款")
|
||||
private String feed;
|
||||
|
||||
/**
|
||||
* 到货验收款
|
||||
*/
|
||||
@ExcelProperty(value = "到货验收款")
|
||||
private String acceptancePayment;
|
||||
|
||||
/**
|
||||
* 质保金
|
||||
*/
|
||||
@ExcelProperty(value = "质保金")
|
||||
private String qualityGuarantee;
|
||||
|
||||
/**
|
||||
* 调试款
|
||||
*/
|
||||
@ExcelProperty(value = "调试款")
|
||||
private String debugging;
|
||||
|
||||
/**
|
||||
* 结算备注
|
||||
*/
|
||||
@ExcelProperty(value = "结算备注")
|
||||
private String jsRemark;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,118 @@
|
||||
package org.dromara.cailiaoshebei.domain.vo;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.dromara.cailiaoshebei.domain.BusPhysicalsupply;
|
||||
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_physicalsupply
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-14
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = BusPhysicalsupply.class)
|
||||
public class BusPhysicalsupplyVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
@ExcelProperty(value = "项目ID")
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 材料名称
|
||||
*/
|
||||
@ExcelProperty(value = "材料名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
@ExcelProperty(value = "规格")
|
||||
private String specification;
|
||||
|
||||
/**
|
||||
* 供应商
|
||||
*/
|
||||
@ExcelProperty(value = "供应商")
|
||||
private String supplier;
|
||||
|
||||
/**
|
||||
* 合同签订时间
|
||||
*/
|
||||
@ExcelProperty(value = "合同签订时间")
|
||||
private Date contractSigning;
|
||||
|
||||
/**
|
||||
* 供货要求
|
||||
*/
|
||||
@ExcelProperty(value = "供货要求")
|
||||
private String supplyRequirements;
|
||||
|
||||
/**
|
||||
* 生产周期
|
||||
*/
|
||||
@ExcelProperty(value = "生产周期")
|
||||
private Long productionPhase;
|
||||
|
||||
/**
|
||||
* 运算周期
|
||||
*/
|
||||
@ExcelProperty(value = "运算周期")
|
||||
private Long executionCycle;
|
||||
|
||||
/**
|
||||
* 安装量
|
||||
*/
|
||||
@ExcelProperty(value = "安装量")
|
||||
private String installationQuantity;
|
||||
|
||||
/**
|
||||
* 安装比列
|
||||
*/
|
||||
@ExcelProperty(value = "安装比列")
|
||||
private String installationRatio;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 采购提交
|
||||
*/
|
||||
@ExcelProperty(value = "采购提交")
|
||||
private String purchaseSubmission;
|
||||
|
||||
/**
|
||||
* 材料提交
|
||||
*/
|
||||
@ExcelProperty(value = "材料提交")
|
||||
private String submissionMaterials;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
package org.dromara.cailiaoshebei.domain.vo;
|
||||
|
||||
import org.dromara.cailiaoshebei.domain.BusPlanDocAssociation;
|
||||
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_plan_doc_association
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = BusPlanDocAssociation.class)
|
||||
public class BusPlanDocAssociationVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
@ExcelProperty(value = "项目ID")
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 计划id
|
||||
*/
|
||||
@ExcelProperty(value = "计划id")
|
||||
private Long planId;
|
||||
|
||||
/**
|
||||
* 采购联系单id
|
||||
*/
|
||||
@ExcelProperty(value = "采购联系单id")
|
||||
private Long docId;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,171 @@
|
||||
package org.dromara.cailiaoshebei.domain.vo;
|
||||
|
||||
import org.dromara.cailiaoshebei.domain.BusPurchaseDoc;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import org.dromara.cailiaoshebei.domain.bo.BusPlanDocAssociationBo;
|
||||
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.time.LocalDate;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 物资-采购联系单视图对象 bus_purchase_doc
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = BusPurchaseDoc.class)
|
||||
public class BusPurchaseDocVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
@ExcelProperty(value = "项目ID")
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 采购单编号
|
||||
*/
|
||||
@ExcelProperty(value = "采购单编号")
|
||||
private String docCode;
|
||||
|
||||
/**
|
||||
* 供应商id
|
||||
*/
|
||||
private Long supplierId;
|
||||
|
||||
/**
|
||||
* 供应商
|
||||
*/
|
||||
@ExcelProperty(value = "供应商")
|
||||
private String supplier;
|
||||
|
||||
/**
|
||||
* 事由
|
||||
*/
|
||||
@ExcelProperty(value = "事由")
|
||||
private String reason;
|
||||
|
||||
/**
|
||||
* 设备统称
|
||||
*/
|
||||
@ExcelProperty(value = "设备统称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 到货日期
|
||||
*/
|
||||
@ExcelProperty(value = "到货日期")
|
||||
private LocalDate arrivalDate;
|
||||
|
||||
/**
|
||||
* 设计负责人联系方式
|
||||
*/
|
||||
@ExcelProperty(value = "设计负责人联系方式")
|
||||
private String designDirectorTel;
|
||||
|
||||
/**
|
||||
* 现场技术负责人联系方式
|
||||
*/
|
||||
@ExcelProperty(value = "现场技术负责人联系方式")
|
||||
private String technicalDirectorTel;
|
||||
|
||||
/**
|
||||
* 收货地址
|
||||
*/
|
||||
@ExcelProperty(value = "收货地址")
|
||||
private String receivingAddress;
|
||||
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
@ExcelProperty(value = "联系人")
|
||||
private String contacts;
|
||||
|
||||
/**
|
||||
* 项目负责人
|
||||
*/
|
||||
@ExcelProperty(value = "项目负责人")
|
||||
private String projectDirector;
|
||||
|
||||
/**
|
||||
* 采购经办人
|
||||
*/
|
||||
@ExcelProperty(value = "采购经办人")
|
||||
private String purchasingAgent;
|
||||
|
||||
/**
|
||||
* 日期
|
||||
*/
|
||||
@ExcelProperty(value = "日期")
|
||||
private LocalDate preparedDate;
|
||||
|
||||
/**
|
||||
* 反馈文件地址
|
||||
*/
|
||||
@ExcelProperty(value = "反馈文件地址")
|
||||
private String feedbackUrl;
|
||||
|
||||
/**
|
||||
* 签收单位
|
||||
*/
|
||||
@ExcelProperty(value = "签收单位")
|
||||
private String signingUnit;
|
||||
|
||||
/**
|
||||
* 签收人
|
||||
*/
|
||||
@ExcelProperty(value = "签收人")
|
||||
private String signingPerson;
|
||||
|
||||
/**
|
||||
* 签收日期
|
||||
*/
|
||||
@ExcelProperty(value = "签收日期")
|
||||
private LocalDate signingDate;
|
||||
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
@ExcelProperty(value = "审核状态")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 计划基础ID
|
||||
*/
|
||||
private Long mrpBaseId;
|
||||
|
||||
/**
|
||||
* 计划编号
|
||||
*/
|
||||
private String planCode;
|
||||
|
||||
/**
|
||||
* 1-采购单,2-补货单
|
||||
*/
|
||||
private String docType;
|
||||
|
||||
/**
|
||||
* 关联计划
|
||||
*/
|
||||
private List<BusPlanDocAssociationVo> associationList;
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
package org.dromara.cailiaoshebei.domain.vo;
|
||||
|
||||
import org.dromara.cailiaoshebei.domain.BusPurchaseUser;
|
||||
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_purchase_user
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = BusPurchaseUser.class)
|
||||
public class BusPurchaseUserVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
@ExcelProperty(value = "项目id")
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 采购人员id
|
||||
*/
|
||||
@ExcelProperty(value = "采购人员id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 采购人员姓名
|
||||
*/
|
||||
@ExcelProperty(value = "采购人员姓名")
|
||||
private String userName;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package org.dromara.cailiaoshebei.domain.vo;
|
||||
|
||||
import org.dromara.cailiaoshebei.domain.BusTotalsupplyplanAudit;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* 物资-总供应计划审核视图对象 bus_totalsupplyplan_audit
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = BusTotalsupplyplanAudit.class)
|
||||
public class BusTotalsupplyplanAuditVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目Id
|
||||
*/
|
||||
@ExcelProperty(value = "项目Id")
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
@ExcelProperty(value = "批次号")
|
||||
private String batchNumber;
|
||||
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
@ExcelProperty(value = "审核状态")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,137 @@
|
||||
package org.dromara.cailiaoshebei.domain.vo;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.dromara.cailiaoshebei.domain.BusTotalsupplyplan;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* 物资-总供应计划视图对象 bus_totalsupplyplan
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = BusTotalsupplyplan.class)
|
||||
public class BusTotalsupplyplanVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
private String batchNumber;
|
||||
|
||||
/**
|
||||
* 项目Id
|
||||
*/
|
||||
@ExcelProperty(value = "项目Id")
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 编制日期
|
||||
*/
|
||||
@ExcelProperty(value = "编制日期")
|
||||
private Date compileDate;
|
||||
|
||||
/**
|
||||
* 计划编号
|
||||
*/
|
||||
@ExcelProperty(value = "计划编号")
|
||||
private String planNumber;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@ExcelProperty(value = "编号")
|
||||
private String num;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@ExcelProperty(value = "名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
@ExcelProperty(value = "规格")
|
||||
private String specification;
|
||||
|
||||
/**
|
||||
* 材质
|
||||
*/
|
||||
@ExcelProperty(value = "材质")
|
||||
private String texture;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
@ExcelProperty(value = "单位")
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
@ExcelProperty(value = "数量")
|
||||
private Long quantity;
|
||||
|
||||
/**
|
||||
* 品牌
|
||||
*/
|
||||
@ExcelProperty(value = "品牌")
|
||||
private String brand;
|
||||
|
||||
/**
|
||||
* 质量标准
|
||||
*/
|
||||
@ExcelProperty(value = "质量标准")
|
||||
private String qualityStandard;
|
||||
|
||||
/**
|
||||
* 预计使用日期
|
||||
*/
|
||||
@ExcelProperty(value = "预计使用日期")
|
||||
private Date dateService;
|
||||
|
||||
/**
|
||||
* 交货地点
|
||||
*/
|
||||
@ExcelProperty(value = "交货地点")
|
||||
private String deliveryPoints;
|
||||
|
||||
/**
|
||||
* 使用部位
|
||||
*/
|
||||
@ExcelProperty(value = "使用部位")
|
||||
private String partUsed;
|
||||
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
@ExcelProperty(value = "审核状态")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package org.dromara.cailiaoshebei.mapper;
|
||||
|
||||
import org.dromara.cailiaoshebei.domain.BusLtn;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusLtnVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 物资-物流单号Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-14
|
||||
*/
|
||||
public interface BusLtnMapper extends BaseMapperPlus<BusLtn, BusLtnVo> {
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package org.dromara.cailiaoshebei.mapper;
|
||||
|
||||
import org.dromara.cailiaoshebei.domain.BusMrpBase;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusMrpBaseVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 物资-批次需求计划基础信息Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
public interface BusMrpBaseMapper extends BaseMapperPlus<BusMrpBase, BusMrpBaseVo> {
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package org.dromara.cailiaoshebei.mapper;
|
||||
|
||||
import org.dromara.cailiaoshebei.domain.BusPhysicalsupply;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusPhysicalsupplyVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 物资-使用情况Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-14
|
||||
*/
|
||||
public interface BusPhysicalsupplyMapper extends BaseMapperPlus<BusPhysicalsupply, BusPhysicalsupplyVo> {
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package org.dromara.cailiaoshebei.mapper;
|
||||
|
||||
import org.dromara.cailiaoshebei.domain.BusPhysicalsupplySon;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusPhysicalsupplySonVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 物资-使用情况子数据Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-14
|
||||
*/
|
||||
public interface BusPhysicalsupplySonMapper extends BaseMapperPlus<BusPhysicalsupplySon, BusPhysicalsupplySonVo> {
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package org.dromara.cailiaoshebei.mapper;
|
||||
|
||||
import org.dromara.cailiaoshebei.domain.BusPlanDocAssociation;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusPlanDocAssociationVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 物资-批次需求计划与采购单关联Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
public interface BusPlanDocAssociationMapper extends BaseMapperPlus<BusPlanDocAssociation, BusPlanDocAssociationVo> {
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package org.dromara.cailiaoshebei.mapper;
|
||||
|
||||
import org.dromara.cailiaoshebei.domain.BusPurchaseDoc;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusPurchaseDocVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 物资-采购联系单Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
public interface BusPurchaseDocMapper extends BaseMapperPlus<BusPurchaseDoc, BusPurchaseDocVo> {
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package org.dromara.cailiaoshebei.mapper;
|
||||
|
||||
import org.dromara.cailiaoshebei.domain.BusPurchaseUser;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusPurchaseUserVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 物资采购人员Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
public interface BusPurchaseUserMapper extends BaseMapperPlus<BusPurchaseUser, BusPurchaseUserVo> {
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package org.dromara.cailiaoshebei.mapper;
|
||||
|
||||
import org.dromara.cailiaoshebei.domain.BusTotalsupplyplanAudit;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusTotalsupplyplanAuditVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 物资-总供应计划审核Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
public interface BusTotalsupplyplanAuditMapper extends BaseMapperPlus<BusTotalsupplyplanAudit, BusTotalsupplyplanAuditVo> {
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package org.dromara.cailiaoshebei.mapper;
|
||||
|
||||
import org.dromara.cailiaoshebei.domain.BusTotalsupplyplan;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusTotalsupplyplanVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 物资-总供应计划Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
public interface BusTotalsupplyplanMapper extends BaseMapperPlus<BusTotalsupplyplan, BusTotalsupplyplanVo> {
|
||||
|
||||
}
|
@ -0,0 +1,79 @@
|
||||
package org.dromara.cailiaoshebei.service;
|
||||
|
||||
import org.dromara.cailiaoshebei.domain.dto.BusLtnDto;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusLtnVo;
|
||||
import org.dromara.cailiaoshebei.domain.bo.BusLtnBo;
|
||||
import org.dromara.cailiaoshebei.domain.BusLtn;
|
||||
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.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 物资-物流单号Service接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-14
|
||||
*/
|
||||
public interface IBusLtnService extends IService<BusLtn>{
|
||||
|
||||
/**
|
||||
* 查询物资-物流单号
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 物资-物流单号
|
||||
*/
|
||||
BusLtnVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询物资-物流单号列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 物资-物流单号分页列表
|
||||
*/
|
||||
TableDataInfo<BusLtnVo> queryPageList(BusLtnBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的物资-物流单号列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 物资-物流单号列表
|
||||
*/
|
||||
List<BusLtnVo> queryList(BusLtnBo bo);
|
||||
|
||||
/**
|
||||
* 新增物资-物流单号
|
||||
*
|
||||
* @param bo 物资-物流单号
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(BusLtnBo bo);
|
||||
|
||||
/**
|
||||
* 修改物资-物流单号
|
||||
*
|
||||
* @param bo 物资-物流单号
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(BusLtnBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除物资-物流单号信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
|
||||
/**
|
||||
* 添加物流单号
|
||||
*/
|
||||
Boolean linkAdd(BusLtnDto dto);
|
||||
}
|
@ -0,0 +1,85 @@
|
||||
package org.dromara.cailiaoshebei.service;
|
||||
|
||||
import org.dromara.cailiaoshebei.domain.dto.BusMrpDto;
|
||||
import org.dromara.cailiaoshebei.domain.dto.BusMrpExportDto;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusMrpBaseVo;
|
||||
import org.dromara.cailiaoshebei.domain.bo.BusMrpBaseBo;
|
||||
import org.dromara.cailiaoshebei.domain.BusMrpBase;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusMrpVo;
|
||||
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.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 物资-批次需求计划基础信息Service接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
public interface IBusMrpBaseService extends IService<BusMrpBase>{
|
||||
|
||||
/**
|
||||
* 查询物资-批次需求计划基础信息
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 物资-批次需求计划基础信息
|
||||
*/
|
||||
BusMrpVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询物资-批次需求计划基础信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 物资-批次需求计划基础信息分页列表
|
||||
*/
|
||||
TableDataInfo<BusMrpBaseVo> queryPageList(BusMrpBaseBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的物资-批次需求计划基础信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 物资-批次需求计划基础信息列表
|
||||
*/
|
||||
List<BusMrpBaseVo> queryList(BusMrpBaseBo bo);
|
||||
|
||||
/**
|
||||
* 新增物资-批次需求计划基础信息
|
||||
*
|
||||
* @param bo 物资-批次需求计划基础信息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(BusMrpBaseBo bo);
|
||||
|
||||
/**
|
||||
* 修改物资-批次需求计划基础信息
|
||||
*
|
||||
* @param bo 物资-批次需求计划基础信息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(BusMrpBaseBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除物资-批次需求计划基础信息信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* 批量新增或修改物资-批次需求计划
|
||||
*/
|
||||
Boolean batchAddOrUpdate(BusMrpDto dto);
|
||||
|
||||
/**
|
||||
* 导入物资需求批次计划
|
||||
*/
|
||||
Boolean importData(BusMrpExportDto dto);
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package org.dromara.cailiaoshebei.service;
|
||||
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusPhysicalsupplyVo;
|
||||
import org.dromara.cailiaoshebei.domain.bo.BusPhysicalsupplyBo;
|
||||
import org.dromara.cailiaoshebei.domain.BusPhysicalsupply;
|
||||
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-08-14
|
||||
*/
|
||||
public interface IBusPhysicalsupplyService extends IService<BusPhysicalsupply>{
|
||||
|
||||
/**
|
||||
* 查询物资-使用情况
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 物资-使用情况
|
||||
*/
|
||||
BusPhysicalsupplyVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询物资-使用情况列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 物资-使用情况分页列表
|
||||
*/
|
||||
TableDataInfo<BusPhysicalsupplyVo> queryPageList(BusPhysicalsupplyBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的物资-使用情况列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 物资-使用情况列表
|
||||
*/
|
||||
List<BusPhysicalsupplyVo> queryList(BusPhysicalsupplyBo bo);
|
||||
|
||||
/**
|
||||
* 新增物资-使用情况
|
||||
*
|
||||
* @param bo 物资-使用情况
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(BusPhysicalsupplyBo bo);
|
||||
|
||||
/**
|
||||
* 修改物资-使用情况
|
||||
*
|
||||
* @param bo 物资-使用情况
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(BusPhysicalsupplyBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除物资-使用情况信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package org.dromara.cailiaoshebei.service;
|
||||
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusPhysicalsupplySonVo;
|
||||
import org.dromara.cailiaoshebei.domain.bo.BusPhysicalsupplySonBo;
|
||||
import org.dromara.cailiaoshebei.domain.BusPhysicalsupplySon;
|
||||
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-08-14
|
||||
*/
|
||||
public interface IBusPhysicalsupplySonService extends IService<BusPhysicalsupplySon>{
|
||||
|
||||
/**
|
||||
* 查询物资-使用情况子数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 物资-使用情况子数据
|
||||
*/
|
||||
BusPhysicalsupplySonVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询物资-使用情况子数据列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 物资-使用情况子数据分页列表
|
||||
*/
|
||||
TableDataInfo<BusPhysicalsupplySonVo> queryPageList(BusPhysicalsupplySonBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的物资-使用情况子数据列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 物资-使用情况子数据列表
|
||||
*/
|
||||
List<BusPhysicalsupplySonVo> queryList(BusPhysicalsupplySonBo bo);
|
||||
|
||||
/**
|
||||
* 新增物资-使用情况子数据
|
||||
*
|
||||
* @param bo 物资-使用情况子数据
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(BusPhysicalsupplySonBo bo);
|
||||
|
||||
/**
|
||||
* 修改物资-使用情况子数据
|
||||
*
|
||||
* @param bo 物资-使用情况子数据
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(BusPhysicalsupplySonBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除物资-使用情况子数据信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package org.dromara.cailiaoshebei.service;
|
||||
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusPlanDocAssociationVo;
|
||||
import org.dromara.cailiaoshebei.domain.bo.BusPlanDocAssociationBo;
|
||||
import org.dromara.cailiaoshebei.domain.BusPlanDocAssociation;
|
||||
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-08-13
|
||||
*/
|
||||
public interface IBusPlanDocAssociationService extends IService<BusPlanDocAssociation>{
|
||||
|
||||
/**
|
||||
* 查询物资-批次需求计划与采购单关联
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 物资-批次需求计划与采购单关联
|
||||
*/
|
||||
BusPlanDocAssociationVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询物资-批次需求计划与采购单关联列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 物资-批次需求计划与采购单关联分页列表
|
||||
*/
|
||||
TableDataInfo<BusPlanDocAssociationVo> queryPageList(BusPlanDocAssociationBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的物资-批次需求计划与采购单关联列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 物资-批次需求计划与采购单关联列表
|
||||
*/
|
||||
List<BusPlanDocAssociationVo> queryList(BusPlanDocAssociationBo bo);
|
||||
|
||||
/**
|
||||
* 新增物资-批次需求计划与采购单关联
|
||||
*
|
||||
* @param bo 物资-批次需求计划与采购单关联
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(BusPlanDocAssociationBo bo);
|
||||
|
||||
/**
|
||||
* 修改物资-批次需求计划与采购单关联
|
||||
*
|
||||
* @param bo 物资-批次需求计划与采购单关联
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(BusPlanDocAssociationBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除物资-批次需求计划与采购单关联信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
@ -0,0 +1,85 @@
|
||||
package org.dromara.cailiaoshebei.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.dromara.cailiaoshebei.domain.BusPurchaseDoc;
|
||||
import org.dromara.cailiaoshebei.domain.bo.BusPurchaseDocBo;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusPurchaseDocVo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 物资-采购联系单Service接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
public interface IBusPurchaseDocService extends IService<BusPurchaseDoc> {
|
||||
|
||||
/**
|
||||
* 查询物资-采购联系单
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 物资-采购联系单
|
||||
*/
|
||||
BusPurchaseDocVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询物资-采购联系单列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 物资-采购联系单分页列表
|
||||
*/
|
||||
TableDataInfo<BusPurchaseDocVo> queryPageList(BusPurchaseDocBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的物资-采购联系单列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 物资-采购联系单列表
|
||||
*/
|
||||
List<BusPurchaseDocVo> queryList(BusPurchaseDocBo bo);
|
||||
|
||||
/**
|
||||
* 新增物资-采购联系单
|
||||
*
|
||||
* @param bo 物资-采购联系单
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(BusPurchaseDocBo bo);
|
||||
|
||||
/**
|
||||
* 修改物资-采购联系单
|
||||
*
|
||||
* @param bo 物资-采购联系单
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(BusPurchaseDocBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除物资-采购联系单信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* 创建补货采购单
|
||||
*/
|
||||
void create(Long id, HashMap<Long, BigDecimal> map);
|
||||
|
||||
/**
|
||||
* 根据主键导出Word
|
||||
*
|
||||
* @param id 主键id
|
||||
*/
|
||||
void exportWordById(Long id, HttpServletResponse response);
|
||||
}
|
@ -0,0 +1,83 @@
|
||||
package org.dromara.cailiaoshebei.service;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusPurchaseUserVo;
|
||||
import org.dromara.cailiaoshebei.domain.bo.BusPurchaseUserBo;
|
||||
import org.dromara.cailiaoshebei.domain.BusPurchaseUser;
|
||||
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.springframework.web.bind.annotation.PathVariable;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 物资采购人员Service接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
public interface IBusPurchaseUserService extends IService<BusPurchaseUser>{
|
||||
|
||||
/**
|
||||
* 查询物资采购人员
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 物资采购人员
|
||||
*/
|
||||
BusPurchaseUserVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询物资采购人员列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 物资采购人员分页列表
|
||||
*/
|
||||
TableDataInfo<BusPurchaseUserVo> queryPageList(BusPurchaseUserBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的物资采购人员列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 物资采购人员列表
|
||||
*/
|
||||
List<BusPurchaseUserVo> queryList(BusPurchaseUserBo bo);
|
||||
|
||||
/**
|
||||
* 新增物资采购人员
|
||||
*
|
||||
* @param bo 物资采购人员
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(BusPurchaseUserBo bo);
|
||||
|
||||
/**
|
||||
* 修改物资采购人员
|
||||
*
|
||||
* @param bo 物资采购人员
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(BusPurchaseUserBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除物资采购人员信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* 新增或修改
|
||||
*/
|
||||
boolean addOrUpdate(BusPurchaseUserBo bo);
|
||||
|
||||
/**
|
||||
* 根据项目id查询采购人员信息
|
||||
*/
|
||||
BusPurchaseUserVo getInfoByProject(Long projectId);
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package org.dromara.cailiaoshebei.service;
|
||||
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusTotalsupplyplanAuditVo;
|
||||
import org.dromara.cailiaoshebei.domain.bo.BusTotalsupplyplanAuditBo;
|
||||
import org.dromara.cailiaoshebei.domain.BusTotalsupplyplanAudit;
|
||||
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-08-13
|
||||
*/
|
||||
public interface IBusTotalsupplyplanAuditService extends IService<BusTotalsupplyplanAudit>{
|
||||
|
||||
/**
|
||||
* 查询物资-总供应计划审核
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 物资-总供应计划审核
|
||||
*/
|
||||
BusTotalsupplyplanAuditVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询物资-总供应计划审核列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 物资-总供应计划审核分页列表
|
||||
*/
|
||||
TableDataInfo<BusTotalsupplyplanAuditVo> queryPageList(BusTotalsupplyplanAuditBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的物资-总供应计划审核列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 物资-总供应计划审核列表
|
||||
*/
|
||||
List<BusTotalsupplyplanAuditVo> queryList(BusTotalsupplyplanAuditBo bo);
|
||||
|
||||
/**
|
||||
* 新增物资-总供应计划审核
|
||||
*
|
||||
* @param bo 物资-总供应计划审核
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(BusTotalsupplyplanAuditBo bo);
|
||||
|
||||
/**
|
||||
* 修改物资-总供应计划审核
|
||||
*
|
||||
* @param bo 物资-总供应计划审核
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(BusTotalsupplyplanAuditBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除物资-总供应计划审核信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
@ -0,0 +1,81 @@
|
||||
package org.dromara.cailiaoshebei.service;
|
||||
|
||||
import org.dromara.cailiaoshebei.domain.bo.MasterDataReq;
|
||||
import org.dromara.cailiaoshebei.domain.dto.MasterDataReqDto;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusTotalsupplyplanVo;
|
||||
import org.dromara.cailiaoshebei.domain.bo.BusTotalsupplyplanBo;
|
||||
import org.dromara.cailiaoshebei.domain.BusTotalsupplyplan;
|
||||
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-08-13
|
||||
*/
|
||||
public interface IBusTotalsupplyplanService extends IService<BusTotalsupplyplan>{
|
||||
|
||||
/**
|
||||
* 查询物资-总供应计划
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 物资-总供应计划
|
||||
*/
|
||||
BusTotalsupplyplanVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询物资-总供应计划列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 物资-总供应计划分页列表
|
||||
*/
|
||||
TableDataInfo<BusTotalsupplyplanVo> queryPageList(BusTotalsupplyplanBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的物资-总供应计划列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 物资-总供应计划列表
|
||||
*/
|
||||
List<BusTotalsupplyplanVo> queryList(BusTotalsupplyplanBo bo);
|
||||
|
||||
/**
|
||||
* 新增物资-总供应计划
|
||||
*
|
||||
* @param bo 物资-总供应计划
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(BusTotalsupplyplanBo bo);
|
||||
|
||||
/**
|
||||
* 修改物资-总供应计划
|
||||
*
|
||||
* @param bo 物资-总供应计划
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(BusTotalsupplyplanBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除物资-总供应计划信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
|
||||
/**
|
||||
* 物资-总供应计划-主数据
|
||||
*
|
||||
* @param bo 主数据查询条件
|
||||
* @return 主数据列表
|
||||
*/
|
||||
MasterDataReqDto masterData(MasterDataReq bo);
|
||||
}
|
@ -0,0 +1,180 @@
|
||||
package org.dromara.cailiaoshebei.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.dromara.cailiaoshebei.domain.dto.BusLtnDto;
|
||||
import org.dromara.cailiaoshebei.domain.dto.BusLtnListDto;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusPurchaseDocVo;
|
||||
import org.dromara.cailiaoshebei.service.IBusMaterialbatchdemandplanService;
|
||||
import org.dromara.cailiaoshebei.service.IBusPurchaseDocService;
|
||||
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.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.cailiaoshebei.domain.bo.BusLtnBo;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusLtnVo;
|
||||
import org.dromara.cailiaoshebei.domain.BusLtn;
|
||||
import org.dromara.cailiaoshebei.mapper.BusLtnMapper;
|
||||
import org.dromara.cailiaoshebei.service.IBusLtnService;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 物资-物流单号Service业务层处理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-14
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class BusLtnServiceImpl extends ServiceImpl<BusLtnMapper, BusLtn> implements IBusLtnService {
|
||||
|
||||
private final BusLtnMapper baseMapper;
|
||||
|
||||
private final IBusPurchaseDocService purchaseDocService;
|
||||
|
||||
private final IBusMaterialbatchdemandplanService planService;
|
||||
|
||||
@Resource
|
||||
@Lazy
|
||||
private IBusLtnService busLtnService;
|
||||
|
||||
/**
|
||||
* 查询物资-物流单号
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 物资-物流单号
|
||||
*/
|
||||
@Override
|
||||
public BusLtnVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询物资-物流单号列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 物资-物流单号分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BusLtnVo> queryPageList(BusLtnBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BusLtn> lqw = buildQueryWrapper(bo);
|
||||
Page<BusLtnVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
result.getRecords().forEach(e -> {
|
||||
e.setName(planService.queryById(e.getPlanId()).getName());
|
||||
});
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的物资-物流单号列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 物资-物流单号列表
|
||||
*/
|
||||
@Override
|
||||
public List<BusLtnVo> queryList(BusLtnBo bo) {
|
||||
LambdaQueryWrapper<BusLtn> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BusLtn> buildQueryWrapper(BusLtnBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BusLtn> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByDesc(BusLtn::getId);
|
||||
lqw.eq(bo.getProjectId() != null, BusLtn::getProjectId, bo.getProjectId());
|
||||
lqw.eq(bo.getDocId() != null, BusLtn::getDocId, bo.getDocId());
|
||||
lqw.eq(bo.getPlanId() != null, BusLtn::getPlanId, bo.getPlanId());
|
||||
lqw.eq(bo.getNum() != null, BusLtn::getNum, bo.getNum());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getLtn()), BusLtn::getLtn, bo.getLtn());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增物资-物流单号
|
||||
*
|
||||
* @param bo 物资-物流单号
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(BusLtnBo bo) {
|
||||
BusLtn add = MapstructUtils.convert(bo, BusLtn.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物资-物流单号
|
||||
*
|
||||
* @param bo 物资-物流单号
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(BusLtnBo bo) {
|
||||
BusLtn update = MapstructUtils.convert(bo, BusLtn.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BusLtn entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除物资-物流单号信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean linkAdd(BusLtnDto dto) {
|
||||
|
||||
BusPurchaseDocVo busPurchaseDocVo = purchaseDocService.queryById(dto.getDocId());
|
||||
if (busPurchaseDocVo == null) {
|
||||
throw new ServiceException("采购单不存在");
|
||||
}
|
||||
busLtnService.getBaseMapper().delete(Wrappers.lambdaQuery(BusLtn.class)
|
||||
.eq(BusLtn::getDocId, dto.getDocId()));
|
||||
ArrayList<BusLtn> busLtns = new ArrayList<>();
|
||||
for (BusLtnListDto ltnListDto : dto.getList()) {
|
||||
BusLtn busLtn = BeanUtil.copyProperties(ltnListDto, BusLtn.class);
|
||||
busLtn.setProjectId(busPurchaseDocVo.getProjectId());
|
||||
busLtn.setDocId(dto.getDocId());
|
||||
busLtns.add(busLtn);
|
||||
}
|
||||
boolean save = true;
|
||||
if(CollectionUtil.isNotEmpty(busLtns)){
|
||||
save = busLtnService.saveBatch(busLtns);
|
||||
}
|
||||
return save;
|
||||
}
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
package org.dromara.cailiaoshebei.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@ -112,6 +113,8 @@ public class BusMaterialbatchdemandplanServiceImpl extends ServiceImpl<BusMateri
|
||||
lqw.eq(bo.getEstimatedCycle() != null, BusMaterialbatchdemandplan::getEstimatedCycle, bo.getEstimatedCycle());
|
||||
lqw.eq(bo.getDemandQuantity() != null, BusMaterialbatchdemandplan::getDemandQuantity, bo.getDemandQuantity());
|
||||
lqw.eq(bo.getArrivalTime() != null, BusMaterialbatchdemandplan::getArrivalTime, bo.getArrivalTime());
|
||||
lqw.eq(bo.getMrpBaseId()!=null, BusMaterialbatchdemandplan::getMrpBaseId, bo.getMrpBaseId());
|
||||
lqw.in(CollectionUtil.isNotEmpty(bo.getIds()), BusMaterialbatchdemandplan::getId, bo.getIds());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,266 @@
|
||||
package org.dromara.cailiaoshebei.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.cailiaoshebei.domain.BusMaterialbatchdemandplan;
|
||||
import org.dromara.cailiaoshebei.domain.bo.BusMaterialbatchdemandplanBo;
|
||||
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.BusMrpVo;
|
||||
import org.dromara.cailiaoshebei.service.IBusMaterialbatchdemandplanService;
|
||||
import org.dromara.common.core.domain.event.ProcessDeleteEvent;
|
||||
import org.dromara.common.core.domain.event.ProcessEvent;
|
||||
import org.dromara.common.core.domain.event.ProcessTaskEvent;
|
||||
import org.dromara.common.core.enums.BusinessStatusEnum;
|
||||
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.utils.excel.ExcelDynamicReader;
|
||||
import org.dromara.design.domain.DesCollect;
|
||||
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.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 物资-批次需求计划基础信息Service业务层处理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
@Slf4j
|
||||
public class BusMrpBaseServiceImpl extends ServiceImpl<BusMrpBaseMapper, BusMrpBase> implements IBusMrpBaseService {
|
||||
|
||||
private final BusMrpBaseMapper baseMapper;
|
||||
|
||||
private final IBusMaterialbatchdemandplanService planservice;
|
||||
|
||||
/**
|
||||
* 查询物资-批次需求计划基础信息
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 物资-批次需求计划基础信息
|
||||
*/
|
||||
@Override
|
||||
public BusMrpVo queryById(Long id) {
|
||||
BusMrpVo busMrpVo = new BusMrpVo();
|
||||
|
||||
BusMrpBaseVo busMrpBaseVo = baseMapper.selectVoById(id);
|
||||
BusMaterialbatchdemandplanBo planBo = new BusMaterialbatchdemandplanBo();
|
||||
planBo.setMrpBaseId(id);
|
||||
List<BusMaterialbatchdemandplanVo> voList = planservice.queryList(planBo);
|
||||
busMrpVo.setMrpBaseBo(busMrpBaseVo);
|
||||
busMrpVo.setPlanList(voList);
|
||||
|
||||
return busMrpVo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询物资-批次需求计划基础信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 物资-批次需求计划基础信息分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BusMrpBaseVo> queryPageList(BusMrpBaseBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BusMrpBase> lqw = buildQueryWrapper(bo);
|
||||
Page<BusMrpBaseVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的物资-批次需求计划基础信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 物资-批次需求计划基础信息列表
|
||||
*/
|
||||
@Override
|
||||
public List<BusMrpBaseVo> queryList(BusMrpBaseBo bo) {
|
||||
LambdaQueryWrapper<BusMrpBase> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BusMrpBase> buildQueryWrapper(BusMrpBaseBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BusMrpBase> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByDesc(BusMrpBase::getId);
|
||||
lqw.eq(bo.getProjectId() != null, BusMrpBase::getProjectId, bo.getProjectId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getPlanCode()), BusMrpBase::getPlanCode, bo.getPlanCode());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getMatCat()), BusMrpBase::getMatCat, bo.getMatCat());
|
||||
lqw.eq(bo.getPreparedDate() != null, BusMrpBase::getPreparedDate, bo.getPreparedDate());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), BusMrpBase::getStatus, bo.getStatus());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增物资-批次需求计划基础信息
|
||||
*
|
||||
* @param bo 物资-批次需求计划基础信息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(BusMrpBaseBo bo) {
|
||||
BusMrpBase add = MapstructUtils.convert(bo, BusMrpBase.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物资-批次需求计划基础信息
|
||||
*
|
||||
* @param bo 物资-批次需求计划基础信息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(BusMrpBaseBo bo) {
|
||||
BusMrpBase update = MapstructUtils.convert(bo, BusMrpBase.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BusMrpBase entity) {
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除物资-批次需求计划基础信息信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
planservice.remove(Wrappers.<BusMaterialbatchdemandplan>lambdaQuery()
|
||||
.in(BusMaterialbatchdemandplan::getMrpBaseId, ids));
|
||||
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean batchAddOrUpdate(BusMrpDto dto) {
|
||||
BusMrpBase convert = MapstructUtils.convert(dto.getMrpBaseBo(), BusMrpBase.class);
|
||||
convert.setStatus(null);
|
||||
boolean b = saveOrUpdate(convert);
|
||||
|
||||
planservice.remove(Wrappers.<BusMaterialbatchdemandplan>lambdaQuery()
|
||||
.eq(BusMaterialbatchdemandplan::getMrpBaseId, convert.getId()));
|
||||
|
||||
if (CollectionUtil.isNotEmpty(dto.getPlanList())) {
|
||||
List<BusMaterialbatchdemandplan> plans = MapstructUtils.convert(dto.getPlanList(), BusMaterialbatchdemandplan.class);
|
||||
plans.forEach(item -> {
|
||||
item.setMrpBaseId(convert.getId());
|
||||
item.setProjectId(convert.getProjectId());
|
||||
});
|
||||
planservice.saveBatch(plans);
|
||||
}
|
||||
return b;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean importData(BusMrpExportDto dto) {
|
||||
|
||||
try {
|
||||
List<BusMaterialbatchdemandplanExportDto> dtoList = ExcelDynamicReader.readExcel(dto.getFile(), 1, 1, 7, BusMaterialbatchdemandplanExportDto.class);
|
||||
BusMrpBase busMrpBase = BeanUtil.copyProperties(dto, BusMrpBase.class);
|
||||
save(busMrpBase);
|
||||
|
||||
ArrayList<BusMaterialbatchdemandplan> busMaterialbatchdemandplans = new ArrayList<>();
|
||||
|
||||
for (BusMaterialbatchdemandplanExportDto plan : dtoList) {
|
||||
BusMaterialbatchdemandplan plan1 = BeanUtil.copyProperties(plan, BusMaterialbatchdemandplan.class);
|
||||
plan1.setMrpBaseId(busMrpBase.getId());
|
||||
plan1.setProjectId(busMrpBase.getProjectId());
|
||||
|
||||
busMaterialbatchdemandplans.add(plan1);
|
||||
}
|
||||
planservice.saveBatch(busMaterialbatchdemandplans);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 总体流程监听(例如: 草稿,撤销,退回,作废,终止,已完成,单任务完成等)
|
||||
* 正常使用只需#processEvent.flowCode=='leave1'
|
||||
* 示例为了方便则使用startsWith匹配了全部示例key
|
||||
*
|
||||
* @param processEvent 参数
|
||||
*/
|
||||
@EventListener(condition = "#processEvent.flowCode.endsWith('mrp')")
|
||||
public void processHandler(ProcessEvent processEvent) {
|
||||
log.info("收资清单审核任务执行了{}", processEvent.toString());
|
||||
BusMrpBase busMrpBase = this.getById(Convert.toLong(processEvent.getBusinessId()));
|
||||
busMrpBase.setStatus(processEvent.getStatus());
|
||||
if (processEvent.getSubmit()) {
|
||||
busMrpBase.setStatus(BusinessStatusEnum.WAITING.getStatus());
|
||||
}
|
||||
this.updateById(busMrpBase);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行任务创建监听
|
||||
* 示例:也可通过 @EventListener(condition = "#processTaskEvent.flowCode=='leave1'")进行判断
|
||||
* 在方法中判断流程节点key
|
||||
* if ("xxx".equals(processTaskEvent.getNodeCode())) {
|
||||
* //执行业务逻辑
|
||||
* }
|
||||
*
|
||||
* @param processTaskEvent 参数
|
||||
*/
|
||||
@EventListener(condition = "#processTaskEvent.flowCode.endsWith('mrp')")
|
||||
public void processTaskHandler(ProcessTaskEvent processTaskEvent) {
|
||||
log.info("收资清单审核任务创建了{}", processTaskEvent.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* 监听删除流程事件
|
||||
* 正常使用只需#processDeleteEvent.flowCode=='leave1'
|
||||
* 示例为了方便则使用startsWith匹配了全部示例key
|
||||
*
|
||||
* @param processDeleteEvent 参数
|
||||
*/
|
||||
@EventListener(condition = "#processDeleteEvent.flowCode.endsWith('mrp')")
|
||||
public void processDeleteHandler(ProcessDeleteEvent processDeleteEvent) {
|
||||
log.info("监听删除流程事件,收资清单审核任务执行了{}", processDeleteEvent.toString());
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,152 @@
|
||||
package org.dromara.cailiaoshebei.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.cailiaoshebei.domain.bo.BusPhysicalsupplyBo;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusPhysicalsupplyVo;
|
||||
import org.dromara.cailiaoshebei.domain.BusPhysicalsupply;
|
||||
import org.dromara.cailiaoshebei.mapper.BusPhysicalsupplyMapper;
|
||||
import org.dromara.cailiaoshebei.service.IBusPhysicalsupplyService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 物资-使用情况Service业务层处理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-14
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class BusPhysicalsupplyServiceImpl extends ServiceImpl<BusPhysicalsupplyMapper, BusPhysicalsupply> implements IBusPhysicalsupplyService {
|
||||
|
||||
private final BusPhysicalsupplyMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询物资-使用情况
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 物资-使用情况
|
||||
*/
|
||||
@Override
|
||||
public BusPhysicalsupplyVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询物资-使用情况列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 物资-使用情况分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BusPhysicalsupplyVo> queryPageList(BusPhysicalsupplyBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BusPhysicalsupply> lqw = buildQueryWrapper(bo);
|
||||
Page<BusPhysicalsupplyVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的物资-使用情况列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 物资-使用情况列表
|
||||
*/
|
||||
@Override
|
||||
public List<BusPhysicalsupplyVo> queryList(BusPhysicalsupplyBo bo) {
|
||||
LambdaQueryWrapper<BusPhysicalsupply> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BusPhysicalsupply> buildQueryWrapper(BusPhysicalsupplyBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BusPhysicalsupply> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByDesc(BusPhysicalsupply::getId);
|
||||
lqw.eq(bo.getProjectId() != null, BusPhysicalsupply::getProjectId, bo.getProjectId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getName()), BusPhysicalsupply::getName, bo.getName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSpecification()), BusPhysicalsupply::getSpecification, bo.getSpecification());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSupplier()), BusPhysicalsupply::getSupplier, bo.getSupplier());
|
||||
lqw.eq(bo.getContractSigning() != null, BusPhysicalsupply::getContractSigning, bo.getContractSigning());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSupplyRequirements()), BusPhysicalsupply::getSupplyRequirements, bo.getSupplyRequirements());
|
||||
lqw.eq(bo.getProductionPhase() != null, BusPhysicalsupply::getProductionPhase, bo.getProductionPhase());
|
||||
lqw.eq(bo.getExecutionCycle() != null, BusPhysicalsupply::getExecutionCycle, bo.getExecutionCycle());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getInstallationQuantity()), BusPhysicalsupply::getInstallationQuantity, bo.getInstallationQuantity());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getInstallationRatio()), BusPhysicalsupply::getInstallationRatio, bo.getInstallationRatio());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPurchaseSubmission()), BusPhysicalsupply::getPurchaseSubmission, bo.getPurchaseSubmission());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSubmissionMaterials()), BusPhysicalsupply::getSubmissionMaterials, bo.getSubmissionMaterials());
|
||||
|
||||
//查询采购
|
||||
if (Objects.equals(bo.getFindType(), "1")){
|
||||
lqw.eq(BusPhysicalsupply::getPurchaseSubmission, "0");
|
||||
}
|
||||
//查询材料
|
||||
else if (Objects.equals(bo.getFindType(), "2")){
|
||||
lqw.eq(BusPhysicalsupply::getPurchaseSubmission, "1");
|
||||
}
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增物资-使用情况
|
||||
*
|
||||
* @param bo 物资-使用情况
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(BusPhysicalsupplyBo bo) {
|
||||
BusPhysicalsupply add = MapstructUtils.convert(bo, BusPhysicalsupply.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物资-使用情况
|
||||
*
|
||||
* @param bo 物资-使用情况
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(BusPhysicalsupplyBo bo) {
|
||||
BusPhysicalsupply update = MapstructUtils.convert(bo, BusPhysicalsupply.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BusPhysicalsupply entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除物资-使用情况信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
@ -0,0 +1,158 @@
|
||||
package org.dromara.cailiaoshebei.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.cailiaoshebei.domain.bo.BusPhysicalsupplySonBo;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusPhysicalsupplySonVo;
|
||||
import org.dromara.cailiaoshebei.domain.BusPhysicalsupplySon;
|
||||
import org.dromara.cailiaoshebei.mapper.BusPhysicalsupplySonMapper;
|
||||
import org.dromara.cailiaoshebei.service.IBusPhysicalsupplySonService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 物资-使用情况子数据Service业务层处理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-14
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class BusPhysicalsupplySonServiceImpl extends ServiceImpl<BusPhysicalsupplySonMapper, BusPhysicalsupplySon> implements IBusPhysicalsupplySonService {
|
||||
|
||||
private final BusPhysicalsupplySonMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询物资-使用情况子数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 物资-使用情况子数据
|
||||
*/
|
||||
@Override
|
||||
public BusPhysicalsupplySonVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询物资-使用情况子数据列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 物资-使用情况子数据分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BusPhysicalsupplySonVo> queryPageList(BusPhysicalsupplySonBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BusPhysicalsupplySon> lqw = buildQueryWrapper(bo);
|
||||
Page<BusPhysicalsupplySonVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的物资-使用情况子数据列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 物资-使用情况子数据列表
|
||||
*/
|
||||
@Override
|
||||
public List<BusPhysicalsupplySonVo> queryList(BusPhysicalsupplySonBo bo) {
|
||||
LambdaQueryWrapper<BusPhysicalsupplySon> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BusPhysicalsupplySon> buildQueryWrapper(BusPhysicalsupplySonBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BusPhysicalsupplySon> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByDesc(BusPhysicalsupplySon::getId);
|
||||
lqw.eq(bo.getPhysicalsupplyId() != null, BusPhysicalsupplySon::getPhysicalsupplyId, bo.getPhysicalsupplyId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDeliveryRequirements()), BusPhysicalsupplySon::getDeliveryRequirements, bo.getDeliveryRequirements());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getTransition()), BusPhysicalsupplySon::getTransition, bo.getTransition());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getBatch()), BusPhysicalsupplySon::getBatch, bo.getBatch());
|
||||
lqw.eq(bo.getIssuanceTime() != null, BusPhysicalsupplySon::getIssuanceTime, bo.getIssuanceTime());
|
||||
lqw.eq(bo.getRequireDelivery() != null, BusPhysicalsupplySon::getRequireDelivery, bo.getRequireDelivery());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getRequiredQuantity()), BusPhysicalsupplySon::getRequiredQuantity, bo.getRequiredQuantity());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCgRemark()), BusPhysicalsupplySon::getCgRemark, bo.getCgRemark());
|
||||
lqw.eq(bo.getScheduledDelivery() != null, BusPhysicalsupplySon::getScheduledDelivery, bo.getScheduledDelivery());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPlannedQuantity()), BusPhysicalsupplySon::getPlannedQuantity, bo.getPlannedQuantity());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDifferenceQuantity()), BusPhysicalsupplySon::getDifferenceQuantity, bo.getDifferenceQuantity());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getGysRemark()), BusPhysicalsupplySon::getGysRemark, bo.getGysRemark());
|
||||
lqw.eq(bo.getActualDelivery() != null, BusPhysicalsupplySon::getActualDelivery, bo.getActualDelivery());
|
||||
lqw.eq(bo.getAcceptanceCheck() != null, BusPhysicalsupplySon::getAcceptanceCheck, bo.getAcceptanceCheck());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getAssociate()), BusPhysicalsupplySon::getAssociate, bo.getAssociate());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getActualAcceptance()), BusPhysicalsupplySon::getActualAcceptance, bo.getActualAcceptance());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDhDifferenceQuantity()), BusPhysicalsupplySon::getDhDifferenceQuantity, bo.getDhDifferenceQuantity());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getExpectedState()), BusPhysicalsupplySon::getExpectedState, bo.getExpectedState());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDhRemark()), BusPhysicalsupplySon::getDhRemark, bo.getDhRemark());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCargoAmount()), BusPhysicalsupplySon::getCargoAmount, bo.getCargoAmount());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSettlementAmount()), BusPhysicalsupplySon::getSettlementAmount, bo.getSettlementAmount());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getAdvance()), BusPhysicalsupplySon::getAdvance, bo.getAdvance());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getFeed()), BusPhysicalsupplySon::getFeed, bo.getFeed());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getAcceptancePayment()), BusPhysicalsupplySon::getAcceptancePayment, bo.getAcceptancePayment());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getQualityGuarantee()), BusPhysicalsupplySon::getQualityGuarantee, bo.getQualityGuarantee());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDebugging()), BusPhysicalsupplySon::getDebugging, bo.getDebugging());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getJsRemark()), BusPhysicalsupplySon::getJsRemark, bo.getJsRemark());
|
||||
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增物资-使用情况子数据
|
||||
*
|
||||
* @param bo 物资-使用情况子数据
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(BusPhysicalsupplySonBo bo) {
|
||||
BusPhysicalsupplySon add = MapstructUtils.convert(bo, BusPhysicalsupplySon.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物资-使用情况子数据
|
||||
*
|
||||
* @param bo 物资-使用情况子数据
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(BusPhysicalsupplySonBo bo) {
|
||||
BusPhysicalsupplySon update = MapstructUtils.convert(bo, BusPhysicalsupplySon.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BusPhysicalsupplySon entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除物资-使用情况子数据信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
@ -0,0 +1,133 @@
|
||||
package org.dromara.cailiaoshebei.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.cailiaoshebei.domain.bo.BusPlanDocAssociationBo;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusPlanDocAssociationVo;
|
||||
import org.dromara.cailiaoshebei.domain.BusPlanDocAssociation;
|
||||
import org.dromara.cailiaoshebei.mapper.BusPlanDocAssociationMapper;
|
||||
import org.dromara.cailiaoshebei.service.IBusPlanDocAssociationService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 物资-批次需求计划与采购单关联Service业务层处理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class BusPlanDocAssociationServiceImpl extends ServiceImpl<BusPlanDocAssociationMapper, BusPlanDocAssociation> implements IBusPlanDocAssociationService {
|
||||
|
||||
private final BusPlanDocAssociationMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询物资-批次需求计划与采购单关联
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 物资-批次需求计划与采购单关联
|
||||
*/
|
||||
@Override
|
||||
public BusPlanDocAssociationVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询物资-批次需求计划与采购单关联列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 物资-批次需求计划与采购单关联分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BusPlanDocAssociationVo> queryPageList(BusPlanDocAssociationBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BusPlanDocAssociation> lqw = buildQueryWrapper(bo);
|
||||
Page<BusPlanDocAssociationVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的物资-批次需求计划与采购单关联列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 物资-批次需求计划与采购单关联列表
|
||||
*/
|
||||
@Override
|
||||
public List<BusPlanDocAssociationVo> queryList(BusPlanDocAssociationBo bo) {
|
||||
LambdaQueryWrapper<BusPlanDocAssociation> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BusPlanDocAssociation> buildQueryWrapper(BusPlanDocAssociationBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BusPlanDocAssociation> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByDesc(BusPlanDocAssociation::getId);
|
||||
lqw.eq(bo.getProjectId() != null, BusPlanDocAssociation::getProjectId, bo.getProjectId());
|
||||
lqw.eq(bo.getPlanId() != null, BusPlanDocAssociation::getPlanId, bo.getPlanId());
|
||||
lqw.eq(bo.getDocId() != null, BusPlanDocAssociation::getDocId, bo.getDocId());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增物资-批次需求计划与采购单关联
|
||||
*
|
||||
* @param bo 物资-批次需求计划与采购单关联
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(BusPlanDocAssociationBo bo) {
|
||||
BusPlanDocAssociation add = MapstructUtils.convert(bo, BusPlanDocAssociation.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物资-批次需求计划与采购单关联
|
||||
*
|
||||
* @param bo 物资-批次需求计划与采购单关联
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(BusPlanDocAssociationBo bo) {
|
||||
BusPlanDocAssociation update = MapstructUtils.convert(bo, BusPlanDocAssociation.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BusPlanDocAssociation entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除物资-批次需求计划与采购单关联信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
@ -0,0 +1,390 @@
|
||||
package org.dromara.cailiaoshebei.service.impl;
|
||||
|
||||
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 com.deepoove.poi.XWPFTemplate;
|
||||
import com.deepoove.poi.config.Configure;
|
||||
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
|
||||
import jakarta.servlet.ServletOutputStream;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.cailiaoshebei.controller.constant;
|
||||
import org.dromara.cailiaoshebei.domain.BusMaterialbatchdemandplan;
|
||||
import org.dromara.cailiaoshebei.domain.BusPlanDocAssociation;
|
||||
import org.dromara.cailiaoshebei.domain.BusPurchaseDoc;
|
||||
import org.dromara.cailiaoshebei.domain.bo.BusPlanDocAssociationBo;
|
||||
import org.dromara.cailiaoshebei.domain.bo.BusPurchaseDocBo;
|
||||
import org.dromara.cailiaoshebei.domain.dto.BusMaterialbatchdemandplanWordDto;
|
||||
import org.dromara.cailiaoshebei.domain.dto.BusPurchaseDocWordDto;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusPlanDocAssociationVo;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusPurchaseDocVo;
|
||||
import org.dromara.cailiaoshebei.mapper.BusPurchaseDocMapper;
|
||||
import org.dromara.cailiaoshebei.service.IBusMaterialbatchdemandplanService;
|
||||
import org.dromara.cailiaoshebei.service.IBusMrpBaseService;
|
||||
import org.dromara.cailiaoshebei.service.IBusPlanDocAssociationService;
|
||||
import org.dromara.cailiaoshebei.service.IBusPurchaseDocService;
|
||||
import org.dromara.common.core.domain.event.ProcessDeleteEvent;
|
||||
import org.dromara.common.core.domain.event.ProcessEvent;
|
||||
import org.dromara.common.core.domain.event.ProcessTaskEvent;
|
||||
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.oss.exception.OssException;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 物资-采购联系单Service业务层处理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
@Slf4j
|
||||
public class BusPurchaseDocServiceImpl extends ServiceImpl<BusPurchaseDocMapper, BusPurchaseDoc> implements IBusPurchaseDocService {
|
||||
|
||||
private final BusPurchaseDocMapper baseMapper;
|
||||
|
||||
private final IBusPlanDocAssociationService planDocAssociationService;
|
||||
|
||||
private final IBusMaterialbatchdemandplanService materialbatchdemandplanService;
|
||||
|
||||
private final IBusMrpBaseService mrpBaseService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询物资-采购联系单
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 物资-采购联系单
|
||||
*/
|
||||
@Override
|
||||
public BusPurchaseDocVo queryById(Long id) {
|
||||
BusPurchaseDocVo busPurchaseDocVo = baseMapper.selectVoById(id);
|
||||
BusPlanDocAssociationBo busPlanDocAssociationBo = new BusPlanDocAssociationBo();
|
||||
busPlanDocAssociationBo.setDocId(id);
|
||||
List<BusPlanDocAssociationVo> busPlanDocAssociationVos = planDocAssociationService.queryList(busPlanDocAssociationBo);
|
||||
busPurchaseDocVo.setAssociationList(busPlanDocAssociationVos);
|
||||
return busPurchaseDocVo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询物资-采购联系单列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 物资-采购联系单分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BusPurchaseDocVo> queryPageList(BusPurchaseDocBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BusPurchaseDoc> lqw = buildQueryWrapper(bo);
|
||||
Page<BusPurchaseDocVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
result.getRecords().forEach(v -> {
|
||||
v.setPlanCode(mrpBaseService.getById(v.getMrpBaseId()).getPlanCode());
|
||||
});
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的物资-采购联系单列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 物资-采购联系单列表
|
||||
*/
|
||||
@Override
|
||||
public List<BusPurchaseDocVo> queryList(BusPurchaseDocBo bo) {
|
||||
LambdaQueryWrapper<BusPurchaseDoc> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BusPurchaseDoc> buildQueryWrapper(BusPurchaseDocBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BusPurchaseDoc> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByDesc(BusPurchaseDoc::getId);
|
||||
lqw.eq(bo.getProjectId() != null, BusPurchaseDoc::getProjectId, bo.getProjectId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDocCode()), BusPurchaseDoc::getDocCode, bo.getDocCode());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSupplier()), BusPurchaseDoc::getSupplier, bo.getSupplier());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getReason()), BusPurchaseDoc::getReason, bo.getReason());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getName()), BusPurchaseDoc::getName, bo.getName());
|
||||
lqw.eq(bo.getArrivalDate() != null, BusPurchaseDoc::getArrivalDate, bo.getArrivalDate());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDesignDirectorTel()), BusPurchaseDoc::getDesignDirectorTel, bo.getDesignDirectorTel());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getTechnicalDirectorTel()), BusPurchaseDoc::getTechnicalDirectorTel, bo.getTechnicalDirectorTel());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getReceivingAddress()), BusPurchaseDoc::getReceivingAddress, bo.getReceivingAddress());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getContacts()), BusPurchaseDoc::getContacts, bo.getContacts());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getProjectDirector()), BusPurchaseDoc::getProjectDirector, bo.getProjectDirector());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPurchasingAgent()), BusPurchaseDoc::getPurchasingAgent, bo.getPurchasingAgent());
|
||||
lqw.eq(bo.getPreparedDate() != null, BusPurchaseDoc::getPreparedDate, bo.getPreparedDate());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getFeedbackUrl()), BusPurchaseDoc::getFeedbackUrl, bo.getFeedbackUrl());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSigningUnit()), BusPurchaseDoc::getSigningUnit, bo.getSigningUnit());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSigningPerson()), BusPurchaseDoc::getSigningPerson, bo.getSigningPerson());
|
||||
lqw.eq(bo.getSigningDate() != null, BusPurchaseDoc::getSigningDate, bo.getSigningDate());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), BusPurchaseDoc::getStatus, bo.getStatus());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增物资-采购联系单
|
||||
*
|
||||
* @param bo 物资-采购联系单
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean insertByBo(BusPurchaseDocBo bo) {
|
||||
|
||||
if (CollectionUtil.isEmpty(bo.getAssociationList())) {
|
||||
throw new ServiceException("请与计划关联");
|
||||
}
|
||||
|
||||
BusPurchaseDoc add = MapstructUtils.convert(bo, BusPurchaseDoc.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
//存入联系表
|
||||
List<BusPlanDocAssociation> convert = MapstructUtils.convert(bo.getAssociationList(), BusPlanDocAssociation.class);
|
||||
convert.forEach(item -> {
|
||||
item.setProjectId(add.getProjectId());
|
||||
item.setDocId(add.getId());
|
||||
});
|
||||
planDocAssociationService.saveBatch(convert);
|
||||
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物资-采购联系单
|
||||
*
|
||||
* @param bo 物资-采购联系单
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(BusPurchaseDocBo bo) {
|
||||
BusPurchaseDoc update = MapstructUtils.convert(bo, BusPurchaseDoc.class);
|
||||
validEntityBeforeSave(update);
|
||||
|
||||
planDocAssociationService.remove(Wrappers.<BusPlanDocAssociation>lambdaQuery()
|
||||
.eq(BusPlanDocAssociation::getProjectId, update.getProjectId())
|
||||
.eq(BusPlanDocAssociation::getDocId, update.getId()));
|
||||
|
||||
if (CollectionUtil.isNotEmpty(bo.getAssociationList())) {
|
||||
List<BusPlanDocAssociation> convert = MapstructUtils.convert(bo.getAssociationList(), BusPlanDocAssociation.class);
|
||||
convert.forEach(item -> {
|
||||
item.setProjectId(update.getProjectId());
|
||||
item.setDocId(update.getId());
|
||||
});
|
||||
planDocAssociationService.saveBatch(convert);
|
||||
}
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BusPurchaseDoc entity) {
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除物资-采购联系单信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Async
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create(Long id, HashMap<Long, BigDecimal> map) {
|
||||
BusPurchaseDoc busPurchaseDoc = baseMapper.selectById(id);
|
||||
if (busPurchaseDoc == null) {
|
||||
return;
|
||||
}
|
||||
if (CollectionUtil.isEmpty(map.keySet())) {
|
||||
return;
|
||||
}
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmss"); // 年月日时分秒格式
|
||||
String dateTimeStr = now.format(formatter);
|
||||
busPurchaseDoc.setId(null);
|
||||
busPurchaseDoc.setDocCode("BH-" + busPurchaseDoc.getDocCode() + "-" + dateTimeStr);
|
||||
busPurchaseDoc.setFeedbackUrl(null);
|
||||
busPurchaseDoc.setStatus(BusinessStatusEnum.DRAFT.getStatus());
|
||||
busPurchaseDoc.setDocType("2");
|
||||
save(busPurchaseDoc);
|
||||
|
||||
//创建计划
|
||||
ArrayList<BusPlanDocAssociation> busPlanDocAssociations = new ArrayList<>();
|
||||
for (Long planId : map.keySet()) {
|
||||
BusPlanDocAssociation busPlanDocAssociation = new BusPlanDocAssociation();
|
||||
busPlanDocAssociation.setProjectId(busPurchaseDoc.getProjectId());
|
||||
busPlanDocAssociation.setPlanId(planId);
|
||||
busPlanDocAssociation.setDocId(busPurchaseDoc.getId());
|
||||
|
||||
busPlanDocAssociations.add(busPlanDocAssociation);
|
||||
}
|
||||
planDocAssociationService.saveBatch(busPlanDocAssociations);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据主键导出Word
|
||||
*
|
||||
* @param id 主键id
|
||||
*/
|
||||
@Override
|
||||
public void exportWordById(Long id, HttpServletResponse response) {
|
||||
BusPurchaseDoc purchaseDoc = this.getById(id);
|
||||
if (purchaseDoc == null) {
|
||||
throw new ServiceException("物料领料单不存在");
|
||||
}
|
||||
// 准备数据
|
||||
List<BusMaterialbatchdemandplan> items = new ArrayList<>();
|
||||
List<BusPlanDocAssociation> planDocAssociationList = planDocAssociationService.lambdaQuery()
|
||||
.eq(BusPlanDocAssociation::getDocId, id)
|
||||
.list();
|
||||
if (CollUtil.isNotEmpty(planDocAssociationList)) {
|
||||
List<Long> planIds = planDocAssociationList.stream().map(BusPlanDocAssociation::getPlanId).toList();
|
||||
items = materialbatchdemandplanService.listByIds(planIds);
|
||||
}
|
||||
BusPurchaseDocWordDto data = this.getReplacementDto(purchaseDoc, items);
|
||||
// 生成文件
|
||||
try (InputStream is = getClass().getClassLoader().getResourceAsStream(constant.PURCHASE_DOC_TEMPLATE_PATH)) {
|
||||
if (is == null) {
|
||||
throw new ServiceException("模板文件不存在");
|
||||
}
|
||||
LoopRowTableRenderPolicy hackLoopTableRenderPolicy = new LoopRowTableRenderPolicy();
|
||||
Configure config = Configure.builder().bind("items", hackLoopTableRenderPolicy).build();
|
||||
XWPFTemplate template = XWPFTemplate.compile(is, config);
|
||||
template.render(data);
|
||||
|
||||
// 设置响应头,通知浏览器下载 Word 文件
|
||||
String fileName = URLEncoder.encode("物料领料单_" + id + ".docx", StandardCharsets.UTF_8);
|
||||
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE + "; charset=UTF-8");
|
||||
response.setHeader("Content-Disposition", "attachment; filename=" + fileName);
|
||||
try (ServletOutputStream out = response.getOutputStream()) {
|
||||
template.write(out); // 将文件写入响应流
|
||||
out.flush();
|
||||
}
|
||||
template.close();
|
||||
} catch (IOException e) {
|
||||
throw new OssException("生成Word文件失败,错误信息: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据实体获取替换数据
|
||||
*
|
||||
* @param purchaseDoc 物资-采购联系单对象
|
||||
* @param items 物资-批次需求计划对象列表
|
||||
* @return 替换 Word 数据
|
||||
*/
|
||||
private BusPurchaseDocWordDto getReplacementDto(BusPurchaseDoc purchaseDoc, List<BusMaterialbatchdemandplan> items) {
|
||||
BusPurchaseDocWordDto dto = new BusPurchaseDocWordDto();
|
||||
BeanUtils.copyProperties(purchaseDoc, dto);
|
||||
// 日期转换
|
||||
LocalDate arrivalDate = purchaseDoc.getArrivalDate();
|
||||
dto.setArrivalDate(arrivalDate.format(DateTimeFormatter.ofPattern("yyyy 年 MM 月 dd 日")));
|
||||
LocalDate signingDate = purchaseDoc.getSigningDate();
|
||||
dto.setSigningDate(signingDate.format(DateTimeFormatter.ofPattern("yyyy 年 MM 月 dd 日")));
|
||||
// 明细项信息
|
||||
if (CollUtil.isNotEmpty(items)) {
|
||||
List<BusMaterialbatchdemandplanWordDto> dtoItems = new ArrayList<>();
|
||||
for (int i = 1; i <= items.size(); i++) {
|
||||
BusMaterialbatchdemandplan item = items.get(i - 1);
|
||||
BusMaterialbatchdemandplanWordDto itemDto = new BusMaterialbatchdemandplanWordDto();
|
||||
BeanUtils.copyProperties(item, itemDto);
|
||||
itemDto.setNum(i);
|
||||
itemDto.setChildName(item.getName());
|
||||
dtoItems.add(itemDto);
|
||||
}
|
||||
dto.setItems(dtoItems);
|
||||
} else {
|
||||
BusMaterialbatchdemandplanWordDto itemDto = new BusMaterialbatchdemandplanWordDto();
|
||||
itemDto.setNum(1);
|
||||
dto.setItems(List.of(itemDto));
|
||||
}
|
||||
return dto;
|
||||
}
|
||||
|
||||
/**
|
||||
* 总体流程监听(例如: 草稿,撤销,退回,作废,终止,已完成,单任务完成等)
|
||||
* 正常使用只需#processEvent.flowCode=='leave1'
|
||||
* 示例为了方便则使用startsWith匹配了全部示例key
|
||||
*
|
||||
* @param processEvent 参数
|
||||
*/
|
||||
@EventListener(condition = "#processEvent.flowCode.endsWith('purchaseDoc')")
|
||||
public void processHandler(ProcessEvent processEvent) {
|
||||
log.info("收资清单审核任务执行了{}", processEvent.toString());
|
||||
BusPurchaseDoc purchaseDoc = this.getById(Convert.toLong(processEvent.getBusinessId()));
|
||||
purchaseDoc.setStatus(processEvent.getStatus());
|
||||
if (processEvent.getSubmit()) {
|
||||
purchaseDoc.setStatus(BusinessStatusEnum.WAITING.getStatus());
|
||||
purchaseDoc.setPreparedDate(LocalDate.now());
|
||||
}
|
||||
this.updateById(purchaseDoc);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行任务创建监听
|
||||
* 示例:也可通过 @EventListener(condition = "#processTaskEvent.flowCode=='leave1'")进行判断
|
||||
* 在方法中判断流程节点key
|
||||
* if ("xxx".equals(processTaskEvent.getNodeCode())) {
|
||||
* //执行业务逻辑
|
||||
* }
|
||||
*
|
||||
* @param processTaskEvent 参数
|
||||
*/
|
||||
@EventListener(condition = "#processTaskEvent.flowCode.endsWith('purchaseDoc')")
|
||||
public void processTaskHandler(ProcessTaskEvent processTaskEvent) {
|
||||
log.info("收资清单审核任务创建了{}", processTaskEvent.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* 监听删除流程事件
|
||||
* 正常使用只需#processDeleteEvent.flowCode=='leave1'
|
||||
* 示例为了方便则使用startsWith匹配了全部示例key
|
||||
*
|
||||
* @param processDeleteEvent 参数
|
||||
*/
|
||||
@EventListener(condition = "#processDeleteEvent.flowCode.endsWith('purchaseDoc')")
|
||||
public void processDeleteHandler(ProcessDeleteEvent processDeleteEvent) {
|
||||
log.info("监听删除流程事件,收资清单审核任务执行了{}", processDeleteEvent.toString());
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,146 @@
|
||||
package org.dromara.cailiaoshebei.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.cailiaoshebei.domain.bo.BusPurchaseUserBo;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusPurchaseUserVo;
|
||||
import org.dromara.cailiaoshebei.domain.BusPurchaseUser;
|
||||
import org.dromara.cailiaoshebei.mapper.BusPurchaseUserMapper;
|
||||
import org.dromara.cailiaoshebei.service.IBusPurchaseUserService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 物资采购人员Service业务层处理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class BusPurchaseUserServiceImpl extends ServiceImpl<BusPurchaseUserMapper, BusPurchaseUser>
|
||||
implements IBusPurchaseUserService {
|
||||
|
||||
private final BusPurchaseUserMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询物资采购人员
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 物资采购人员
|
||||
*/
|
||||
@Override
|
||||
public BusPurchaseUserVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询物资采购人员列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 物资采购人员分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BusPurchaseUserVo> queryPageList(BusPurchaseUserBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BusPurchaseUser> lqw = buildQueryWrapper(bo);
|
||||
Page<BusPurchaseUserVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的物资采购人员列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 物资采购人员列表
|
||||
*/
|
||||
@Override
|
||||
public List<BusPurchaseUserVo> queryList(BusPurchaseUserBo bo) {
|
||||
LambdaQueryWrapper<BusPurchaseUser> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BusPurchaseUser> buildQueryWrapper(BusPurchaseUserBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BusPurchaseUser> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByDesc(BusPurchaseUser::getId);
|
||||
lqw.eq(bo.getProjectId() != null, BusPurchaseUser::getProjectId, bo.getProjectId());
|
||||
lqw.eq(bo.getUserId() != null, BusPurchaseUser::getUserId, bo.getUserId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getUserName()), BusPurchaseUser::getUserName, bo.getUserName());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增物资采购人员
|
||||
*
|
||||
* @param bo 物资采购人员
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(BusPurchaseUserBo bo) {
|
||||
BusPurchaseUser add = MapstructUtils.convert(bo, BusPurchaseUser.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物资采购人员
|
||||
*
|
||||
* @param bo 物资采购人员
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(BusPurchaseUserBo bo) {
|
||||
BusPurchaseUser update = MapstructUtils.convert(bo, BusPurchaseUser.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BusPurchaseUser entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除物资采购人员信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addOrUpdate(BusPurchaseUserBo bo) {
|
||||
BusPurchaseUser add = MapstructUtils.convert(bo, BusPurchaseUser.class);
|
||||
return saveOrUpdate(add);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BusPurchaseUserVo getInfoByProject(Long projectId) {
|
||||
return baseMapper.selectVoOne(Wrappers.lambdaQuery(BusPurchaseUser.class)
|
||||
.eq(BusPurchaseUser::getProjectId, projectId).last("limit 1"));
|
||||
}
|
||||
}
|
@ -0,0 +1,134 @@
|
||||
package org.dromara.cailiaoshebei.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.cailiaoshebei.domain.bo.BusTotalsupplyplanAuditBo;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusTotalsupplyplanAuditVo;
|
||||
import org.dromara.cailiaoshebei.domain.BusTotalsupplyplanAudit;
|
||||
import org.dromara.cailiaoshebei.mapper.BusTotalsupplyplanAuditMapper;
|
||||
import org.dromara.cailiaoshebei.service.IBusTotalsupplyplanAuditService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 物资-总供应计划审核Service业务层处理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class BusTotalsupplyplanAuditServiceImpl extends ServiceImpl<BusTotalsupplyplanAuditMapper, BusTotalsupplyplanAudit> implements IBusTotalsupplyplanAuditService {
|
||||
|
||||
private final BusTotalsupplyplanAuditMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询物资-总供应计划审核
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 物资-总供应计划审核
|
||||
*/
|
||||
@Override
|
||||
public BusTotalsupplyplanAuditVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询物资-总供应计划审核列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 物资-总供应计划审核分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BusTotalsupplyplanAuditVo> queryPageList(BusTotalsupplyplanAuditBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BusTotalsupplyplanAudit> lqw = buildQueryWrapper(bo);
|
||||
Page<BusTotalsupplyplanAuditVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的物资-总供应计划审核列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 物资-总供应计划审核列表
|
||||
*/
|
||||
@Override
|
||||
public List<BusTotalsupplyplanAuditVo> queryList(BusTotalsupplyplanAuditBo bo) {
|
||||
LambdaQueryWrapper<BusTotalsupplyplanAudit> lqw = buildQueryWrapper(bo);
|
||||
List<BusTotalsupplyplanAuditVo> busTotalsupplyplanAuditVos = baseMapper.selectVoList(lqw);
|
||||
return busTotalsupplyplanAuditVos;
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BusTotalsupplyplanAudit> buildQueryWrapper(BusTotalsupplyplanAuditBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BusTotalsupplyplanAudit> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByDesc(BusTotalsupplyplanAudit::getId);
|
||||
lqw.eq(bo.getProjectId() != null, BusTotalsupplyplanAudit::getProjectId, bo.getProjectId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getBatchNumber()), BusTotalsupplyplanAudit::getBatchNumber, bo.getBatchNumber());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), BusTotalsupplyplanAudit::getStatus, bo.getStatus());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增物资-总供应计划审核
|
||||
*
|
||||
* @param bo 物资-总供应计划审核
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(BusTotalsupplyplanAuditBo bo) {
|
||||
BusTotalsupplyplanAudit add = MapstructUtils.convert(bo, BusTotalsupplyplanAudit.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物资-总供应计划审核
|
||||
*
|
||||
* @param bo 物资-总供应计划审核
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(BusTotalsupplyplanAuditBo bo) {
|
||||
BusTotalsupplyplanAudit update = MapstructUtils.convert(bo, BusTotalsupplyplanAudit.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BusTotalsupplyplanAudit entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除物资-总供应计划审核信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
@ -0,0 +1,210 @@
|
||||
package org.dromara.cailiaoshebei.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.cailiaoshebei.domain.bo.MasterDataReq;
|
||||
import org.dromara.cailiaoshebei.domain.dto.MasterDataReqDto;
|
||||
import org.dromara.common.core.domain.event.ProcessDeleteEvent;
|
||||
import org.dromara.common.core.domain.event.ProcessEvent;
|
||||
import org.dromara.common.core.domain.event.ProcessTaskEvent;
|
||||
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.cailiaoshebei.domain.BusTotalsupplyplanAudit;
|
||||
import org.dromara.cailiaoshebei.service.IBusTotalsupplyplanAuditService;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.cailiaoshebei.domain.bo.BusTotalsupplyplanBo;
|
||||
import org.dromara.cailiaoshebei.domain.vo.BusTotalsupplyplanVo;
|
||||
import org.dromara.cailiaoshebei.domain.BusTotalsupplyplan;
|
||||
import org.dromara.cailiaoshebei.mapper.BusTotalsupplyplanMapper;
|
||||
import org.dromara.cailiaoshebei.service.IBusTotalsupplyplanService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 物资-总供应计划Service业务层处理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-08-13
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
@Slf4j
|
||||
public class BusTotalsupplyplanServiceImpl extends ServiceImpl<BusTotalsupplyplanMapper, BusTotalsupplyplan> implements IBusTotalsupplyplanService {
|
||||
|
||||
private final BusTotalsupplyplanMapper baseMapper;
|
||||
|
||||
private final IBusTotalsupplyplanAuditService busTotalsupplyplanAuditService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询物资-总供应计划
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 物资-总供应计划
|
||||
*/
|
||||
@Override
|
||||
public BusTotalsupplyplanVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询物资-总供应计划列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 物资-总供应计划分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BusTotalsupplyplanVo> queryPageList(BusTotalsupplyplanBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<BusTotalsupplyplan> lqw = buildQueryWrapper(bo);
|
||||
Page<BusTotalsupplyplanVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的物资-总供应计划列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 物资-总供应计划列表
|
||||
*/
|
||||
@Override
|
||||
public List<BusTotalsupplyplanVo> queryList(BusTotalsupplyplanBo bo) {
|
||||
LambdaQueryWrapper<BusTotalsupplyplan> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BusTotalsupplyplan> buildQueryWrapper(BusTotalsupplyplanBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<BusTotalsupplyplan> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByDesc(BusTotalsupplyplan::getId);
|
||||
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());
|
||||
lqw.eq(bo.getDateService() != null, BusTotalsupplyplan::getDateService, bo.getDateService());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDeliveryPoints()), BusTotalsupplyplan::getDeliveryPoints, bo.getDeliveryPoints());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPartUsed()), BusTotalsupplyplan::getPartUsed, bo.getPartUsed());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增物资-总供应计划
|
||||
*
|
||||
* @param bo 物资-总供应计划
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(BusTotalsupplyplanBo bo) {
|
||||
BusTotalsupplyplan add = MapstructUtils.convert(bo, BusTotalsupplyplan.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物资-总供应计划
|
||||
*
|
||||
* @param bo 物资-总供应计划
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(BusTotalsupplyplanBo bo) {
|
||||
BusTotalsupplyplan update = MapstructUtils.convert(bo, BusTotalsupplyplan.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BusTotalsupplyplan entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除物资-总供应计划信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MasterDataReqDto masterData(MasterDataReq bo) {
|
||||
//1、获取主数据
|
||||
BusTotalsupplyplanAudit byId = busTotalsupplyplanAuditService.getById(bo.getId());
|
||||
MasterDataReqDto masterDataReqDto = BeanUtil.copyProperties(byId, MasterDataReqDto.class);
|
||||
//2、获取所有主数据
|
||||
LambdaQueryWrapper<BusTotalsupplyplan> busTotalsupplyplanLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
busTotalsupplyplanLambdaQueryWrapper.eq(BusTotalsupplyplan::getBatchNumber, byId.getBatchNumber());
|
||||
List<BusTotalsupplyplan> busTotalsupplyplans = baseMapper.selectList(busTotalsupplyplanLambdaQueryWrapper);
|
||||
masterDataReqDto.setSubData(busTotalsupplyplans);
|
||||
return masterDataReqDto;
|
||||
}
|
||||
|
||||
/**
|
||||
* 总体流程监听(例如: 草稿,撤销,退回,作废,终止,已完成,单任务完成等)
|
||||
* 正常使用只需#processEvent.flowCode=='leave1'
|
||||
* 示例为了方便则使用startsWith匹配了全部示例key
|
||||
*
|
||||
* @param processEvent 参数
|
||||
*/
|
||||
@org.springframework.context.event.EventListener(condition = "#processEvent.flowCode.endsWith('totalsupplyplan')")
|
||||
public void processPlansHandler(ProcessEvent processEvent) {
|
||||
log.info("物资总供应计划审核任务执行了{}", processEvent.toString());
|
||||
String id = processEvent.getBusinessId();
|
||||
//修改审核状态
|
||||
BusTotalsupplyplanAudit busTotalsupplyplanAudit = new BusTotalsupplyplanAudit();
|
||||
busTotalsupplyplanAudit.setId(Long.valueOf(id));
|
||||
busTotalsupplyplanAudit.setStatus(processEvent.getStatus());
|
||||
busTotalsupplyplanAuditService.updateById(busTotalsupplyplanAudit);
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行任务创建监听
|
||||
* 示例:也可通过 @EventListener(condition = "#processTaskEvent.flowCode=='leave1'")进行判断
|
||||
* 在方法中判断流程节点key
|
||||
* if ("xxx".equals(processTaskEvent.getNodeCode())) {
|
||||
* //执行业务逻辑
|
||||
* }
|
||||
*
|
||||
* @param processTaskEvent 参数
|
||||
*/
|
||||
@org.springframework.context.event.EventListener(condition = "#processTaskEvent.flowCode.endsWith('totalsupplyplan')")
|
||||
public void processTaskPlansHandler(ProcessTaskEvent processTaskEvent) {
|
||||
log.info("物资总供应计划审核任务创建了{}", processTaskEvent.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* 监听删除流程事件
|
||||
* 正常使用只需#processDeleteEvent.flowCode=='leave1'
|
||||
* 示例为了方便则使用startsWith匹配了全部示例key
|
||||
*
|
||||
* @param processDeleteEvent 参数
|
||||
*/
|
||||
@EventListener(condition = "#processDeleteEvent.flowCode.endsWith('totalsupplyplan')")
|
||||
public void processDeletePlansHandler(ProcessDeleteEvent processDeleteEvent) {
|
||||
log.info("物资总供应计划计划删除流程事件,技术标准文件审核任务执行了{}", processDeleteEvent.toString());
|
||||
}
|
||||
|
||||
}
|
@ -11,4 +11,16 @@ public interface MinioPathConstant {
|
||||
String ContactNotice = "contactNotice";
|
||||
// 联系单模板
|
||||
String ContactNoticeTemplate = "contactNotice/template";
|
||||
|
||||
// 设计
|
||||
String Design = "design";
|
||||
// 设计工程量清单
|
||||
String BillOfQuantities = Design+"/billOfQuantities";
|
||||
// 设计图纸评审
|
||||
String DrawingReview = Design+"/drawingReview";
|
||||
|
||||
//手续合账
|
||||
String Formalities = "formalities";
|
||||
//手续附件
|
||||
String FormalitiesAnnex = Formalities +"/annex";
|
||||
}
|
||||
|
@ -0,0 +1,266 @@
|
||||
package org.dromara.common.utils.excel;
|
||||
|
||||
/**
|
||||
* @Author 铁憨憨
|
||||
* @Date 2025/8/13 14:17
|
||||
* @Version 1.0
|
||||
*/
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
public class ExcelDynamicReader {
|
||||
|
||||
/**
|
||||
* 动态读取Excel文件并映射到实体类(使用无参构造函数+Setter方法)
|
||||
*/
|
||||
public static <T> List<T> readExcel(MultipartFile file, int skipRows, int startColumn,
|
||||
int endColumn, Class<T> clazz) throws Exception {
|
||||
List<T> dataList = new ArrayList<>();
|
||||
|
||||
// 验证参数有效性
|
||||
if (startColumn < 0 || endColumn < startColumn) {
|
||||
throw new IllegalArgumentException("列索引设置无效");
|
||||
}
|
||||
|
||||
// 获取实体类的所有字段
|
||||
Field[] fields = clazz.getDeclaredFields();
|
||||
// 检查字段数量是否与要读取的列数匹配
|
||||
int columnCount = endColumn - startColumn + 1;
|
||||
if (fields.length != columnCount) {
|
||||
throw new IllegalArgumentException("实体类字段数量与要读取的列数不匹配: " +
|
||||
fields.length + " vs " + columnCount);
|
||||
}
|
||||
|
||||
try (InputStream inputStream = file.getInputStream();
|
||||
Workbook workbook = WorkbookFactory.create(inputStream)) {
|
||||
|
||||
// 获取第一个工作表
|
||||
Sheet sheet = workbook.getSheetAt(0);
|
||||
|
||||
// 从指定行开始读取数据(跳过skipRows行)
|
||||
for (int rowIndex = skipRows; rowIndex <= sheet.getLastRowNum(); rowIndex++) {
|
||||
Row row = sheet.getRow(rowIndex);
|
||||
if (row != null) {
|
||||
// 使用无参构造函数创建对象
|
||||
T entity = clazz.getDeclaredConstructor().newInstance();
|
||||
|
||||
// 读取指定范围内的列并通过Setter方法设置值
|
||||
for (int colIndex = startColumn, fieldIndex = 0;
|
||||
colIndex <= endColumn; colIndex++, fieldIndex++) {
|
||||
|
||||
Cell cell = row.getCell(colIndex);
|
||||
Field field = fields[fieldIndex];
|
||||
try {
|
||||
// 获取并转换单元格值
|
||||
Object value = getCellValueByType(cell, field.getType());
|
||||
|
||||
// 调用Setter方法设置值
|
||||
String setterName = "set" +
|
||||
field.getName().substring(0, 1).toUpperCase() +
|
||||
field.getName().substring(1);
|
||||
Method setter = clazz.getMethod(setterName, field.getType());
|
||||
setter.invoke(entity, value);
|
||||
} catch (Exception e) {
|
||||
// 增加详细的错误信息,方便调试
|
||||
throw new RuntimeException(
|
||||
String.format("行号: %d, 列号: %d, 字段名: %s, 字段类型: %s 赋值失败: %s",
|
||||
rowIndex + 1, colIndex + 1, field.getName(),
|
||||
field.getType().getSimpleName(), e.getMessage()),
|
||||
e
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
dataList.add(entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return dataList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 增强的类型转换方法,处理更多类型不匹配场景
|
||||
*/
|
||||
private static Object getCellValueByType(Cell cell, Class<?> fieldType) {
|
||||
if (cell == null) {
|
||||
return getDefaultValue(fieldType);
|
||||
}
|
||||
|
||||
CellType cellType = cell.getCellType();
|
||||
if (cellType == CellType.FORMULA) {
|
||||
cellType = cell.getCachedFormulaResultType();
|
||||
}
|
||||
|
||||
// 先获取原始值
|
||||
Object rawValue = getRawCellValue(cell, cellType);
|
||||
|
||||
// 如果已经匹配类型,直接返回
|
||||
if (rawValue == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 处理类型转换
|
||||
if (fieldType.isAssignableFrom(rawValue.getClass())) {
|
||||
return rawValue;
|
||||
}
|
||||
|
||||
// 字符串转其他类型
|
||||
if (rawValue instanceof String) {
|
||||
return convertFromString((String) rawValue, fieldType);
|
||||
}
|
||||
|
||||
// 数字转其他类型
|
||||
if (rawValue instanceof Number) {
|
||||
return convertFromNumber((Number) rawValue, fieldType);
|
||||
}
|
||||
|
||||
// 日期转其他类型
|
||||
if (rawValue instanceof Date) {
|
||||
return convertFromDate((Date) rawValue, fieldType);
|
||||
}
|
||||
|
||||
// 布尔值转其他类型
|
||||
if (rawValue instanceof Boolean) {
|
||||
return convertFromBoolean((Boolean) rawValue, fieldType);
|
||||
}
|
||||
|
||||
// 无法转换时返回字符串表示
|
||||
return rawValue.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取单元格原始值
|
||||
*/
|
||||
private static Object getRawCellValue(Cell cell, CellType cellType) {
|
||||
switch (cellType) {
|
||||
case STRING:
|
||||
return cell.getStringCellValue().trim();
|
||||
case NUMERIC:
|
||||
if (DateUtil.isCellDateFormatted(cell)) {
|
||||
return cell.getDateCellValue();
|
||||
} else {
|
||||
return cell.getNumericCellValue();
|
||||
}
|
||||
case BOOLEAN:
|
||||
return cell.getBooleanCellValue();
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 从字符串转换到目标类型
|
||||
*/
|
||||
private static Object convertFromString(String value, Class<?> targetType) {
|
||||
if (value.isEmpty()) {
|
||||
return getDefaultValue(targetType);
|
||||
}
|
||||
|
||||
try {
|
||||
if (targetType == Integer.class || targetType == int.class) {
|
||||
return Integer.parseInt(value);
|
||||
} else if (targetType == Long.class || targetType == long.class) {
|
||||
return Long.parseLong(value);
|
||||
} else if (targetType == Double.class || targetType == double.class) {
|
||||
return Double.parseDouble(value);
|
||||
} else if (targetType == Float.class || targetType == float.class) {
|
||||
return Float.parseFloat(value);
|
||||
} else if (targetType == BigDecimal.class) {
|
||||
return new BigDecimal(value);
|
||||
} else if (targetType == Boolean.class || targetType == boolean.class) {
|
||||
return "true".equalsIgnoreCase(value) || "1".equals(value);
|
||||
} else if (targetType == LocalDate.class) {
|
||||
// 支持多种日期格式
|
||||
String[] patterns = {"yyyy-MM-dd", "yyyy/MM/dd", "MM/dd/yyyy", "dd-MM-yyyy"};
|
||||
for (String pattern : patterns) {
|
||||
try {
|
||||
return LocalDate.parse(value, DateTimeFormatter.ofPattern(pattern, Locale.US));
|
||||
} catch (Exception e) {
|
||||
// 尝试下一种格式
|
||||
}
|
||||
}
|
||||
// 最后尝试默认格式
|
||||
return LocalDate.parse(value);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("无法将字符串 '" + value + "' 转换为 " + targetType.getSimpleName(), e);
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* 从数字转换到目标类型
|
||||
*/
|
||||
private static Object convertFromNumber(Number number, Class<?> targetType) {
|
||||
if (targetType == Integer.class || targetType == int.class) {
|
||||
return number.intValue();
|
||||
} else if (targetType == Long.class || targetType == long.class) {
|
||||
return number.longValue();
|
||||
} else if (targetType == Double.class || targetType == double.class) {
|
||||
return number.doubleValue();
|
||||
} else if (targetType == Float.class || targetType == float.class) {
|
||||
return number.floatValue();
|
||||
} else if (targetType == BigDecimal.class) {
|
||||
return BigDecimal.valueOf(number.doubleValue());
|
||||
} else if (targetType == String.class) {
|
||||
return number.toString();
|
||||
} else if (targetType == Boolean.class || targetType == boolean.class) {
|
||||
return number.doubleValue() != 0;
|
||||
}
|
||||
|
||||
return number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 从日期转换到目标类型
|
||||
*/
|
||||
private static Object convertFromDate(Date date, Class<?> targetType) {
|
||||
if (targetType == LocalDate.class) {
|
||||
return date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
||||
} else if (targetType == String.class) {
|
||||
return date.toString();
|
||||
}
|
||||
|
||||
return date;
|
||||
}
|
||||
|
||||
/**
|
||||
* 从布尔值转换到目标类型
|
||||
*/
|
||||
private static Object convertFromBoolean(Boolean bool, Class<?> targetType) {
|
||||
if (targetType == String.class) {
|
||||
return bool.toString();
|
||||
} else if (targetType == Integer.class || targetType == int.class) {
|
||||
return bool ? 1 : 0;
|
||||
}
|
||||
|
||||
return bool;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取字段类型的默认值
|
||||
*/
|
||||
private static Object getDefaultValue(Class<?> fieldType) {
|
||||
if (fieldType.isPrimitive()) {
|
||||
if (fieldType == boolean.class) return false;
|
||||
return 0;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,42 @@
|
||||
package org.dromara.common.utils.logistics;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 测试单表对象 test_demo
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2021-07-26
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
//@TableName("test_demo")
|
||||
public class LogisticsInquiryDemo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private String number;
|
||||
private String type;
|
||||
private List<LogisticsInquiryListDemo> list;
|
||||
private String deliverystatus;
|
||||
private String issign;
|
||||
private String expName;
|
||||
private String expSite;
|
||||
private String expPhone;
|
||||
private String logo;
|
||||
private String courier;
|
||||
private String courierPhone;
|
||||
private String updateTime;
|
||||
private String takeTime;
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package org.dromara.common.utils.logistics;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 测试单表对象 test_demo
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2021-07-26
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class LogisticsInquiryListDemo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private String time;
|
||||
private String status;
|
||||
}
|
@ -0,0 +1,90 @@
|
||||
package org.dromara.common.utils.logistics;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class LogisticsInquiryUtil {
|
||||
|
||||
/*
|
||||
* 读取返回结果
|
||||
*/
|
||||
private static String read(InputStream is) throws IOException {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
BufferedReader br = new BufferedReader(new InputStreamReader(is));
|
||||
String line = null;
|
||||
while ((line = br.readLine()) != null) {
|
||||
line = new String(line.getBytes(), "utf-8");
|
||||
sb.append(line);
|
||||
}
|
||||
br.close();
|
||||
return sb.toString();
|
||||
}
|
||||
public static LogisticsInquiryDemo aLiLogisticsInquiry(String orderNumber){
|
||||
String host = "https://wuliu.market.alicloudapi.com";// 【1】请求地址 支持http 和 https 及 WEBSOCKET
|
||||
String path = "/kdi"; // 【2】后缀
|
||||
String appcode = "9401b50f65304a4f8b6d083790f45658"; // 【3】开通服务后 买家中心-查看AppCode
|
||||
String no = orderNumber;// 【4】请求参数,详见文档描述
|
||||
String type = ""; // 【4】请求参数,不知道可不填 95%能自动识别
|
||||
String urlSend = host + path + "?no=" + no +"&type="+type; // 【5】拼接请求链接
|
||||
try {
|
||||
URL url = new URL(urlSend);
|
||||
HttpURLConnection httpURLCon = (HttpURLConnection) url.openConnection();
|
||||
httpURLCon .setRequestProperty("Authorization", "APPCODE " + appcode);// 格式Authorization:APPCODE (中间是英文空格)
|
||||
int httpCode = httpURLCon.getResponseCode();
|
||||
if (httpCode == 200) {
|
||||
String json = read(httpURLCon.getInputStream());
|
||||
JSONObject jsonObject = JSONUtil.parseObj(json);
|
||||
LogisticsInquiryDemo inquiryDemo = jsonObject.getBean("result", LogisticsInquiryDemo.class);
|
||||
// System.out.println("正常请求计费(其他均不计费)");
|
||||
// System.out.println("获取返回的json:");
|
||||
// System.out.println(json);
|
||||
// System.out.println(inquiryDemo1);
|
||||
return inquiryDemo;
|
||||
} else {
|
||||
Map<String, List<String>> map = httpURLCon.getHeaderFields();
|
||||
String error = map.get("X-Ca-Error-Message").get(0);
|
||||
if (httpCode == 400 && error.equals("Invalid AppCode `not exists`")) {
|
||||
System.out.println("AppCode错误 ");
|
||||
} else if (httpCode == 400 && error.equals("Invalid Url")) {
|
||||
System.out.println("请求的 Method、Path 或者环境错误");
|
||||
} else if (httpCode == 400 && error.equals("Invalid Param Location")) {
|
||||
System.out.println("参数错误");
|
||||
} else if (httpCode == 403 && error.equals("Unauthorized")) {
|
||||
System.out.println("服务未被授权(或URL和Path不正确)");
|
||||
} else if (httpCode == 403 && error.equals("Quota Exhausted")) {
|
||||
System.out.println("套餐包次数用完 ");
|
||||
} else if (httpCode == 403 && error.equals("Api Market Subscription quota exhausted")) {
|
||||
System.out.println("套餐包次数用完,请续购套餐");
|
||||
} else {
|
||||
System.out.println("参数名错误 或 其他错误");
|
||||
System.out.println(error);
|
||||
}
|
||||
}
|
||||
|
||||
} catch (MalformedURLException e) {
|
||||
System.out.println("URL格式错误");
|
||||
} catch (UnknownHostException e) {
|
||||
System.out.println("URL地址错误");
|
||||
} catch (Exception e) {
|
||||
// 打开注释查看详细报错异常信息
|
||||
// e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
// public static void main(String[] args) {
|
||||
// aLiLogisticsInquiry("434719283706463");
|
||||
// }
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user