Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
黄嘉阳
/
iot-platform-server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
371e4185
authored
Sep 14, 2023
by
朱淼
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'dev' of
http://git.xmmakeit.com/huangjiay/iot-platform-server
into dev
parents
0eaef2f5
0cafd23e
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
85 additions
and
51 deletions
db/inti-elder.sql
db/platAuth.sql → db/plat-auth.sql
saas-module/src/main/java/com/makeit/controller/saas/SaasUserController.java
server-common/src/main/java/com/makeit/utils/user/ThreadLocalUserUtil.java
server-module/src/main/java/com/makeit/config/SwaggerPlatformConfig.java
server-module/src/main/java/com/makeit/module/controller/children/org/PlatOrgChildrenController.java
server-service/src/main/java/com/makeit/service/platform/alarm/alarmStrategy/BehaviorAlarm.java
server-service/src/main/java/com/makeit/service/platform/device/impl/PlatDeviceServiceImpl.java
server-web/src/main/resources/application-dev.yml
server-web/src/main/resources/application-test.yml
db/inti-elder.sql
View file @
371e4185
...
@@ -45,8 +45,8 @@ CREATE TABLE `plat_elder`
...
@@ -45,8 +45,8 @@ CREATE TABLE `plat_elder`
org_path
varchar
(
64
)
NULL
COMMENT
'组织路径'
,
org_path
varchar
(
64
)
NULL
COMMENT
'组织路径'
,
`remark`
varchar
(
1024
)
DEFAULT
NULL
COMMENT
'备注'
,
`remark`
varchar
(
1024
)
DEFAULT
NULL
COMMENT
'备注'
,
avatar
varchar
(
64
)
NULL
COMMENT
'头像文件id'
,
avatar
varchar
(
64
)
NULL
COMMENT
'头像文件id'
,
check_in_time
datetime
DEFAULT
NULL
COMMENT
'入住时间'
,
check_in_time
datetime
DEFAULT
NULL
COMMENT
'入住时间'
,
check_out_time
datetime
DEFAULT
NULL
COMMENT
'退住时间'
,
check_out_time
datetime
DEFAULT
NULL
COMMENT
'退住时间'
,
`create_by`
varchar
(
64
)
DEFAULT
NULL
COMMENT
'创建者'
,
`create_by`
varchar
(
64
)
DEFAULT
NULL
COMMENT
'创建者'
,
`create_date`
datetime
DEFAULT
NULL
COMMENT
'创建时间'
,
`create_date`
datetime
DEFAULT
NULL
COMMENT
'创建时间'
,
`update_by`
varchar
(
64
)
DEFAULT
NULL
COMMENT
'更新者'
,
`update_by`
varchar
(
64
)
DEFAULT
NULL
COMMENT
'更新者'
,
...
@@ -270,12 +270,12 @@ CREATE TABLE `plat_device_other`
...
@@ -270,12 +270,12 @@ CREATE TABLE `plat_device_other`
installation
varchar
(
64
)
NULL
COMMENT
'设备安装方式'
,
installation
varchar
(
64
)
NULL
COMMENT
'设备安装方式'
,
indicator_light
varchar
(
64
)
NULL
COMMENT
'开关指示灯'
,
indicator_light
varchar
(
64
)
NULL
COMMENT
'开关指示灯'
,
attribute
varchar
(
3000
)
NULL
COMMENT
'设备属性json'
,
attribute
varchar
(
3000
)
NULL
COMMENT
'设备属性json'
,
wifi_name
varchar
(
200
)
N
OT
N
ULL
COMMENT
'wifi名称'
,
wifi_name
varchar
(
200
)
NULL
COMMENT
'wifi名称'
,
wifi_password
varchar
(
200
)
N
OT
N
ULL
COMMENT
'wifi密码'
,
wifi_password
varchar
(
200
)
NULL
COMMENT
'wifi密码'
,
protocol_address
varchar
(
100
)
N
OT
N
ULL
COMMENT
'协议地址'
,
protocol_address
varchar
(
100
)
NULL
COMMENT
'协议地址'
,
protocol_port
varchar
(
100
)
N
OT
N
ULL
COMMENT
'协议端口'
,
protocol_port
varchar
(
100
)
NULL
COMMENT
'协议端口'
,
protocol_account
varchar
(
200
)
N
OT
N
ULL
COMMENT
'协议账号'
,
protocol_account
varchar
(
200
)
NULL
COMMENT
'协议账号'
,
protocol_password
varchar
(
200
)
N
OT
N
ULL
COMMENT
'协议密码'
,
protocol_password
varchar
(
200
)
NULL
COMMENT
'协议密码'
,
`create_by`
varchar
(
64
)
DEFAULT
NULL
COMMENT
'创建者'
,
`create_by`
varchar
(
64
)
DEFAULT
NULL
COMMENT
'创建者'
,
`create_date`
datetime
DEFAULT
NULL
COMMENT
'创建时间'
,
`create_date`
datetime
DEFAULT
NULL
COMMENT
'创建时间'
,
`update_by`
varchar
(
64
)
DEFAULT
NULL
COMMENT
'更新者'
,
`update_by`
varchar
(
64
)
DEFAULT
NULL
COMMENT
'更新者'
,
...
@@ -287,39 +287,59 @@ CREATE TABLE `plat_device_other`
...
@@ -287,39 +287,59 @@ CREATE TABLE `plat_device_other`
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'设备其他信息'
;
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'设备其他信息'
;
CREATE
TABLE
`plat_elder_sleep`
(
CREATE
TABLE
`plat_elder_sleep`
`id`
VARCHAR
(
64
)
NOT
NULL
COMMENT
'id'
,
(
`elder_id`
VARCHAR
(
64
)
NOT
NULL
COMMENT
'长者id'
,
`id`
VARCHAR
(
64
)
NOT
NULL
COMMENT
'id'
,
`start_sleep`
datetime
DEFAULT
NULL
COMMENT
'入睡时间'
,
`elder_id`
VARCHAR
(
64
)
NOT
NULL
COMMENT
'长者id'
,
`end_sleep`
datetime
DEFAULT
NULL
COMMENT
'起床时间'
,
`start_sleep`
datetime
DEFAULT
NULL
COMMENT
'入睡时间'
,
`current_date`
VARCHAR
(
64
)
DEFAULT
NULL
COMMENT
'当前日期 yyyy-mm-dd'
,
`end_sleep`
datetime
DEFAULT
NULL
COMMENT
'起床时间'
,
`sleep_record`
text
DEFAULT
NULL
COMMENT
'睡眠记录 区分时间段记录 [{"sleepType":"","startTime":"","endTime":""},{}]'
,
`current_date`
VARCHAR
(
64
)
DEFAULT
NULL
COMMENT
'当前日期 yyyy-mm-dd'
,
`create_date`
datetime
NOT
NULL
COMMENT
'创建时间'
,
`sleep_record`
text
DEFAULT
NULL
COMMENT
'睡眠记录 区分时间段记录 [{"sleepType":"","startTime":"","endTime":""},{}]'
,
`update_date`
datetime
NOT
NULL
COMMENT
'更新时间'
,
`create_date`
datetime
NOT
NULL
COMMENT
'创建时间'
,
`del_flag`
CHAR
(
1
)
DEFAULT
NULL
COMMENT
'删除标识'
,
`update_date`
datetime
NOT
NULL
COMMENT
'更新时间'
,
`create_by`
VARCHAR
(
64
)
NOT
NULL
COMMENT
'创建人'
,
`del_flag`
CHAR
(
1
)
DEFAULT
NULL
COMMENT
'删除标识'
,
`update_by`
VARCHAR
(
64
)
NOT
NULL
COMMENT
'更新人'
,
`create_by`
VARCHAR
(
64
)
NOT
NULL
COMMENT
'创建人'
,
`tenant_id`
VARCHAR
(
64
)
DEFAULT
NULL
COMMENT
'租户id'
,
`update_by`
VARCHAR
(
64
)
NOT
NULL
COMMENT
'更新人'
,
PRIMARY
KEY
(
`id`
),
`tenant_id`
VARCHAR
(
64
)
DEFAULT
NULL
COMMENT
'租户id'
,
KEY
`index_elder_id`
(
`elder_id`
)
USING
BTREE
PRIMARY
KEY
(
`id`
),
)
ENGINE
=
INNODB
DEFAULT
CHARSET
=
utf8mb4
ROW_FORMAT
=
COMPACT
COMMENT
=
'长者每天睡觉记录'
;
KEY
`index_elder_id`
(
`elder_id`
)
USING
BTREE
)
ENGINE
=
INNODB
DEFAULT
CHARSET
=
utf8mb4
ROW_FORMAT
=
COMPACT
COMMENT
=
'长者每天睡觉记录'
;
CREATE
TABLE
`plat_elder_sleep_analysis`
(
CREATE
TABLE
`plat_elder_sleep_analysis`
`id`
VARCHAR
(
64
)
NOT
NULL
COMMENT
'id'
,
(
`elder_id`
VARCHAR
(
64
)
NOT
NULL
COMMENT
'长者id'
,
`id`
VARCHAR
(
64
)
NOT
NULL
COMMENT
'id'
,
`sleep_score`
VARCHAR
(
64
)
DEFAULT
NULL
COMMENT
'睡眠评分'
,
`elder_id`
VARCHAR
(
64
)
NOT
NULL
COMMENT
'长者id'
,
`sleep_result`
VARCHAR
(
64
)
DEFAULT
NULL
COMMENT
'睡眠结果'
,
`sleep_score`
VARCHAR
(
64
)
DEFAULT
NULL
COMMENT
'睡眠评分'
,
`sleep_time`
VARCHAR
(
64
)
DEFAULT
NULL
COMMENT
'睡眠时长'
,
`sleep_result`
VARCHAR
(
64
)
DEFAULT
NULL
COMMENT
'睡眠结果'
,
`rest_time`
VARCHAR
(
64
)
DEFAULT
NULL
COMMENT
'休息时长'
,
`sleep_time`
VARCHAR
(
64
)
DEFAULT
NULL
COMMENT
'睡眠时长'
,
`sleep_evaluate`
VARCHAR
(
64
)
DEFAULT
NULL
COMMENT
'评价'
,
`rest_time`
VARCHAR
(
64
)
DEFAULT
NULL
COMMENT
'休息时长'
,
`current_date`
VARCHAR
(
64
)
DEFAULT
NULL
COMMENT
'当前日期 yyyy-mm-dd'
,
`sleep_evaluate`
VARCHAR
(
64
)
DEFAULT
NULL
COMMENT
'评价'
,
`create_date`
datetime
NOT
NULL
COMMENT
'创建时间'
,
`current_date`
VARCHAR
(
64
)
DEFAULT
NULL
COMMENT
'当前日期 yyyy-mm-dd'
,
`update_date`
datetime
NOT
NULL
COMMENT
'更新时间'
,
`create_date`
datetime
NOT
NULL
COMMENT
'创建时间'
,
`del_flag`
CHAR
(
1
)
DEFAULT
NULL
COMMENT
'删除标识'
,
`update_date`
datetime
NOT
NULL
COMMENT
'更新时间'
,
`create_by`
VARCHAR
(
64
)
NOT
NULL
COMMENT
'创建人'
,
`del_flag`
CHAR
(
1
)
DEFAULT
NULL
COMMENT
'删除标识'
,
`update_by`
VARCHAR
(
64
)
NOT
NULL
COMMENT
'更新人'
,
`create_by`
VARCHAR
(
64
)
NOT
NULL
COMMENT
'创建人'
,
`tenant_id`
VARCHAR
(
64
)
DEFAULT
NULL
COMMENT
'租户id'
,
`update_by`
VARCHAR
(
64
)
NOT
NULL
COMMENT
'更新人'
,
PRIMARY
KEY
(
`id`
),
`tenant_id`
VARCHAR
(
64
)
DEFAULT
NULL
COMMENT
'租户id'
,
KEY
`index_elder_id`
(
`elder_id`
)
USING
BTREE
PRIMARY
KEY
(
`id`
),
)
ENGINE
=
INNODB
DEFAULT
CHARSET
=
utf8mb4
ROW_FORMAT
=
COMPACT
COMMENT
=
'长者每天睡觉分析'
;
KEY
`index_elder_id`
(
`elder_id`
)
USING
BTREE
)
ENGINE
=
INNODB
DEFAULT
CHARSET
=
utf8mb4
ROW_FORMAT
=
COMPACT
COMMENT
=
'长者每天睡觉分析'
;
CREATE
TABLE
`plat_elder_report_month`
(
`id`
varchar
(
64
)
NOT
NULL
COMMENT
'id'
,
day
date
NOT
NULL
COMMENT
'日期'
,
sleep_result
varchar
(
64
)
NOT
NULL
COMMENT
'睡眠结果'
,
`create_by`
varchar
(
64
)
DEFAULT
NULL
COMMENT
'创建者'
,
`create_date`
datetime
DEFAULT
NULL
COMMENT
'创建时间'
,
`update_by`
varchar
(
64
)
DEFAULT
NULL
COMMENT
'更新者'
,
`update_date`
datetime
DEFAULT
NULL
COMMENT
'更新时间'
,
del_flag
char
(
1
)
not
null
comment
' 删除标志 0否 1是 '
,
`tenant_id`
varchar
(
64
)
DEFAULT
NULL
COMMENT
' 租户id '
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'长者月报'
;
db/plat
A
uth.sql
→
db/plat
-a
uth.sql
View file @
371e4185
File moved
saas-module/src/main/java/com/makeit/controller/saas/SaasUserController.java
View file @
371e4185
...
@@ -143,7 +143,7 @@ public class SaasUserController {
...
@@ -143,7 +143,7 @@ public class SaasUserController {
JSONObject
jsonObject
=
new
JSONObject
();
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"sysUserLoginVO"
,
sysUserLoginVO
);
jsonObject
.
put
(
"sysUserLoginVO"
,
sysUserLoginVO
);
jsonObject
.
put
(
"wechatUserInfo"
,
wechatUserInfo
);
jsonObject
.
put
(
"wechatUserInfo"
,
wechatUserInfo
);
jsonObject
.
put
(
"saasUser"
,
s
ysUserLoginVO
);
jsonObject
.
put
(
"saasUser"
,
s
aasUser
);
return
ApiResponseUtils
.
success
(
jsonObject
);
return
ApiResponseUtils
.
success
(
jsonObject
);
}
}
...
...
server-common/src/main/java/com/makeit/utils/user/ThreadLocalUserUtil.java
View file @
371e4185
...
@@ -80,7 +80,7 @@ public class ThreadLocalUserUtil {
...
@@ -80,7 +80,7 @@ public class ThreadLocalUserUtil {
WechatUserInfo
wechatUserInfo
=
THREAD_LOCAL_WECHAT_USER
.
get
();
WechatUserInfo
wechatUserInfo
=
THREAD_LOCAL_WECHAT_USER
.
get
();
if
(
wechatUserInfo
==
null
)
{
if
(
wechatUserInfo
==
null
)
{
wechatUserInfo
=
TokenUtil
.
getWechatUserDetail
();
wechatUserInfo
=
TokenUtil
.
getWechatUserDetail
();
THREAD_LOCAL_WECHAT_USER
.
set
(
wechatUserInfo
);
//
THREAD_LOCAL_WECHAT_USER.set(wechatUserInfo);
}
}
return
wechatUserInfo
;
return
wechatUserInfo
;
}
}
...
...
server-module/src/main/java/com/makeit/config/SwaggerPlatformConfig.java
View file @
371e4185
...
@@ -63,7 +63,9 @@ public class SwaggerPlatformConfig {
...
@@ -63,7 +63,9 @@ public class SwaggerPlatformConfig {
ApiSelectorBuilder
builder
=
docket
.
select
();
ApiSelectorBuilder
builder
=
docket
.
select
();
//api过滤
//api过滤
builder
=
builder
.
apis
(
builder
=
builder
.
apis
(
RequestHandlerSelectors
.
basePackage
(
"com.makeit.module.controller.wechat"
)
RequestHandlerSelectors
.
basePackage
(
"com.makeit.module.controller"
)
.
and
(
RequestHandlerSelectors
.
basePackage
(
"com.makeit.module.controller.wechat"
).
negate
())
.
and
(
RequestHandlerSelectors
.
basePackage
(
"com.makeit.module.controller.children"
).
negate
())
);
);
return
builder
.
build
();
return
builder
.
build
();
}
}
...
...
server-module/src/main/java/com/makeit/module/controller/children/org/PlatOrgChildrenController.java
View file @
371e4185
...
@@ -21,7 +21,7 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -21,7 +21,7 @@ import org.springframework.web.bind.annotation.RestController;
import
java.util.List
;
import
java.util.List
;
@Api
(
tags
=
"子女端-组织"
)
@Api
(
tags
=
"子女端
小程序
-组织"
)
@RestController
@RestController
@RequestMapping
(
"/children/plat/org"
)
@RequestMapping
(
"/children/plat/org"
)
public
class
PlatOrgChildrenController
{
public
class
PlatOrgChildrenController
{
...
...
server-service/src/main/java/com/makeit/service/platform/alarm/alarmStrategy/BehaviorAlarm.java
View file @
371e4185
...
@@ -105,7 +105,7 @@ public class BehaviorAlarm implements IAlarm{
...
@@ -105,7 +105,7 @@ public class BehaviorAlarm implements IAlarm{
}
}
//保存每次进入空间时长
//保存每次进入空间时长
saveDayDurationRecord
(
platAlarmCheckDTO
,
alarmRedisDTO
);
saveDayDurationRecord
(
platAlarmCheckDTO
,
alarmRedisDTO
);
RedisUtil
.
set
(
RedisConst
.
ALARM_DEVICE_ID
+
deviceId
,
null
);
RedisUtil
.
delete
(
RedisConst
.
ALARM_DEVICE_ID
+
deviceId
);
}
}
}
}
...
...
server-service/src/main/java/com/makeit/service/platform/device/impl/PlatDeviceServiceImpl.java
View file @
371e4185
...
@@ -142,11 +142,15 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
...
@@ -142,11 +142,15 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
other
=
new
PlatDeviceOther
();
other
=
new
PlatDeviceOther
();
}
}
String
otherId
=
other
.
getId
();
BeanUtils
.
copyProperties
(
dto
,
db
);
BeanUtils
.
copyProperties
(
dto
,
db
);
db
.
setId
(
id
);
db
.
setId
(
id
);
BeanUtils
.
copyProperties
(
dto
,
other
);
BeanUtils
.
copyProperties
(
dto
,
other
);
other
.
setId
(
otherId
);
other
.
setDeviceId
(
id
);
other
.
setDeviceId
(
id
);
other
.
setOriDeviceId
(
db
.
getOriDeviceId
());
updateById
(
db
);
updateById
(
db
);
...
@@ -169,11 +173,15 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
...
@@ -169,11 +173,15 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
other
=
new
PlatDeviceOther
();
other
=
new
PlatDeviceOther
();
}
}
String
otherId
=
other
.
getId
();
BeanUtils
.
copyProperties
(
dto
,
db
);
BeanUtils
.
copyProperties
(
dto
,
db
);
db
.
setId
(
id
);
db
.
setId
(
id
);
BeanUtils
.
copyProperties
(
dto
,
other
);
BeanUtils
.
copyProperties
(
dto
,
other
);
other
.
setId
(
otherId
);
other
.
setDeviceId
(
id
);
other
.
setDeviceId
(
id
);
other
.
setOriDeviceId
(
db
.
getOriDeviceId
());
updateById
(
db
);
updateById
(
db
);
...
...
server-web/src/main/resources/application-dev.yml
View file @
371e4185
server
:
server
:
port
:
8888
port
:
10005
servlet
:
servlet
:
encoding
:
encoding
:
charset
:
UTF-8
charset
:
UTF-8
...
@@ -123,12 +123,12 @@ mqtt:
...
@@ -123,12 +123,12 @@ mqtt:
wx
:
wx
:
miniapp
:
miniapp
:
config
:
config
:
appid
:
wx48720402e3fdbe0f
#微信小程序的appid
secret
:
2ebae648f45716e70c75b7d78d0660cc
#微信小程序的Secret
# appid: wx48720402e3fdbe0f #微信小程序的appid
# appid: wx48720402e3fdbe0f #微信小程序的appid
# secret: 2ebae648f45716e70c75b7d78d0660cc #微信小程序的Secret
# secret: 2ebae648f45716e70c75b7d78d0660cc #微信小程序的Secret
appid
:
wx5138507da6bf5709
#微信小程序的appid
secret
:
2cdf04b11dce20f48402a1fef1cc9842
#微信小程序的Secret
token
:
#微信小程序消息服务器配置的token
token
:
#微信小程序消息服务器配置的token
aesKey
:
#微信小程序消息服务器配置的EncodingAESKey
aesKey
:
#微信小程序消息服务器配置的EncodingAESKey
msgDataFormat
:
JSON
msgDataFormat
:
JSON
...
...
server-web/src/main/resources/application-test.yml
View file @
371e4185
...
@@ -122,6 +122,10 @@ wx:
...
@@ -122,6 +122,10 @@ wx:
config
:
config
:
appid
:
wx48720402e3fdbe0f
#微信小程序的appid
appid
:
wx48720402e3fdbe0f
#微信小程序的appid
secret
:
2ebae648f45716e70c75b7d78d0660cc
#微信小程序的Secret
secret
:
2ebae648f45716e70c75b7d78d0660cc
#微信小程序的Secret
# appid: wx48720402e3fdbe0f #微信小程序的appid
# secret: 2ebae648f45716e70c75b7d78d0660cc #微信小程序的Secret
token
:
#微信小程序消息服务器配置的token
token
:
#微信小程序消息服务器配置的token
aesKey
:
#微信小程序消息服务器配置的EncodingAESKey
aesKey
:
#微信小程序消息服务器配置的EncodingAESKey
msgDataFormat
:
JSON
msgDataFormat
:
JSON
...
...
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