Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
T
TDLCloud
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
WitCloud
TDLCloud
Commits
d85a8053
Commit
d85a8053
authored
Jun 06, 2018
by
chenying
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
6.6修改分配公司接口,修改用户接口,添加仓库数据下载接口
parent
ce7d2c94
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
705 additions
and
22 deletions
+705
-22
WarehouseExcel.java
src/main/java/com/example/tdl/common/WarehouseExcel.java
+396
-0
UpdateTDLCompanyVo.java
...in/java/com/example/tdl/domain/vo/UpdateTDLCompanyVo.java
+23
-0
UserNameVo.java
src/main/java/com/example/tdl/domain/vo/UserNameVo.java
+23
-1
AliyunOSSClientUtil.java
src/main/java/com/example/tdl/util/AliyunOSSClientUtil.java
+7
-8
OSSClientConstants.java
src/main/java/com/example/tdl/util/OSSClientConstants.java
+3
-1
DownloadController.java
src/main/java/com/example/tdl/web/DownloadController.java
+235
-0
TDLDeviceController.java
src/main/java/com/example/tdl/web/TDLDeviceController.java
+8
-5
UserController.java
src/main/java/com/example/tdl/web/UserController.java
+4
-2
WarehouseController.java
src/main/java/com/example/tdl/web/WarehouseController.java
+1
-0
application.properties
src/main/resources/application.properties
+3
-3
TDLLogMapper.xml
src/main/resources/mapper/TDLLogMapper.xml
+2
-2
No files found.
src/main/java/com/example/tdl/common/WarehouseExcel.java
0 → 100644
View file @
d85a8053
This diff is collapsed.
Click to expand it.
src/main/java/com/example/tdl/domain/vo/UpdateTDLCompanyVo.java
0 → 100644
View file @
d85a8053
package
com
.
example
.
tdl
.
domain
.
vo
;
public
class
UpdateTDLCompanyVo
{
private
String
TDLSN
;
private
String
companyNo
;
public
String
getTDLSN
()
{
return
TDLSN
;
}
public
void
setTDLSN
(
String
TDLSN
)
{
this
.
TDLSN
=
TDLSN
;
}
public
String
getCompanyNo
()
{
return
companyNo
;
}
public
void
setCompanyNo
(
String
companyNo
)
{
this
.
companyNo
=
companyNo
;
}
}
src/main/java/com/example/tdl/domain/vo/UserNameVo.java
View file @
d85a8053
...
@@ -8,13 +8,35 @@ public class UserNameVo {
...
@@ -8,13 +8,35 @@ public class UserNameVo {
private
String
ipAddress
;
private
String
ipAddress
;
private
String
companyImg
;
private
String
companyAlias
;
public
UserNameVo
()
{
public
UserNameVo
()
{
}
}
public
UserNameVo
(
String
userName
,
String
time
,
String
ipAddress
)
{
public
UserNameVo
(
String
userName
,
String
time
,
String
ipAddress
,
String
companyImg
,
String
companyAlias
)
{
UserName
=
userName
;
UserName
=
userName
;
this
.
time
=
time
;
this
.
time
=
time
;
this
.
ipAddress
=
ipAddress
;
this
.
ipAddress
=
ipAddress
;
this
.
companyImg
=
companyImg
;
this
.
companyAlias
=
companyAlias
;
}
public
String
getCompanyAlias
()
{
return
companyAlias
;
}
public
void
setCompanyAlias
(
String
companyAlias
)
{
this
.
companyAlias
=
companyAlias
;
}
public
String
getCompanyImg
()
{
return
companyImg
;
}
public
void
setCompanyImg
(
String
companyImg
)
{
this
.
companyImg
=
companyImg
;
}
}
public
String
getUserName
()
{
public
String
getUserName
()
{
...
...
src/main/java/com/example/tdl/util/AliyunOSSClientUtil.java
View file @
d85a8053
...
@@ -36,10 +36,10 @@ public class AliyunOSSClientUtil {
...
@@ -36,10 +36,10 @@ public class AliyunOSSClientUtil {
private
static
String
FOLDER4
;
private
static
String
FOLDER4
;
private
static
String
FOLDER5
;
private
static
CannedAccessControlList
acl_pub_readwrite
=
CannedAccessControlList
.
PublicReadWrite
;
private
static
CannedAccessControlList
acl_pub_readwrite
=
CannedAccessControlList
.
PublicReadWrite
;
//初始化属性
//初始化属性
static
{
static
{
ENDPOINT
=
OSSClientConstants
.
ENDPOINT
;
ENDPOINT
=
OSSClientConstants
.
ENDPOINT
;
...
@@ -50,7 +50,7 @@ public class AliyunOSSClientUtil {
...
@@ -50,7 +50,7 @@ public class AliyunOSSClientUtil {
FOLDER2
=
OSSClientConstants
.
FOLDER2
;
FOLDER2
=
OSSClientConstants
.
FOLDER2
;
FOLDER3
=
OSSClientConstants
.
FOLDER3
;
FOLDER3
=
OSSClientConstants
.
FOLDER3
;
FOLDER4
=
OSSClientConstants
.
FOLDER4
;
FOLDER4
=
OSSClientConstants
.
FOLDER4
;
FOLDER5
=
OSSClientConstants
.
FOLDER5
;
}
}
public
static
String
getENDPOINT
()
{
public
static
String
getENDPOINT
()
{
...
@@ -151,7 +151,6 @@ public class AliyunOSSClientUtil {
...
@@ -151,7 +151,6 @@ public class AliyunOSSClientUtil {
logger
.
info
(
"删除"
+
bucketName
+
"Bucket成功"
);
logger
.
info
(
"删除"
+
bucketName
+
"Bucket成功"
);
}
}
/**
/**
* 上传图片
* 上传图片
*
*
...
@@ -170,7 +169,6 @@ public class AliyunOSSClientUtil {
...
@@ -170,7 +169,6 @@ public class AliyunOSSClientUtil {
}
}
}
}
public
static
String
uploadImg2Oss
(
OSSClient
ossClient
,
MultipartFile
file
,
String
number
,
String
imageType
)
{
public
static
String
uploadImg2Oss
(
OSSClient
ossClient
,
MultipartFile
file
,
String
number
,
String
imageType
)
{
String
originalFilename
=
file
.
getOriginalFilename
();
String
originalFilename
=
file
.
getOriginalFilename
();
...
@@ -233,7 +231,6 @@ public class AliyunOSSClientUtil {
...
@@ -233,7 +231,6 @@ public class AliyunOSSClientUtil {
return
ret
;
return
ret
;
}
}
public
static
String
uploadFile2OSS
(
OSSClient
ossClient
,
InputStream
instream
,
String
fileName
,
String
imageType
)
{
public
static
String
uploadFile2OSS
(
OSSClient
ossClient
,
InputStream
instream
,
String
fileName
,
String
imageType
)
{
String
ret
=
""
;
String
ret
=
""
;
try
{
try
{
...
@@ -361,6 +358,8 @@ public class AliyunOSSClientUtil {
...
@@ -361,6 +358,8 @@ public class AliyunOSSClientUtil {
putResult
=
ossClient
.
putObject
(
BACKET_NAME
,
FOLDER3
+
fileName
,
is
,
metadata
);
putResult
=
ossClient
.
putObject
(
BACKET_NAME
,
FOLDER3
+
fileName
,
is
,
metadata
);
}
else
if
(
fileName
.
contains
(
"CHN"
)){
}
else
if
(
fileName
.
contains
(
"CHN"
)){
putResult
=
ossClient
.
putObject
(
BACKET_NAME
,
FOLDER4
+
fileName
,
is
,
metadata
);
putResult
=
ossClient
.
putObject
(
BACKET_NAME
,
FOLDER4
+
fileName
,
is
,
metadata
);
}
else
if
(
fileName
.
contains
(
"仓库温湿度观测记录表"
)){
putResult
=
ossClient
.
putObject
(
BACKET_NAME
,
FOLDER5
+
fileName
,
is
,
metadata
);
}
else
{
}
else
{
putResult
=
ossClient
.
putObject
(
BACKET_NAME
,
FOLDER1
+
fileName
,
is
,
metadata
);
putResult
=
ossClient
.
putObject
(
BACKET_NAME
,
FOLDER1
+
fileName
,
is
,
metadata
);
}
}
...
...
src/main/java/com/example/tdl/util/OSSClientConstants.java
View file @
d85a8053
...
@@ -26,6 +26,8 @@ public class OSSClientConstants {
...
@@ -26,6 +26,8 @@ public class OSSClientConstants {
public
static
final
String
FOLDER4
=
"pic/wareHouseImage/"
;
//仓库图片
public
static
final
String
FOLDER4
=
"pic/wareHouseImage/"
;
//仓库图片
public
static
final
String
FOLDER5
=
"warehouse/"
;
//仓库数据下载
//公共读写
//公共读写
private
static
final
CannedAccessControlList
acl_pub_readwrite
=
CannedAccessControlList
.
PublicReadWrite
;
private
static
final
CannedAccessControlList
acl_pub_readwrite
=
CannedAccessControlList
.
PublicReadWrite
;
...
...
src/main/java/com/example/tdl/web/DownloadController.java
0 → 100644
View file @
d85a8053
This diff is collapsed.
Click to expand it.
src/main/java/com/example/tdl/web/TDLDeviceController.java
View file @
d85a8053
...
@@ -225,18 +225,21 @@ public class TDLDeviceController {
...
@@ -225,18 +225,21 @@ public class TDLDeviceController {
@ApiImplicitParam
(
paramType
=
"header"
,
name
=
"Account_token"
,
value
=
"token"
,
required
=
true
,
dataType
=
"String"
),
@ApiImplicitParam
(
paramType
=
"header"
,
name
=
"Account_token"
,
value
=
"token"
,
required
=
true
,
dataType
=
"String"
),
})
})
@RequestMapping
(
value
=
"/updateCompany"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/updateCompany"
,
method
=
RequestMethod
.
POST
)
public
Object
updateCompany
(
@RequestBody
String
TDLSN
,
HttpServletRequest
request
){
public
Object
updateCompany
(
@RequestBody
UpdateTDLCompanyVo
updateTDLCompanyVo
,
HttpServletRequest
request
){
String
token
=
request
.
getHeader
(
"Account_token"
);
String
token
=
request
.
getHeader
(
"Account_token"
);
String
datum
=
tokenRedisService
.
get
(
"TOKEN_"
+
token
);
String
datum
=
tokenRedisService
.
get
(
"TOKEN_"
+
token
);
UserRedisVo
user
=
gson
.
fromJson
(
datum
,
UserRedisVo
.
class
);
UserRedisVo
user
=
gson
.
fromJson
(
datum
,
UserRedisVo
.
class
);
JSONObject
jsonObject
=
JSON
.
parseObject
(
TDLSN
);
if
(
StringUtils
.
isEmpty
(
updateTDLCompanyVo
.
getTDLSN
())){
TDLSN
=(
String
)
jsonObject
.
get
(
"TDLSN"
);
if
(
StringUtils
.
isEmpty
(
TDLSN
)){
fb
.
setCode
(
0
);
fb
.
setCode
(
0
);
fb
.
setMessage
(
i18n
.
getMessage
(
request
,
"TDLSN"
));
fb
.
setMessage
(
i18n
.
getMessage
(
request
,
"TDLSN"
));
return
gson
.
toJson
(
fb
);
return
gson
.
toJson
(
fb
);
}
}
int
a
=
tdlDeviceService
.
updateCompany
(
TDLSN
,
user
.
getCompanyNo
());
if
(
StringUtils
.
isEmpty
(
updateTDLCompanyVo
.
getCompanyNo
())){
fb
.
setCode
(
0
);
fb
.
setMessage
(
i18n
.
getMessage
(
request
,
"companyNo"
));
return
gson
.
toJson
(
fb
);
}
int
a
=
tdlDeviceService
.
updateCompany
(
updateTDLCompanyVo
.
getTDLSN
(),
user
.
getCompanyNo
());
if
(
a
>=
0
){
if
(
a
>=
0
){
fb
.
setCode
(
1
);
fb
.
setCode
(
1
);
fb
.
setMessage
(
i18n
.
getMessage
(
request
,
"updateTDLCompanySuccess"
));
fb
.
setMessage
(
i18n
.
getMessage
(
request
,
"updateTDLCompanySuccess"
));
...
...
src/main/java/com/example/tdl/web/UserController.java
View file @
d85a8053
...
@@ -414,9 +414,11 @@ public class UserController {
...
@@ -414,9 +414,11 @@ public class UserController {
String
token
=
request
.
getHeader
(
"Account_token"
);
String
token
=
request
.
getHeader
(
"Account_token"
);
String
datum
=
tokenRedisService
.
get
(
"TOKEN_"
+
token
);
String
datum
=
tokenRedisService
.
get
(
"TOKEN_"
+
token
);
UserRedisVo
userRedisVo
=
gson
.
fromJson
(
datum
,
UserRedisVo
.
class
);
UserRedisVo
userRedisVo
=
gson
.
fromJson
(
datum
,
UserRedisVo
.
class
);
//获取当前登录者的天气
String
ip
=
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
().
getRemoteAddr
();
String
ip
=
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
().
getRemoteAddr
();
return
new
UserNameVo
(
userRedisVo
.
getUserName
(),
System
.
currentTimeMillis
()
+
""
,
ip
);
ResultCompanyVo
resultCompanyVo
=
companyService
.
getByCompanyNo
(
userRedisVo
.
getCompanyNo
());
String
img
=
resultCompanyVo
.
getImg
();
String
companyAlias
=
resultCompanyVo
.
getAlias
();
return
new
UserNameVo
(
userRedisVo
.
getUserName
(),
System
.
currentTimeMillis
()
+
""
,
ip
,
img
,
companyAlias
);
}
}
}
}
src/main/java/com/example/tdl/web/WarehouseController.java
View file @
d85a8053
...
@@ -67,6 +67,7 @@ public class WarehouseController {
...
@@ -67,6 +67,7 @@ public class WarehouseController {
@Autowired
@Autowired
private
InfluxDBTemplate
influxDBTemplate
;
private
InfluxDBTemplate
influxDBTemplate
;
@Autowired
private
TDLLogService
tdlLogService
;
private
TDLLogService
tdlLogService
;
private
final
static
String
database
=
"original"
;
private
final
static
String
database
=
"original"
;
...
...
src/main/resources/application.properties
View file @
d85a8053
spring.datasource.url
=
jdbc:mysql://192.168.1.
53
:3306/tdlcloud?useUnicode=true&characterEncoding=utf-8&useSSL=false
spring.datasource.url
=
jdbc:mysql://192.168.1.
16
:3306/tdlcloud?useUnicode=true&characterEncoding=utf-8&useSSL=false
spring.datasource.username
=
root
spring.datasource.username
=
root
spring.datasource.password
=
root
spring.datasource.password
=
37774020
spring.datasource.driver-class-name
=
com.mysql.jdbc.Driver
spring.datasource.driver-class-name
=
com.mysql.jdbc.Driver
threadpool.corepoolsize
=
30
threadpool.corepoolsize
=
30
threadpool.maxpoolsize
=
50
threadpool.maxpoolsize
=
50
server.port
=
809
9
server.port
=
809
2
management.security.enabled
=
false
management.security.enabled
=
false
...
...
src/main/resources/mapper/TDLLogMapper.xml
View file @
d85a8053
...
@@ -44,7 +44,7 @@
...
@@ -44,7 +44,7 @@
<select
id=
"getByWarehouse"
parameterType=
"String"
resultType=
"com.example.tdl.domain.vo.WarehouseLogVo"
>
<select
id=
"getByWarehouse"
parameterType=
"String"
resultType=
"com.example.tdl.domain.vo.WarehouseLogVo"
>
select
DISTINCT CONCAT( gatewaytype,"_",gatewaySN) device, tgl.gatewaySN SN,gatewaytype type,
w.warehouseNo
select
DISTINCT CONCAT( gatewaytype,"_",gatewaySN) device, tgl.gatewaySN SN,gatewaytype type,
w.warehouseNo
from tdl_gateway_log tgl,warehouse w
from tdl_gateway_log tgl,warehouse w
where tgl.warehouseNo = w.warehouseNo
where tgl.warehouseNo = w.warehouseNo
and w.warehouseNo=#{warehouseNo,jdbcType=VARCHAR}
and w.warehouseNo=#{warehouseNo,jdbcType=VARCHAR}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment