Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
L
lic
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
inroi
lic
Commits
c636662e
提交
c636662e
authored
12月 16, 2022
作者:
张桂
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
添加Lic名称字段,修改查询,增加,update接口
上级
bf296e19
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
25 行增加
和
11 行删除
+25
-11
Api.sql
lic-system/db/Api.sql
+1
-0
LicInfoMapper.java
lic-system/src/main/java/com/system/dao/LicInfoMapper.java
+0
-1
LicInfoMapper.xml
...tem/src/main/java/com/system/dao/mapper/LicInfoMapper.xml
+5
-5
LicInfoServiceImpl.java
...main/java/com/system/serivce/impl/LicInfoServiceImpl.java
+2
-1
LicInfoCreateInVo.java
.../main/java/com/system/transfer/lic/LicInfoCreateInVo.java
+5
-0
LicInfoListOutVoRecords.java
...java/com/system/transfer/lic/LicInfoListOutVoRecords.java
+4
-0
LicInfoUpdateInVo.java
.../main/java/com/system/transfer/lic/LicInfoUpdateInVo.java
+4
-0
DownloadUtil.java
lic-system/src/main/java/com/system/utils/DownloadUtil.java
+2
-2
application-test.yaml
lic-system/src/main/resources/application-test.yaml
+2
-2
没有找到文件。
lic-system/db/Api.sql
浏览文件 @
c636662e
...
@@ -350,6 +350,7 @@ CREATE TABLE `undo_log` (
...
@@ -350,6 +350,7 @@ CREATE TABLE `undo_log` (
DROP
TABLE
IF
EXISTS
`tb_lic_info`
;
DROP
TABLE
IF
EXISTS
`tb_lic_info`
;
CREATE
TABLE
`tb_lic_info`
(
CREATE
TABLE
`tb_lic_info`
(
`lq_lic_name`
VARCHAR
(
128
)
NOT
NULL
COMMENT
'lic名称'
,
`id`
INT
(
11
)
NOT
NULL
AUTO_INCREMENT
COMMENT
'主键id'
,
`id`
INT
(
11
)
NOT
NULL
AUTO_INCREMENT
COMMENT
'主键id'
,
`mac_address`
VARCHAR
(
128
)
NOT
NULL
COMMENT
'MAC地址'
,
`mac_address`
VARCHAR
(
128
)
NOT
NULL
COMMENT
'MAC地址'
,
`effective_time`
TIMESTAMP
NOT
NULL
COMMENT
'导入有效时间'
,
`effective_time`
TIMESTAMP
NOT
NULL
COMMENT
'导入有效时间'
,
...
...
lic-system/src/main/java/com/system/dao/LicInfoMapper.java
浏览文件 @
c636662e
...
@@ -49,5 +49,4 @@ public interface LicInfoMapper {
...
@@ -49,5 +49,4 @@ public interface LicInfoMapper {
*/
*/
LicInfoListOutVoRecords
getLicInfoByMacAddress
(
String
macAddress
);
LicInfoListOutVoRecords
getLicInfoByMacAddress
(
String
macAddress
);
}
}
lic-system/src/main/java/com/system/dao/mapper/LicInfoMapper.xml
浏览文件 @
c636662e
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
<select
id=
"licInfoList"
parameterType=
"com.system.transfer.lic.LicInfoListInVo"
resultType=
"com.system.transfer.lic.LicInfoListOutVoRecords"
>
<select
id=
"licInfoList"
parameterType=
"com.system.transfer.lic.LicInfoListInVo"
resultType=
"com.system.transfer.lic.LicInfoListOutVoRecords"
>
SELECT
SELECT
id, mac_address, effective_time, file_effective_time, verification_interval, module_verification, remark, create_time
id,
lq_lic_name,
mac_address, effective_time, file_effective_time, verification_interval, module_verification, remark, create_time
FROM tb_lic_info
FROM tb_lic_info
<where>
<where>
<if
test=
"inVo.macAddress != null and inVo.macAddress != ''"
>
<if
test=
"inVo.macAddress != null and inVo.macAddress != ''"
>
...
@@ -23,9 +23,9 @@
...
@@ -23,9 +23,9 @@
<insert
id=
"licInfoCreate"
parameterType=
"com.system.transfer.lic.LicInfoCreateInVo"
>
<insert
id=
"licInfoCreate"
parameterType=
"com.system.transfer.lic.LicInfoCreateInVo"
>
INSERT INTO tb_lic_info (
INSERT INTO tb_lic_info (
mac_address, effective_time, file_effective_time, verification_interval, module_verification, remark
lq_lic_name,
mac_address, effective_time, file_effective_time, verification_interval, module_verification, remark
) VALUES (
) VALUES (
#{macAddress}, #{effectiveTime}, #{fileEffectiveTime}, #{verificationInterval}, #{moduleVerification}, #{remark}
#{
lqLicName}, #{
macAddress}, #{effectiveTime}, #{fileEffectiveTime}, #{verificationInterval}, #{moduleVerification}, #{remark}
)
)
</insert>
</insert>
...
@@ -35,7 +35,7 @@
...
@@ -35,7 +35,7 @@
<update
id=
"licInfoUpdate"
parameterType=
"com.system.transfer.lic.LicInfoUpdateInVo"
>
<update
id=
"licInfoUpdate"
parameterType=
"com.system.transfer.lic.LicInfoUpdateInVo"
>
UPDATE tb_lic_info SET
UPDATE tb_lic_info SET
mac_address = #{macAddress}, effective_time = #{effectiveTime}, file_effective_time = #{fileEffectiveTime},
lq_lic_name = #{lqLicName},
mac_address = #{macAddress}, effective_time = #{effectiveTime}, file_effective_time = #{fileEffectiveTime},
verification_interval = #{verificationInterval}, module_verification = #{moduleVerification}, remark = #{remark}
verification_interval = #{verificationInterval}, module_verification = #{moduleVerification}, remark = #{remark}
WHERE id = #{id}
WHERE id = #{id}
...
@@ -54,7 +54,7 @@
...
@@ -54,7 +54,7 @@
<select
id=
"getLicInfoByMacAddress"
parameterType=
"java.lang.String"
resultType=
"com.system.transfer.lic.LicInfoListOutVoRecords"
>
<select
id=
"getLicInfoByMacAddress"
parameterType=
"java.lang.String"
resultType=
"com.system.transfer.lic.LicInfoListOutVoRecords"
>
SELECT
SELECT
id, mac_address, effective_time, file_effective_time, verification_interval, module_verification, create_time
id,
lq_lic_name,
mac_address, effective_time, file_effective_time, verification_interval, module_verification, create_time
FROM tb_lic_info WHERE mac_address = #{macAddress}
FROM tb_lic_info WHERE mac_address = #{macAddress}
</select>
</select>
...
...
lic-system/src/main/java/com/system/serivce/impl/LicInfoServiceImpl.java
浏览文件 @
c636662e
...
@@ -42,6 +42,7 @@ public class LicInfoServiceImpl implements ILicInfoService {
...
@@ -42,6 +42,7 @@ public class LicInfoServiceImpl implements ILicInfoService {
@Override
@Override
public
void
licInfoCreate
(
LicInfoCreateInVo
inVo
)
{
public
void
licInfoCreate
(
LicInfoCreateInVo
inVo
)
{
licInfoMapper
.
licInfoCreate
(
inVo
);
licInfoMapper
.
licInfoCreate
(
inVo
);
}
}
...
@@ -64,7 +65,7 @@ public class LicInfoServiceImpl implements ILicInfoService {
...
@@ -64,7 +65,7 @@ public class LicInfoServiceImpl implements ILicInfoService {
try
{
try
{
String
data
=
RsaUtil
.
encryptByPrivateKeyToLong
(
JsonUtil
.
toString
(
inVo
),
rsaKeyConstant
.
getPrivateKey
());
String
data
=
RsaUtil
.
encryptByPrivateKeyToLong
(
JsonUtil
.
toString
(
inVo
),
rsaKeyConstant
.
getPrivateKey
());
DownloadUtil
.
download
(
response
,
data
);
DownloadUtil
.
download
(
response
,
data
,
records
.
getMacAddress
()
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
return
RestResponse
.
fail
(
"Lic文件生成失败"
);
return
RestResponse
.
fail
(
"Lic文件生成失败"
);
...
...
lic-system/src/main/java/com/system/transfer/lic/LicInfoCreateInVo.java
浏览文件 @
c636662e
...
@@ -9,6 +9,11 @@ import lombok.Data;
...
@@ -9,6 +9,11 @@ import lombok.Data;
public
class
LicInfoCreateInVo
{
public
class
LicInfoCreateInVo
{
/**
/**
* lic名称
*/
private
String
lqLicName
;
/**
* MAC地址
* MAC地址
*/
*/
private
String
macAddress
;
private
String
macAddress
;
...
...
lic-system/src/main/java/com/system/transfer/lic/LicInfoListOutVoRecords.java
浏览文件 @
c636662e
...
@@ -13,6 +13,10 @@ public class LicInfoListOutVoRecords {
...
@@ -13,6 +13,10 @@ public class LicInfoListOutVoRecords {
*/
*/
private
Integer
id
;
private
Integer
id
;
/**
* lic名称
*/
private
String
lqLicName
;
/**
/**
* MAC地址
* MAC地址
...
...
lic-system/src/main/java/com/system/transfer/lic/LicInfoUpdateInVo.java
浏览文件 @
c636662e
...
@@ -13,6 +13,10 @@ public class LicInfoUpdateInVo {
...
@@ -13,6 +13,10 @@ public class LicInfoUpdateInVo {
*/
*/
private
Integer
id
;
private
Integer
id
;
/**
* lic名称
*/
private
String
lqLicName
;
/**
/**
* MAC地址
* MAC地址
...
...
lic-system/src/main/java/com/system/utils/DownloadUtil.java
浏览文件 @
c636662e
...
@@ -13,11 +13,11 @@ import java.nio.charset.StandardCharsets;
...
@@ -13,11 +13,11 @@ import java.nio.charset.StandardCharsets;
*/
*/
public
class
DownloadUtil
{
public
class
DownloadUtil
{
public
static
void
download
(
HttpServletResponse
response
,
String
data
)
{
public
static
void
download
(
HttpServletResponse
response
,
String
data
,
String
mac
)
{
//设置响应的内容类型
//设置响应的内容类型
response
.
setCharacterEncoding
(
"UTF-8"
);
response
.
setCharacterEncoding
(
"UTF-8"
);
response
.
setContentType
(
"text/plain"
);
response
.
setContentType
(
"text/plain"
);
response
.
addHeader
(
"Content-Disposition"
,
"attachment;filename=lic
.tmp
"
);
response
.
addHeader
(
"Content-Disposition"
,
"attachment;filename=lic
"
+
mac
+
".lqlic
"
);
BufferedOutputStream
bufferedOutputStream
=
null
;
BufferedOutputStream
bufferedOutputStream
=
null
;
ServletOutputStream
servletOutputStream
=
null
;
ServletOutputStream
servletOutputStream
=
null
;
...
...
lic-system/src/main/resources/application-test.yaml
浏览文件 @
c636662e
...
@@ -22,8 +22,8 @@ spring:
...
@@ -22,8 +22,8 @@ spring:
datasource
:
datasource
:
url
:
jdbc:mysql://127.0.0.1:3306/db_lic?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false
url
:
jdbc:mysql://127.0.0.1:3306/db_lic?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false
username
:
inori
username
:
root
password
:
inori
password
:
123456
driver-class-name
:
com.mysql.cj.jdbc.Driver
driver-class-name
:
com.mysql.cj.jdbc.Driver
type
:
com.alibaba.druid.pool.DruidDataSource
type
:
com.alibaba.druid.pool.DruidDataSource
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论