init
This commit is contained in:
@@ -5,13 +5,9 @@ spring:
|
||||
datasource:
|
||||
druid:
|
||||
db-type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
||||
# url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.46.5}:${DB_PORT:3306}/${DB_NAME:hl_one_mes_test}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
# url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.46.5}:${DB_PORT:3306}/${DB_NAME:hl_one_mes}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
# url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.46.5}:${DB_PORT:3306}/${DB_NAME:hl_one_mes}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:hl_one_mes}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:hl_one_mes}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
username: ${DB_USER:root}
|
||||
# password: ${DB_PWD:123456}
|
||||
password: ${DB_PWD:942464Yy}
|
||||
|
||||
# 初始连接数
|
||||
|
||||
@@ -5,8 +5,8 @@ spring:
|
||||
datasource:
|
||||
druid:
|
||||
db-type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.46.5}:${DB_PORT:3306}/${DB_NAME:hl_one_lms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://${DB_HOST:192.168.46.5}:${DB_PORT:3306}/${DB_NAME:hl_one_lms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
# url: jdbc:log4jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:hl_one_mes}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
username: ${DB_USER:root}
|
||||
# password: ${DB_PWD:123456}
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
spring:
|
||||
freemarker:
|
||||
check-template-location: false
|
||||
profiles:
|
||||
active: dev3
|
||||
jackson:
|
||||
time-zone: GMT+8
|
||||
data:
|
||||
redis:
|
||||
repositories:
|
||||
enabled: false
|
||||
task:
|
||||
pool:
|
||||
# 核心线程池大小
|
||||
core-pool-size: 10
|
||||
# 最大线程数
|
||||
max-pool-size: 30
|
||||
# 活跃时间
|
||||
keep-alive-seconds: 60
|
||||
# 队列容量
|
||||
queue-capacity: 50
|
||||
# 主线程等待子线程执行时间
|
||||
awaitTerminationSeconds: 50
|
||||
|
||||
#七牛云
|
||||
qiniu:
|
||||
# 文件大小 /M
|
||||
max-size: 15
|
||||
|
||||
#邮箱验证码有效时间/秒
|
||||
code:
|
||||
expiration: 300
|
||||
|
||||
#密码加密传输,前端公钥加密,后端私钥解密
|
||||
rsa:
|
||||
private_key: MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEA0vfvyTdGJkdbHkB8mp0f3FE0GYP3AYPaJF7jUd1M0XxFSE2ceK3k2kw20YvQ09NJKk+OMjWQl9WitG9pB6tSCQIDAQABAkA2SimBrWC2/wvauBuYqjCFwLvYiRYqZKThUS3MZlebXJiLB+Ue/gUifAAKIg1avttUZsHBHrop4qfJCwAI0+YRAiEA+W3NK/RaXtnRqmoUUkb59zsZUBLpvZgQPfj1MhyHDz0CIQDYhsAhPJ3mgS64NbUZmGWuuNKp5coY2GIj/zYDMJp6vQIgUueLFXv/eZ1ekgz2Oi67MNCk5jeTF2BurZqNLR3MSmUCIFT3Q6uHMtsB9Eha4u7hS31tj1UWE+D+ADzp59MGnoftAiBeHT7gDMuqeJHPL4b+kC+gzV4FGTfhR9q3tTbklZkD2A==
|
||||
logging:
|
||||
file:
|
||||
path: C:\logs\nlwms\
|
||||
demo:
|
||||
monitor:
|
||||
server-url: https://www.demo-monitor.com
|
||||
username: MessiLoveRidingBike
|
||||
password: 123456
|
||||
security:
|
||||
# 排除路径
|
||||
excludes:
|
||||
# 认证
|
||||
- /auth/login
|
||||
- /auth/code
|
||||
- /auth/logout
|
||||
- /webjars/**
|
||||
- /file/**
|
||||
- /webSocket/**
|
||||
# 静态资源
|
||||
- /*.html
|
||||
- /**/*.html
|
||||
- /**/*.css
|
||||
- /**/*.js
|
||||
- /favicon.ico
|
||||
- /*/api-docs
|
||||
- /*/api-docs/**
|
||||
# druid 监控配置
|
||||
- /druid/**
|
||||
# actuator 监控配置
|
||||
- /actuator
|
||||
- /actuator/**
|
||||
# 上传
|
||||
- /api/localStorage/pictures
|
||||
# 参数
|
||||
- /api/param/getValueByCode
|
||||
- /plumelog/**
|
||||
- /api/esLog/**
|
||||
- /api/users
|
||||
mybatis-plus:
|
||||
configuration:
|
||||
map-underscore-to-camel-case: false
|
||||
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
mapper-locations: classpath:/org/nl/**/mapper/**/*.xml
|
||||
global-config:
|
||||
db-config:
|
||||
id-type: INPUT
|
||||
banner: false
|
||||
feishu: https://open.feishu.cn/open-apis/bot/v2/hook/cfe495f7-9bcd-40bb-ab66-038de2131cac
|
||||
lucene:
|
||||
index:
|
||||
path: E:\lms\lucene\index
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,27 @@
|
||||
import com.alibaba.fastjson.JSONObject
|
||||
import org.nl.wms.product_manage.service.device.dao.PdmBiDevice
|
||||
|
||||
def getPoints(List<PdmBiDevice> devices, Map<String, List<PdmBiDevice>> materialCollent, Double inupperlimitQty){
|
||||
|
||||
PdmBiDevice device = devices.get(0)
|
||||
String materialId = device.getMaterial_id();
|
||||
List<PdmBiDevice> collect = materialCollent.get(materialId);
|
||||
Double qty = 0.0;
|
||||
def list = new ArrayList<>();
|
||||
for (PdmBiDevice o1 : collect) {
|
||||
if (qty>inupperlimitQty){
|
||||
return list;
|
||||
}
|
||||
def item = new JSONObject()
|
||||
item.put("device_code",o1.getDevice_code())
|
||||
item.put("qty",o1.getDeviceinstor_qty());
|
||||
item.put("weight",o1.getDeviceinstor_weight().doubleValue());
|
||||
item.put("material_id",materialId);
|
||||
list.add(item);
|
||||
if (o1.getIs_artificial()){
|
||||
return list;
|
||||
}
|
||||
qty = qty+o1.getDeviceinstor_qty();
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
# If you use SLF4J. First, you need to tell log4jdbc-log4j2 that you want to use the SLF4J logger
|
||||
log4jdbc.spylogdelegator.name=net.sf.log4jdbc.log.slf4j.Slf4jSpyLogDelegator
|
||||
log4jdbc.auto.load.popular.drivers=false
|
||||
log4jdbc.drivers=com.mysql.cj.jdbc.Driver
|
||||
159
wms_pro/hd/nladmin-system/src/main/resources/logback-spring.xml
Normal file
159
wms_pro/hd/nladmin-system/src/main/resources/logback-spring.xml
Normal file
@@ -0,0 +1,159 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<configuration scan="true" scanPeriod="30 seconds" debug="false">
|
||||
<contextName>nlAdmin</contextName>
|
||||
<property name="log.charset" value="utf-8"/>
|
||||
<property name="log.pattern"
|
||||
value="%black(%contextName-) %red(%d{yyyy-MM-dd HH:mm:ss.SSS}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{36}) - %gray(%msg%n)"/>
|
||||
<property name="LOG_HOME" value="${logPath}"/>
|
||||
|
||||
|
||||
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<!-- 控制台高亮-->
|
||||
<withJansi>true</withJansi>
|
||||
<encoder class="com.yomahub.tlog.core.enhance.logback.AspectLogbackEncoder">
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
<!--定义日志文件的存储地址 勿在 LogBack 的配置中使用相对路径-->
|
||||
<!-- 按照每天生成日志文件 -->
|
||||
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--日志文件输出的文件名-->
|
||||
<FileNamePattern>${LOG_HOME}/%d{yyyy-MM-dd}.%i.log</FileNamePattern>
|
||||
<!--日志文件保留天数-->
|
||||
<maxHistory>15</maxHistory>
|
||||
<!--单个日志最大容量 至少10MB才能看得出来-->
|
||||
<maxFileSize>100MB</maxFileSize>
|
||||
<!--所有日志最多占多大容量-->
|
||||
<totalSizeCap>20GB</totalSizeCap>
|
||||
</rollingPolicy>
|
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
|
||||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
<!--异步到文件-->
|
||||
<appender name="asyncFileAppender" class="com.yomahub.tlog.core.enhance.logback.async.AspectLogbackAsyncAppender">
|
||||
<discardingThreshold>2</discardingThreshold>
|
||||
<queueSize>500</queueSize>
|
||||
<appender-ref ref="FILE"/>
|
||||
</appender>
|
||||
<appender name="luceneAppender" class="org.nl.config.lucene.LuceneAppender" >
|
||||
<properties>
|
||||
<property>
|
||||
<name>system</name>
|
||||
<value>lms</value>
|
||||
</property>
|
||||
<property>
|
||||
<name>logLevel</name>
|
||||
<value>%level</value>
|
||||
</property>
|
||||
<property>
|
||||
<name>requestMethod</name>
|
||||
<value>%X{requestMethod}</value>
|
||||
</property>
|
||||
<property>
|
||||
<name>requestTime</name>
|
||||
<value>%d{yyyy-MM-dd HH:mm:ss.SSS}</value>
|
||||
</property>
|
||||
<property>
|
||||
<name>requestIp</name>
|
||||
<value>%X{requestIp}</value>
|
||||
</property>
|
||||
<property>
|
||||
<name>thread</name>
|
||||
<value>%thread</value>
|
||||
</property>
|
||||
<property>
|
||||
<name>logger</name>
|
||||
<value>%logger</value>
|
||||
</property>
|
||||
</properties>
|
||||
</appender>
|
||||
<appender name="asyncLuceneAppender" class="org.nl.config.lucene.AsyncLuceneAppender">
|
||||
<appender-ref ref="luceneAppender" />
|
||||
<queueSize>512</queueSize>
|
||||
</appender>
|
||||
|
||||
<!--开发环境:打印控制台-->
|
||||
<springProfile name="dev">
|
||||
<root level="debug">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</root>
|
||||
<logger name="jdbc" level="ERROR" additivity="true">
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
</logger>
|
||||
<logger name="org.springframework" level="ERROR" additivity="true">
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
</logger>
|
||||
<logger name="org.hibernate" level="ERROR" additivity="true">
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
</logger>
|
||||
<logger name="org.quartz" level="ERROR" additivity="true">
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
</logger>
|
||||
<logger name="com.google" level="ERROR" additivity="true">
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
</logger>
|
||||
<logger name="org.redisson" level="ERROR" additivity="true">
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
</logger>
|
||||
<logger name="org.nl.modules.wql" level="ERROR" additivity="true">
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
</logger>
|
||||
<logger name="org.springframework.data" level="ERROR" additivity="true">
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
</logger>
|
||||
</springProfile>
|
||||
|
||||
<springProfile name="dev3">
|
||||
<root level="info">
|
||||
<appender-ref ref="asyncLuceneAppender"/>
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</root>
|
||||
</springProfile>
|
||||
<springProfile name="prod">
|
||||
<root level="info">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
<appender-ref ref="asyncLuceneAppender"/>
|
||||
</root>
|
||||
<logger name="jdbc" level="ERROR" additivity="true">
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
</logger>
|
||||
<logger name="org.springframework" level="ERROR" additivity="true">
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
</logger>
|
||||
<logger name="org.hibernate" level="ERROR" additivity="true">
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
</logger>
|
||||
<logger name="org.quartz" level="ERROR" additivity="true">
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
</logger>
|
||||
<logger name="com.google" level="ERROR" additivity="true">
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
</logger>
|
||||
<logger name="org.redisson" level="ERROR" additivity="true">
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
</logger>
|
||||
<logger name="org.nl.modules.wql" level="ERROR" additivity="true">
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
</logger>
|
||||
<logger name="org.springframework.data" level="ERROR" additivity="true">
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
</logger>
|
||||
</springProfile>
|
||||
<!--测试环境:打印控制台-->
|
||||
<springProfile name="test">
|
||||
<!-- 打印sql -->
|
||||
<logger name="org.nl.start.Init" level="info" additivity="false">
|
||||
<appender-ref ref="FILE"/>
|
||||
</logger>
|
||||
<root level="info">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</root>
|
||||
</springProfile>
|
||||
|
||||
<!--生产环境:打印控制台和输出到文件-->
|
||||
|
||||
</configuration>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,24 +0,0 @@
|
||||
--设备初始化--
|
||||
INSERT INTO `hl_one_mes`.`pdm_bi_device`(`device_code`, `device_name`, `product_area`, `workprocedure_id`, `ext_code`, `material_id`, `workorder_code`, `device_code2`, `inupperlimit_qty`, `inlowerlimit_qty`, `outupperlimit_qty`, `outlowerlimit_qty`, `deviceinitinstor_qty`, `deviceinstor_qty`, `deviceinstor_weight`, `deviceoutstor_qty`, `is_artificial`, `remark`, `cacheLine_code`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`, `is_delete`, `is_used`, `device_icon`, `spec`, `aps_device_code`, `product_series`) VALUES ('A3_KZBZ_01', '三线刻字包装机01号', 'A3', '1689437952540807169', NULL, NULL, NULL, NULL, 1111, 1111, 1111, 1111, 1111, 1111, 0.000, 1111, 0, NULL, NULL, '1', '管理员', '2023-08-11 13:40:57', NULL, NULL, NULL, 0, 1, NULL, NULL, NULL, NULL);
|
||||
INSERT INTO `hl_one_mes`.`pdm_bi_device`(`device_code`, `device_name`, `product_area`, `workprocedure_id`, `ext_code`, `material_id`, `workorder_code`, `device_code2`, `inupperlimit_qty`, `inlowerlimit_qty`, `outupperlimit_qty`, `outlowerlimit_qty`, `deviceinitinstor_qty`, `deviceinstor_qty`, `deviceinstor_weight`, `deviceoutstor_qty`, `is_artificial`, `remark`, `cacheLine_code`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`, `is_delete`, `is_used`, `device_icon`, `spec`, `aps_device_code`, `product_series`) VALUES ('A3_KZBZ_02', '三线刻字包装机02号', 'A3', '1689437952540807169', NULL, NULL, NULL, NULL, 1111, 1111, 1111, 1111, 1111, 1111, 0.000, 1111, 0, NULL, NULL, '1', '管理员', '2023-08-11 13:40:57', NULL, NULL, NULL, 0, 1, NULL, NULL, NULL, NULL);
|
||||
INSERT INTO `hl_one_mes`.`pdm_bi_device`(`device_code`, `device_name`, `product_area`, `workprocedure_id`, `ext_code`, `material_id`, `workorder_code`, `device_code2`, `inupperlimit_qty`, `inlowerlimit_qty`, `outupperlimit_qty`, `outlowerlimit_qty`, `deviceinitinstor_qty`, `deviceinstor_qty`, `deviceinstor_weight`, `deviceoutstor_qty`, `is_artificial`, `remark`, `cacheLine_code`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`, `is_delete`, `is_used`, `device_icon`, `spec`, `aps_device_code`, `product_series`) VALUES ('A3_KZBZ_03', '三线刻字包装机03号', 'A3', '1689437952540807169', NULL, NULL, NULL, NULL, 1111, 1111, 1111, 1111, 1111, 1111, 0.000, 1111, 0, NULL, NULL, '1', '管理员', '2023-08-11 13:40:57', NULL, NULL, NULL, 0, 1, NULL, NULL, NULL, NULL);
|
||||
INSERT INTO `hl_one_mes`.`pdm_bi_device`(`device_code`, `device_name`, `product_area`, `workprocedure_id`, `ext_code`, `material_id`, `workorder_code`, `device_code2`, `inupperlimit_qty`, `inlowerlimit_qty`, `outupperlimit_qty`, `outlowerlimit_qty`, `deviceinitinstor_qty`, `deviceinstor_qty`, `deviceinstor_weight`, `deviceoutstor_qty`, `is_artificial`, `remark`, `cacheLine_code`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`, `is_delete`, `is_used`, `device_icon`, `spec`, `aps_device_code`, `product_series`) VALUES ('A3_KZBZ_04', '三线刻字包装机04号', 'A3', '1689437952540807169', NULL, NULL, NULL, NULL, 1111, 1111, 1111, 1111, 1111, 1111, 0.000, 1111, 0, NULL, NULL, '1', '管理员', '2023-08-11 13:40:57', NULL, NULL, NULL, 0, 1, NULL, NULL, NULL, NULL);
|
||||
INSERT INTO `hl_one_mes`.`pdm_bi_device`(`device_code`, `device_name`, `product_area`, `workprocedure_id`, `ext_code`, `material_id`, `workorder_code`, `device_code2`, `inupperlimit_qty`, `inlowerlimit_qty`, `outupperlimit_qty`, `outlowerlimit_qty`, `deviceinitinstor_qty`, `deviceinstor_qty`, `deviceinstor_weight`, `deviceoutstor_qty`, `is_artificial`, `remark`, `cacheLine_code`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`, `is_delete`, `is_used`, `device_icon`, `spec`, `aps_device_code`, `product_series`) VALUES ('A3_KZBZ_05', '三线刻字包装机05号', 'A3', '1689437952540807169', NULL, NULL, NULL, NULL, 1111, 1111, 1111, 1111, 1111, 1111, 0.000, 1111, 0, NULL, NULL, '1', '管理员', '2023-08-11 13:40:57', NULL, NULL, NULL, 0, 1, NULL, NULL, NULL, NULL);
|
||||
INSERT INTO `hl_one_mes`.`pdm_bi_device`(`device_code`, `device_name`, `product_area`, `workprocedure_id`, `ext_code`, `material_id`, `workorder_code`, `device_code2`, `inupperlimit_qty`, `inlowerlimit_qty`, `outupperlimit_qty`, `outlowerlimit_qty`, `deviceinitinstor_qty`, `deviceinstor_qty`, `deviceinstor_weight`, `deviceoutstor_qty`, `is_artificial`, `remark`, `cacheLine_code`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`, `is_delete`, `is_used`, `device_icon`, `spec`, `aps_device_code`, `product_series`) VALUES ('A3_KZBZ_06', '三线刻字包装机06号', 'A3', '1689437952540807169', NULL, NULL, NULL, NULL, 1111, 1111, 1111, 1111, 1111, 1111, 0.000, 1111, 0, NULL, NULL, '1', '管理员', '2023-08-11 13:40:57', NULL, NULL, NULL, 0, 1, NULL, NULL, NULL, NULL);
|
||||
INSERT INTO `hl_one_mes`.`pdm_bi_device`(`device_code`, `device_name`, `product_area`, `workprocedure_id`, `ext_code`, `material_id`, `workorder_code`, `device_code2`, `inupperlimit_qty`, `inlowerlimit_qty`, `outupperlimit_qty`, `outlowerlimit_qty`, `deviceinitinstor_qty`, `deviceinstor_qty`, `deviceinstor_weight`, `deviceoutstor_qty`, `is_artificial`, `remark`, `cacheLine_code`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`, `is_delete`, `is_used`, `device_icon`, `spec`, `aps_device_code`, `product_series`) VALUES ('A3_KZBZ_07', '三线刻字包装机07号', 'A3', '1689437952540807169', NULL, NULL, NULL, NULL, 1111, 1111, 1111, 1111, 1111, 1111, 0.000, 1111, 0, NULL, NULL, '1', '管理员', '2023-08-11 13:40:57', NULL, NULL, NULL, 0, 1, NULL, NULL, NULL, NULL);
|
||||
INSERT INTO `hl_one_mes`.`pdm_bi_device`(`device_code`, `device_name`, `product_area`, `workprocedure_id`, `ext_code`, `material_id`, `workorder_code`, `device_code2`, `inupperlimit_qty`, `inlowerlimit_qty`, `outupperlimit_qty`, `outlowerlimit_qty`, `deviceinitinstor_qty`, `deviceinstor_qty`, `deviceinstor_weight`, `deviceoutstor_qty`, `is_artificial`, `remark`, `cacheLine_code`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`, `is_delete`, `is_used`, `device_icon`, `spec`, `aps_device_code`, `product_series`) VALUES ('A3_KZBZ_08', '三线刻字包装机08号', 'A3', '1689437952540807169', NULL, NULL, NULL, NULL, 1111, 1111, 1111, 1111, 1111, 1111, 0.000, 1111, 0, NULL, NULL, '1', '管理员', '2023-08-11 13:40:57', NULL, NULL, NULL, 0, 1, NULL, NULL, NULL, NULL);
|
||||
INSERT INTO `hl_one_mes`.`pdm_bi_device`(`device_code`, `device_name`, `product_area`, `workprocedure_id`, `ext_code`, `material_id`, `workorder_code`, `device_code2`, `inupperlimit_qty`, `inlowerlimit_qty`, `outupperlimit_qty`, `outlowerlimit_qty`, `deviceinitinstor_qty`, `deviceinstor_qty`, `deviceinstor_weight`, `deviceoutstor_qty`, `is_artificial`, `remark`, `cacheLine_code`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`, `is_delete`, `is_used`, `device_icon`, `spec`, `aps_device_code`, `product_series`) VALUES ('A3_KZBZ_09', '三线刻字包装机09号', 'A3', '1689437952540807169', NULL, NULL, NULL, NULL, 1111, 1111, 1111, 1111, 1111, 1111, 0.000, 1111, 0, NULL, NULL, '1', '管理员', '2023-08-11 13:40:57', NULL, NULL, NULL, 0, 1, NULL, NULL, NULL, NULL);
|
||||
INSERT INTO `hl_one_mes`.`pdm_bi_device`(`device_code`, `device_name`, `product_area`, `workprocedure_id`, `ext_code`, `material_id`, `workorder_code`, `device_code2`, `inupperlimit_qty`, `inlowerlimit_qty`, `outupperlimit_qty`, `outlowerlimit_qty`, `deviceinitinstor_qty`, `deviceinstor_qty`, `deviceinstor_weight`, `deviceoutstor_qty`, `is_artificial`, `remark`, `cacheLine_code`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`, `is_delete`, `is_used`, `device_icon`, `spec`, `aps_device_code`, `product_series`) VALUES ('A3_KZBZ_10', '三线刻字包装机10号', 'A3', '1689437952540807169', NULL, NULL, NULL, NULL, 1111, 1111, 1111, 1111, 1111, 1111, 0.000, 1111, 0, NULL, NULL, '1', '管理员', '2023-08-11 13:40:57', NULL, NULL, NULL, 0, 1, NULL, NULL, NULL, NULL);
|
||||
INSERT INTO `hl_one_mes`.`pdm_bi_device`(`device_code`, `device_name`, `product_area`, `workprocedure_id`, `ext_code`, `material_id`, `workorder_code`, `device_code2`, `inupperlimit_qty`, `inlowerlimit_qty`, `outupperlimit_qty`, `outlowerlimit_qty`, `deviceinitinstor_qty`, `deviceinstor_qty`, `deviceinstor_weight`, `deviceoutstor_qty`, `is_artificial`, `remark`, `cacheLine_code`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`, `is_delete`, `is_used`, `device_icon`, `spec`, `aps_device_code`, `product_series`) VALUES ('A3_KZBZ_11', '三线刻字包装机11号', 'A3', '1689437952540807169', NULL, NULL, NULL, NULL, 1111, 1111, 1111, 1111, 1111, 1111, 0.000, 1111, 0, NULL, NULL, '1', '管理员', '2023-08-11 13:40:57', NULL, NULL, NULL, 0, 1, NULL, NULL, NULL, NULL);
|
||||
INSERT INTO `hl_one_mes`.`pdm_bi_device`(`device_code`, `device_name`, `product_area`, `workprocedure_id`, `ext_code`, `material_id`, `workorder_code`, `device_code2`, `inupperlimit_qty`, `inlowerlimit_qty`, `outupperlimit_qty`, `outlowerlimit_qty`, `deviceinitinstor_qty`, `deviceinstor_qty`, `deviceinstor_weight`, `deviceoutstor_qty`, `is_artificial`, `remark`, `cacheLine_code`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`, `is_delete`, `is_used`, `device_icon`, `spec`, `aps_device_code`, `product_series`) VALUES ('A3_KZBZ_12', '三线刻字包装机12号', 'A3', '1689437952540807169', NULL, NULL, NULL, NULL, 1111, 1111, 1111, 1111, 1111, 1111, 0.000, 1111, 0, NULL, NULL, '1', '管理员', '2023-08-11 13:40:57', NULL, NULL, NULL, 0, 1, NULL, NULL, NULL, NULL);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
1242
wms_pro/hd/nladmin-system/src/main/resources/stopword.dic
Normal file
1242
wms_pro/hd/nladmin-system/src/main/resources/stopword.dic
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,48 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<style>
|
||||
@page {
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body style="margin: 0px;
|
||||
padding: 0px;
|
||||
font: 100% SimSun, Microsoft YaHei, Times New Roman, Verdana, Arial, Helvetica, sans-serif;
|
||||
color: #000;">
|
||||
<div style="height: auto;
|
||||
width: 820px;
|
||||
min-width: 820px;
|
||||
margin: 0 auto;
|
||||
margin-top: 20px;
|
||||
border: 1px solid #eee;">
|
||||
<div style="padding: 10px;padding-bottom: 0px;">
|
||||
<p style="margin-bottom: 10px;padding-bottom: 0px;">尊敬的用户,您好:</p>
|
||||
<p style="text-indent: 2em; margin-bottom: 10px;">您正在申请邮箱验证,您的验证码为:</p>
|
||||
<p style="text-align: center;
|
||||
font-family: Times New Roman;
|
||||
font-size: 22px;
|
||||
color: #C60024;
|
||||
padding: 20px 0px;
|
||||
margin-bottom: 10px;
|
||||
font-weight: bold;
|
||||
background: #ebebeb;">${code}</p>
|
||||
<div class="foot-hr hr" style="margin: 0 auto;
|
||||
z-index: 111;
|
||||
width: 800px;
|
||||
margin-top: 30px;
|
||||
border-top: 1px solid #DA251D;">
|
||||
</div>
|
||||
<div style="text-align: center;
|
||||
font-size: 12px;
|
||||
padding: 20px 0px;
|
||||
font-family: Microsoft YaHei;">
|
||||
Copyright ©${.now?string("yyyy")} <a hover="color: #DA251D;" style="color: #999;" href="https://github.com/elunez/eladmin" target="_blank">EL-ADMIN</a> 后台管理系统 All Rights Reserved.
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,66 @@
|
||||
package ${package}.rest;
|
||||
|
||||
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.anno.Log;
|
||||
import ${package}.service.${className}Service;
|
||||
import ${package}.service.dto.${className}Dto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author ${author}
|
||||
* @date ${date}
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
|
||||
@RequestMapping("/api/${changeClassName}")
|
||||
@Slf4j
|
||||
public class ${className}Controller {
|
||||
|
||||
private final ${className}Service ${changeClassName}Service;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询${apiAlias}")
|
||||
//("查询${apiAlias}")
|
||||
//@PreAuthorize("@el.check('${changeClassName}:list')")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page){
|
||||
return new ResponseEntity<>(${changeClassName}Service.queryAll(whereJson,page),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增${apiAlias}")
|
||||
//("新增${apiAlias}")
|
||||
//@PreAuthorize("@el.check('${changeClassName}:add')")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody ${className}Dto dto){
|
||||
${changeClassName}Service.create(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改${apiAlias}")
|
||||
//("修改${apiAlias}")
|
||||
//@PreAuthorize("@el.check('${changeClassName}:edit')")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody ${className}Dto dto){
|
||||
${changeClassName}Service.update(dto);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("删除${apiAlias}")
|
||||
//("删除${apiAlias}")
|
||||
//@PreAuthorize("@el.check('${changeClassName}:del')")
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody ${pkColumnType}[] ids) {
|
||||
${changeClassName}Service.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package ${package}.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
<#if hasTimestamp>
|
||||
import java.sql.Timestamp;
|
||||
</#if>
|
||||
<#if hasBigDecimal>
|
||||
import java.math.BigDecimal;
|
||||
</#if>
|
||||
import java.io.Serializable;
|
||||
<#if !auto && pkColumnType = 'Long'>
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
</#if>
|
||||
|
||||
/**
|
||||
* @description /
|
||||
* @author ${author}
|
||||
* @date ${date}
|
||||
**/
|
||||
@Data
|
||||
public class ${className}Dto implements Serializable {
|
||||
<#if columns??>
|
||||
<#list columns as column>
|
||||
|
||||
<#if column.remark != ''>
|
||||
/** ${column.remark} */
|
||||
</#if>
|
||||
<#if column.columnKey = 'PRI'>
|
||||
<#if !auto && pkColumnType = 'Long'>
|
||||
/** 防止精度丢失 */
|
||||
@JsonSerialize(using= ToStringSerializer.class)
|
||||
</#if>
|
||||
</#if>
|
||||
private ${column.columnType} ${column.changeColumnName};
|
||||
</#list>
|
||||
</#if>
|
||||
}
|
||||
@@ -44,9 +44,9 @@ public class ${className} implements Serializable {
|
||||
@Column(name = "${column.columnName}"<#if column.columnKey = 'UNI'>,unique = true</#if><#if column.istNotNull && column.columnKey != 'PRI'>,nullable = false</#if>)
|
||||
<#if column.istNotNull && column.columnKey != 'PRI'>
|
||||
<#if column.columnType = 'String'>
|
||||
@NotBlank
|
||||
|
||||
<#else>
|
||||
@NotNull
|
||||
|
||||
</#if>
|
||||
</#if>
|
||||
<#if (column.dateAnnotation)?? && column.dateAnnotation != ''>
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package ${package}.service.mapstruct;
|
||||
|
||||
import BaseMapper;
|
||||
import ${package}.domain.${className};
|
||||
import ${package}.service.dto.${className}Dto;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.ReportingPolicy;
|
||||
|
||||
/**
|
||||
* @website https://el-admin.vip
|
||||
* @author ${author}
|
||||
* @date ${date}
|
||||
**/
|
||||
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
|
||||
public interface ${className}Mapper extends BaseMapper<${className}Dto, ${className}> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
|
||||
package ${package}.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
|
||||
<#if queryHasTimestamp>
|
||||
import java.sql.Timestamp;
|
||||
</#if>
|
||||
<#if queryHasBigDecimal>
|
||||
import java.math.BigDecimal;
|
||||
</#if>
|
||||
<#if betweens??>
|
||||
import java.util.List;
|
||||
</#if>
|
||||
<#if queryColumns??>
|
||||
import Query;
|
||||
</#if>
|
||||
|
||||
/**
|
||||
* @author ${author}
|
||||
* @date ${date}
|
||||
**/
|
||||
@Data
|
||||
public class ${className}QueryCriteria{
|
||||
<#if queryColumns??>
|
||||
<#list queryColumns as column>
|
||||
|
||||
<#if column.queryType = '='>
|
||||
/** 精确 */
|
||||
@Query
|
||||
private ${column.columnType} ${column.changeColumnName};
|
||||
</#if>
|
||||
<#if column.queryType = 'Like'>
|
||||
/** 模糊 */
|
||||
@Query(type = Query.Type.INNER_LIKE)
|
||||
private ${column.columnType} ${column.changeColumnName};
|
||||
</#if>
|
||||
<#if column.queryType = '!='>
|
||||
/** 不等于 */
|
||||
@Query(type = Query.Type.NOT_EQUAL)
|
||||
private ${column.columnType} ${column.changeColumnName};
|
||||
</#if>
|
||||
<#if column.queryType = 'NotNull'>
|
||||
/** 不为空 */
|
||||
@Query(type = Query.Type.NOT_NULL)
|
||||
private ${column.columnType} ${column.changeColumnName};
|
||||
</#if>
|
||||
<#if column.queryType = '>='>
|
||||
/** 大于等于 */
|
||||
@Query(type = Query.Type.GREATER_THAN)
|
||||
private ${column.columnType} ${column.changeColumnName};
|
||||
</#if>
|
||||
<#if column.queryType = '<='>
|
||||
/** 小于等于 */
|
||||
@Query(type = Query.Type.LESS_THAN)
|
||||
private ${column.columnType} ${column.changeColumnName};
|
||||
</#if>
|
||||
</#list>
|
||||
</#if>
|
||||
<#if betweens??>
|
||||
<#list betweens as column>
|
||||
/** BETWEEN */
|
||||
@Query(type = Query.Type.BETWEEN)
|
||||
private List<${column.columnType}> ${column.changeColumnName};
|
||||
</#list>
|
||||
</#if>
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
|
||||
package ${package}.repository;
|
||||
|
||||
import ${package}.domain.${className};
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
/**
|
||||
* @author ${author}
|
||||
* @date ${date}
|
||||
**/
|
||||
public interface ${className}Repository extends JpaRepository<${className}, ${pkColumnType}>, JpaSpecificationExecutor<${className}> {
|
||||
<#if columns??>
|
||||
<#list columns as column>
|
||||
<#if column.columnKey = 'UNI'>
|
||||
/**
|
||||
* 根据 ${column.capitalColumnName} 查询
|
||||
* @param ${column.columnName} /
|
||||
* @return /
|
||||
*/
|
||||
${className} findBy${column.capitalColumnName}(${column.columnType} ${column.columnName});
|
||||
</#if>
|
||||
</#list>
|
||||
</#if>
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package ${package}.service;
|
||||
|
||||
import ${package}.service.dto.${className}Dto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 服务接口
|
||||
* @author ${author}
|
||||
* @date ${date}
|
||||
**/
|
||||
public interface ${className}Service {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
* @param whereJson 条件
|
||||
* @param page 分页参数
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
Map<String,Object> queryAll(Map whereJson, Pageable page);
|
||||
|
||||
/**
|
||||
* 查询所有数据不分页
|
||||
* @param whereJson 条件参数
|
||||
* @return List<${className}Dto>
|
||||
*/
|
||||
List<${className}Dto> queryAll(Map whereJson);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
* @param ${pkChangeColName} ID
|
||||
* @return ${className}
|
||||
*/
|
||||
${className}Dto findById(${pkColumnType} ${pkChangeColName});
|
||||
|
||||
/**
|
||||
* 根据编码查询
|
||||
* @param code code
|
||||
* @return ${className}
|
||||
*/
|
||||
${className}Dto findByCode(String code);
|
||||
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param dto /
|
||||
*/
|
||||
void create(${className}Dto dto);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param dto /
|
||||
*/
|
||||
void update(${className}Dto dto);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(${pkColumnType}[] ids);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
package ${package}.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import org.nl.modules.wql.core.bean.ResultBean;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.WqlUtil;
|
||||
import ${package}.service.${className}Service;
|
||||
import ${package}.service.dto.${className}Dto;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
|
||||
/**
|
||||
* @description 服务实现
|
||||
* @author ${author}
|
||||
* @date ${date}
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class ${className}ServiceImpl implements ${className}Service {
|
||||
|
||||
@Override
|
||||
public Map<String,Object> queryAll(Map whereJson, Pageable page){
|
||||
WQLObject wo = WQLObject.getWQLObject("${tableName}");
|
||||
ResultBean rb = wo.pagequery(WqlUtil.getHttpContext(page), "1=1", "update_time desc");
|
||||
final JSONObject json = rb.pageResult();
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<${className}Dto> queryAll(Map whereJson){
|
||||
WQLObject wo = WQLObject.getWQLObject("${tableName}");
|
||||
JSONArray arr = wo.query().getResultJSONArray(0);
|
||||
if (ObjectUtil.isNotEmpty(arr)) return arr.toJavaList(${className}Dto.class);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ${className}Dto findById(${pkColumnType} ${pkChangeColName}) {
|
||||
WQLObject wo = WQLObject.getWQLObject("${tableName}");
|
||||
JSONObject json = wo.query("${pkChangeColName} = '" + ${pkChangeColName} + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(json)){
|
||||
return json.toJavaObject( ${className}Dto.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ${className}Dto findByCode(String code) {
|
||||
WQLObject wo = WQLObject.getWQLObject("${tableName}");
|
||||
JSONObject json = wo.query("code ='" + code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(json)){
|
||||
return json.toJavaObject( ${className}Dto.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create(${className}Dto dto) {
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
|
||||
dto.set${pkChangeColName ? cap_first }(IdUtil.getSnowflake(1, 1).nextId());
|
||||
dto.setCreate_id(currentUserId);
|
||||
dto.setCreate_name(nickName);
|
||||
dto.setUpdate_id(currentUserId);
|
||||
dto.setUpdate_name(nickName);
|
||||
dto.setUpdate_time(DateUtil.now());
|
||||
dto.setCreate_time(DateUtil.now());
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("${tableName}");
|
||||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||
wo.insert(json);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(${className}Dto dto) {
|
||||
${className}Dto entity = this.findById(dto.get${pkChangeColName ? cap_first }());
|
||||
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
|
||||
|
||||
dto.setUpdate_time(DateUtil.now());
|
||||
dto.setUpdate_id(currentUserId);
|
||||
dto.setUpdate_name(nickName);
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("${tableName}");
|
||||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||
wo.update(json);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteAll(${pkColumnType}[] ids) {
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("${tableName}");
|
||||
for (${pkColumnType} ${pkChangeColName}: ids) {
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("${pkChangeColName}", String.valueOf(${pkChangeColName}));
|
||||
param.put("is_delete", "1");
|
||||
param.put("update_optid", currentUserId);
|
||||
param.put("update_optname", nickName);
|
||||
param.put("update_time", DateUtil.now());
|
||||
wo.update(param);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,177 @@
|
||||
<#--noinspection ALL-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<#if hasQuery>
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<#if queryColumns??>
|
||||
<#list queryColumns as column>
|
||||
<#if column.queryType != 'BetWeen'>
|
||||
<label class="el-form-item-label"><#if column.remark != ''>${column.remark}<#else>${column.changeColumnName}</#if></label>
|
||||
<el-input v-model="query.${column.changeColumnName}" clearable placeholder="<#if column.remark != ''>${column.remark}<#else>${column.changeColumnName}</#if>" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||||
</#if>
|
||||
</#list>
|
||||
</#if>
|
||||
<#if betweens??>
|
||||
<#list betweens as column>
|
||||
<#if column.queryType = 'BetWeen'>
|
||||
<date-range-picker
|
||||
v-model="query.${column.changeColumnName}"
|
||||
start-placeholder="${column.changeColumnName}Start"
|
||||
end-placeholder="${column.changeColumnName}Start"
|
||||
class="date-item"
|
||||
/>
|
||||
</#if>
|
||||
</#list>
|
||||
</#if>
|
||||
<rrOperation :crud="crud" />
|
||||
</div>
|
||||
</#if>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px">
|
||||
<el-form ref="form" :model="form" <#if isNotNullColumns??>:rules="rules"</#if> size="mini" label-width="80px">
|
||||
<#if columns??>
|
||||
<#list columns as column>
|
||||
<#if column.formShow>
|
||||
<el-form-item label="<#if column.remark != ''>${column.remark}<#else>${column.changeColumnName}</#if>"<#if column.istNotNull> prop="${column.changeColumnName}"</#if>>
|
||||
<#if column.formType = 'Input'>
|
||||
<el-input v-model="form.${column.changeColumnName}" style="width: 370px;" />
|
||||
<#elseif column.formType = 'Textarea'>
|
||||
<el-input v-model="form.${column.changeColumnName}" :rows="3" type="textarea" style="width: 370px;" />
|
||||
<#elseif column.formType = 'Radio'>
|
||||
<#if (column.dictName)?? && (column.dictName)!="">
|
||||
<el-radio v-model="form.${column.changeColumnName}" v-for="item in dict.${column.dictName}" :key="item.id" :label="item.value">{{ item.label }}</el-radio>
|
||||
<#else>
|
||||
未设置字典,请手动设置 Radio
|
||||
</#if>
|
||||
<#elseif column.formType = 'Select'>
|
||||
<#if (column.dictName)?? && (column.dictName)!="">
|
||||
<el-select v-model="form.${column.changeColumnName}" filterable placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in dict.${column.dictName}"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value" />
|
||||
</el-select>
|
||||
<#else>
|
||||
未设置字典,请手动设置 Select
|
||||
</#if>
|
||||
<#else>
|
||||
<el-date-picker v-model="form.${column.changeColumnName}" type="datetime" style="width: 370px;" />
|
||||
</#if>
|
||||
</el-form-item>
|
||||
</#if>
|
||||
</#list>
|
||||
</#if>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<#if columns??>
|
||||
<#list columns as column>
|
||||
<#if column.columnShow>
|
||||
<#if (column.dictName)?? && (column.dictName)!="">
|
||||
<el-table-column prop="${column.changeColumnName}" label="<#if column.remark != ''>${column.remark}<#else>${column.changeColumnName}</#if>">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.${column.dictName}[scope.row.${column.changeColumnName}] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<#elseif column.columnType != 'Timestamp'>
|
||||
<el-table-column prop="${column.changeColumnName}" label="<#if column.remark != ''>${column.remark}<#else>${column.changeColumnName}</#if>" />
|
||||
<#else>
|
||||
<el-table-column prop="${column.changeColumnName}" label="<#if column.remark != ''>${column.remark}<#else>${column.changeColumnName}</#if>">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.${column.changeColumnName}) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</#if>
|
||||
</#if>
|
||||
</#list>
|
||||
</#if>
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CRUD, {crud, form, header, presenter} from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
|
||||
const defaultForm = {
|
||||
<#if columns??>
|
||||
<#list columns as column>
|
||||
${column.changeColumnName}: null<#if column_has_next>,</#if>
|
||||
</#list>
|
||||
</#if>
|
||||
}
|
||||
export default {
|
||||
name: '${className}',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
<#if hasDict>
|
||||
dicts: [<#if hasDict??><#list dicts as dict>'${dict}'<#if dict_has_next>, </#if></#list></#if>],
|
||||
</#if>
|
||||
cruds() {
|
||||
return CRUD({ title: '${apiAlias}', url: 'api/${changeClassName}', idField: '${pkChangeColName}', sort: '${pkChangeColName},desc', crudMethod: { ...crud${className} }})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {
|
||||
},
|
||||
rules: {
|
||||
<#if isNotNullColumns??>
|
||||
<#list isNotNullColumns as column>
|
||||
<#if column.istNotNull>
|
||||
${column.changeColumnName}: [
|
||||
{ required: true, message: '<#if column.remark != ''>${column.remark}</#if>不能为空', trigger: 'blur' }
|
||||
]<#if column_has_next>,</#if>
|
||||
</#if>
|
||||
</#list>
|
||||
</#if>
|
||||
}<#if hasQuery>,
|
||||
queryTypeOptions: [
|
||||
<#if queryColumns??>
|
||||
<#list queryColumns as column>
|
||||
<#if column.queryType != 'BetWeen'>
|
||||
{ key: '${column.changeColumnName}', display_name: '<#if column.remark != ''>${column.remark}<#else>${column.changeColumnName}</#if>' }<#if column_has_next>,</#if>
|
||||
</#if>
|
||||
</#list>
|
||||
</#if>
|
||||
]
|
||||
</#if>
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user