Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cneeds-server
Overview
Overview
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
zhangzr
cneeds-server
Commits
034fca8b
Commit
034fca8b
authored
4 years ago
by
zzrdark
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.fix DeviceLog
parent
2e87fffd
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
59 additions
and
34 deletions
+59
-34
compiler.xml
.idea/compiler.xml
+2
-0
encodings.xml
.idea/encodings.xml
+1
-0
workspace.xml
.idea/workspace.xml
+0
-0
cneeds_server.sql
cneeds-common-data/db/cneeds_server.sql
+1
-1
DeviceInfoDto.java
...src/main/java/com/mx/cneeds/common/dto/DeviceInfoDto.java
+2
-0
DeviceLogFileDto.java
.../main/java/com/mx/cneeds/common/dto/DeviceLogFileDto.java
+5
-0
WechatDeviceLogDto.java
...ain/java/com/mx/cneeds/common/dto/WechatDeviceLogDto.java
+5
-0
LogFlieController.java
.../cneeds/server/datashow/web/device/LogFlieController.java
+11
-1
application.yml
cneeds-server-datashow/src/main/resources/application.yml
+1
-1
DeviceLogServiceImpl.java
...s/server/logupload/service/impl/DeviceLogServiceImpl.java
+12
-4
LogUploadController.java
...m/mx/cneeds/server/logupload/web/LogUploadController.java
+3
-1
application.yml
cneeds-server-logupload/src/main/resources/application.yml
+1
-1
application-test.yml
cneeds-server-user/src/main/resources/application-test.yml
+15
-25
No files found.
.idea/compiler.xml
View file @
034fca8b
...
...
@@ -11,6 +11,7 @@
<module
name=
"cneeds-common-utils"
/>
<module
name=
"cneeds-common-data"
/>
<module
name=
"cneeds-server-eureka"
/>
<module
name=
"cneeds-common-hadoop-dfs"
/>
<module
name=
"cneeds-common-pojo"
/>
<module
name=
"cneeds-server-device_activate"
/>
<module
name=
"cneeds-server-authorization"
/>
...
...
@@ -28,6 +29,7 @@
<component
name=
"JavacSettings"
>
<option
name=
"ADDITIONAL_OPTIONS_OVERRIDE"
>
<module
name=
"cneeds-common-data"
options=
"-parameters"
/>
<module
name=
"cneeds-common-hadoop-dfs"
options=
"-parameters"
/>
<module
name=
"cneeds-common-pojo"
options=
"-parameters"
/>
<module
name=
"cneeds-common-utils"
options=
"-parameters"
/>
<module
name=
"cneeds-server-advice-control"
options=
"-parameters"
/>
...
...
This diff is collapsed.
Click to expand it.
.idea/encodings.xml
View file @
034fca8b
...
...
@@ -4,6 +4,7 @@
<file
url=
"file://$PROJECT_DIR$"
charset=
"UTF-8"
/>
<file
url=
"file://$PROJECT_DIR$/cneeds-common-data"
charset=
"UTF-8"
/>
<file
url=
"file://$PROJECT_DIR$/cneeds-common-data/src/main/java"
charset=
"UTF-8"
/>
<file
url=
"file://$PROJECT_DIR$/cneeds-common-hadoop-dfs/src/main/java"
charset=
"UTF-8"
/>
<file
url=
"file://$PROJECT_DIR$/cneeds-common-pojo/src/main/java"
charset=
"UTF-8"
/>
<file
url=
"file://$PROJECT_DIR$/cneeds-common-utils"
charset=
"UTF-8"
/>
<file
url=
"file://$PROJECT_DIR$/cneeds-common-utils/src/main/java"
charset=
"UTF-8"
/>
...
...
This diff is collapsed.
Click to expand it.
.idea/workspace.xml
View file @
034fca8b
This diff is collapsed.
Click to expand it.
cneeds-common-data/db/cneeds_server.sql
View file @
034fca8b
...
...
@@ -66,7 +66,7 @@ CREATE TABLE `device_log` (
DROP
TABLE
IF
EXISTS
`device_logmedia`
;
CREATE
TABLE
`device_logmedia`
(
`logmedia_id`
bigint
(
20
)
NOT
NULL
AUTO_INCREMENT
,
`location_url`
varchar
(
50
)
CHARACTER
SET
utf8
COLLATE
utf8_bin
DEFAULT
NULL
COMMENT
'音频路径'
,
`location_url`
varchar
(
255
)
CHARACTER
SET
utf8
COLLATE
utf8_bin
DEFAULT
NULL
COMMENT
'音频路径'
,
`log_id`
bigint
(
20
)
DEFAULT
NULL
,
`type`
varchar
(
20
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
DEFAULT
NULL
COMMENT
'格式'
,
PRIMARY
KEY
(
`logmedia_id`
)
USING
BTREE
...
...
This diff is collapsed.
Click to expand it.
cneeds-common-pojo/src/main/java/com/mx/cneeds/common/dto/DeviceInfoDto.java
View file @
034fca8b
...
...
@@ -77,4 +77,6 @@ public class DeviceInfoDto {
* 产品系列号
*/
private
String
seriesNum
;
}
This diff is collapsed.
Click to expand it.
cneeds-common-pojo/src/main/java/com/mx/cneeds/common/dto/DeviceLogFileDto.java
View file @
034fca8b
...
...
@@ -28,4 +28,9 @@ public class DeviceLogFileDto {
* 设备Id
*/
Long
deviceId
;
/**
* 文件大小
*/
Long
logfileSize
;
}
This diff is collapsed.
Click to expand it.
cneeds-common-pojo/src/main/java/com/mx/cneeds/common/dto/WechatDeviceLogDto.java
View file @
034fca8b
...
...
@@ -49,4 +49,9 @@ public class WechatDeviceLogDto {
*/
Long
deviceId
;
private
String
createUsername
;
private
Long
userId
;
}
This diff is collapsed.
Click to expand it.
cneeds-server-datashow/src/main/java/com/mx/cneeds/server/datashow/web/device/LogFlieController.java
View file @
034fca8b
package
com
.
mx
.
cneeds
.
server
.
datashow
.
web
.
device
;
import
com.google.gson.Gson
;
import
com.mx.cneeds.common.UserUtils
;
import
com.mx.cneeds.common.constant.FilePath
;
import
com.mx.cneeds.common.converter.RequestParamterConverter
;
import
com.mx.cneeds.common.dto.*
;
...
...
@@ -9,6 +10,7 @@ import com.mx.cneeds.common.vo.DeviceLogFileVo;
import
com.mx.cneeds.common.vo.WechatDeviceLogVo
;
import
com.mx.cneeds.server.datashow.client.DeviceClient
;
import
com.mx.cneeds.server.datashow.client.LogFileClient
;
import
com.mx.cneeds.server.datashow.client.UserClient
;
import
com.mx.hbasefile.hadoop.hdfs.api.HdfsTemplate
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
...
...
@@ -44,6 +46,9 @@ public class LogFlieController {
@Autowired
private
HdfsTemplate
hdfsTemplate
;
@Autowired
private
UserClient
userClient
;
@PostMapping
(
"/logfile/wechatDeviceLogUpload"
)
@ResponseBody
public
R
wechatUploadLog
(
WechatDeviceLogVo
vo
,
MultipartFile
[]
file
)
throws
IOException
{
...
...
@@ -61,6 +66,11 @@ public class LogFlieController {
dto
.
setLocationUrls
(
listUrl
);
DeviceInfoDto
deviceInfoDto
=
deviceClient
.
queryDeviceByImei
(
dto
.
getImei
());
dto
.
setDeviceId
(
deviceInfoDto
.
getDeviceId
());
UserDto
userDto
=
userClient
.
userInfo
(
UserUtils
.
getUserName
());
dto
.
setCreateUsername
(
UserUtils
.
getUserName
());
dto
.
setUserId
(
userDto
.
getUserId
());
logFileClient
.
wechatUploadLog
(
dto
);
return
R
.
ok
();
}
...
...
@@ -77,7 +87,7 @@ public class LogFlieController {
hdfsTemplate
.
saveFile
(
dir
.
toString
(),
file
.
getOriginalFilename
(),
file
.
getInputStream
(),
file
.
getSize
(),
(
short
)
2
);
dto
.
setLogfileUrl
(
dir
.
toString
()+
"/"
+
file
.
getOriginalFilename
());
dto
.
setLogfileSize
(
file
.
getSize
());
DeviceInfoDto
deviceInfoDto
=
deviceClient
.
queryDeviceByImei
(
dto
.
getImei
());
dto
.
setDeviceId
(
deviceInfoDto
.
getDeviceId
());
logFileClient
.
uploadLogFile
(
dto
);
...
...
This diff is collapsed.
Click to expand it.
cneeds-server-datashow/src/main/resources/application.yml
View file @
034fca8b
spring
:
profiles
:
active
:
dev
active
:
prod
application
:
name
:
cneeds-server-datashow
server
:
...
...
This diff is collapsed.
Click to expand it.
cneeds-server-logupload/src/main/java/com/mx/cneeds/server/logupload/service/impl/DeviceLogServiceImpl.java
View file @
034fca8b
...
...
@@ -13,10 +13,7 @@ import org.apache.commons.lang.StringUtils;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.Arrays
;
import
java.util.LinkedList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
/**
* @ClassName DeviceLogServiceImpl
...
...
@@ -59,10 +56,16 @@ public class DeviceLogServiceImpl extends ServiceImpl<DeviceLogDao, DeviceLogEnt
public
Long
wechatUploadLog
(
DeviceLogEntity
deviceLogEntity
){
DeviceLogEntity
logEntity
=
queryOneBylogAcceptId
(
deviceLogEntity
.
getLogAcceptId
());
if
(
logEntity
!=
null
){
//未处理状态
deviceLogEntity
.
setStatus
(
0
);
deviceLogEntity
.
setLogfileStatus
(
1
);
getBaseMapper
().
update
(
deviceLogEntity
,
new
UpdateWrapper
<
DeviceLogEntity
>()
.
eq
(
"log_accept_id"
,
deviceLogEntity
.
getLogAcceptId
()));
}
else
{
deviceLogEntity
.
setCreateTime
(
new
Date
());
deviceLogEntity
.
setStatus
(-
1
);
getBaseMapper
().
insert
(
deviceLogEntity
);
logEntity
=
queryOneBylogAcceptId
(
deviceLogEntity
.
getLogAcceptId
());
}
...
...
@@ -76,10 +79,15 @@ public class DeviceLogServiceImpl extends ServiceImpl<DeviceLogDao, DeviceLogEnt
public
void
deviceUploadLogFile
(
DeviceLogEntity
deviceLogEntity
){
DeviceLogEntity
logEntity
=
queryOneBylogAcceptId
(
deviceLogEntity
.
getLogAcceptId
());
if
(
logEntity
!=
null
){
//未处理状态
deviceLogEntity
.
setStatus
(
0
);
deviceLogEntity
.
setLogfileStatus
(
1
);
getBaseMapper
().
update
(
deviceLogEntity
,
new
UpdateWrapper
<
DeviceLogEntity
>()
.
eq
(
"log_accept_id"
,
deviceLogEntity
.
getLogAcceptId
()));
}
else
{
deviceLogEntity
.
setCreateTime
(
new
Date
());
deviceLogEntity
.
setStatus
(-
1
);
getBaseMapper
().
insert
(
deviceLogEntity
);
}
}
...
...
This diff is collapsed.
Click to expand it.
cneeds-server-logupload/src/main/java/com/mx/cneeds/server/logupload/web/LogUploadController.java
View file @
034fca8b
...
...
@@ -39,7 +39,8 @@ public class LogUploadController {
public
void
wechatUploadLog
(
@RequestBody
WechatDeviceLogDto
dto
){
DeviceLogEntity
deviceLogEntity
=
new
DeviceLogEntity
();
deviceLogEntity
.
setCreateUsername
(
dto
.
getCreateUsername
());
deviceLogEntity
.
setUserId
(
dto
.
getUserId
());
deviceLogEntity
.
setLogAcceptId
(
dto
.
getLogAcceptId
());
deviceLogEntity
.
setDeviceId
(
dto
.
getDeviceId
());
deviceLogEntity
.
setLogName
(
dto
.
getBugTitle
());
...
...
@@ -59,6 +60,7 @@ public class LogUploadController {
deviceLogEntity
.
setDeviceId
(
dto
.
getDeviceId
());
deviceLogEntity
.
setLogfileUrl
(
dto
.
getLogfileUrl
());
deviceLogEntity
.
setLogAcceptId
(
dto
.
getLogAcceptId
());
deviceLogEntity
.
setLogfileSize
(
dto
.
getLogfileSize
());
deviceLogService
.
deviceUploadLogFile
(
deviceLogEntity
);
}
...
...
This diff is collapsed.
Click to expand it.
cneeds-server-logupload/src/main/resources/application.yml
View file @
034fca8b
spring
:
profiles
:
active
:
dev
active
:
prod
application
:
name
:
cneeds-server-logupload
...
...
This diff is collapsed.
Click to expand it.
cneeds-server-user/src/main/resources/application-test.yml
View file @
034fca8b
...
...
@@ -42,7 +42,21 @@ spring:
# wall:
# config:
# multi-statement-allow: true
mqtt
:
username
:
admin
password
:
public
host-url
:
tcp://120.25.162.101:1883
# client-id: zhjsbackground${random.value}
client-id
:
server
# default-topic: $SYS/brokers/+/clients/#
completionTimeout
:
3000
keepAlive
:
60
topics[0]
:
topicname
:
device/+/+/push
qos
:
0
topics[1]
:
topicname
:
server/receive/
qos
:
0
eureka
:
client
:
...
...
@@ -52,27 +66,3 @@ eureka:
prefer-ip-address
:
true
ip-address
:
192.168.2.244
mybatis-plus
:
mapper-locations
:
classpath:mapper/*.xml
#实体扫描,多个package用逗号或者分号分隔
typeAliasesPackage
:
com.mx.cneeds.server.entity
global-config
:
#数据库相关配置
db-config
:
#主键类型 AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID";
id-type
:
AUTO
#字段策略 IGNORED:"忽略判断",NOT_NULL:"非 NULL 判断"),NOT_EMPTY:"非空判断"
field-strategy
:
NOT_NULL
#驼峰下划线转换
column-underline
:
true
logic-delete-value
:
-1
logic-not-delete-value
:
0
banner
:
false
#原生配置
configuration
:
map-underscore-to-camel-case
:
true
cache-enabled
:
false
call-setters-on-nulls
:
true
jdbc-type-for-null
:
'
null'
This diff is collapsed.
Click to expand it.
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