Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gxpt_ht
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
pseer
gxpt_ht
Commits
12b51259
Commit
12b51259
authored
Sep 26, 2024
by
YG8429
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
人工修改密码,小程序统计时长接口
parent
a927ce9e
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
51 additions
and
7 deletions
+51
-7
DeviceController.java
...in/java/share/web/controller/system/DeviceController.java
+2
-2
DurationLogController.java
...va/share/web/controller/system/DurationLogController.java
+6
-5
DeviceService.java
...tem/src/main/java/share/system/service/DeviceService.java
+3
-0
DurationLogService.java
...rc/main/java/share/system/service/DurationLogService.java
+3
-0
DeviceServiceImpl.java
...ain/java/share/system/service/impl/DeviceServiceImpl.java
+26
-0
DurationLogServiceImpl.java
...ava/share/system/service/impl/DurationLogServiceImpl.java
+11
-0
No files found.
share-admin/src/main/java/share/web/controller/system/DeviceController.java
View file @
12b51259
...
@@ -99,8 +99,8 @@ public class DeviceController extends BaseController
...
@@ -99,8 +99,8 @@ public class DeviceController extends BaseController
@PostMapping
(
value
=
"/updateDevicePassword"
)
@PostMapping
(
value
=
"/updateDevicePassword"
)
public
AjaxResult
updateDevicePassword
(
@RequestBody
Device
device
)
public
AjaxResult
updateDevicePassword
(
@RequestBody
Device
device
)
{
{
device
.
setDevPsw
(
device
.
getNewDevPsw
()
);
AjaxResult
ajaxResult
=
deviceService
.
updateRoomPassword
(
device
);
return
toAjax
(
deviceService
.
updateDevice
(
device
))
;
return
ajaxResult
;
}
}
/**
/**
...
...
share-front/src/main/java/share/web/controller/system/DurationLogController.java
View file @
12b51259
package
share
.
web
.
controller
.
system
;
package
share
.
web
.
controller
.
system
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
@@ -13,6 +14,7 @@ import share.system.domain.vo.DurationLogVo;
...
@@ -13,6 +14,7 @@ import share.system.domain.vo.DurationLogVo;
import
share.system.domain.vo.FrontTokenComponent
;
import
share.system.domain.vo.FrontTokenComponent
;
import
share.system.service.DurationLogService
;
import
share.system.service.DurationLogService
;
import
java.math.BigDecimal
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -47,12 +49,11 @@ public class DurationLogController extends BaseController {
...
@@ -47,12 +49,11 @@ public class DurationLogController extends BaseController {
return
success
(
list
);
return
success
(
list
);
}
}
@GetMapping
(
"/
queryDurationType
"
)
@GetMapping
(
"/
sumVariableDuration
"
)
public
AjaxResult
queryDurationType
(
DurationLogVo
durationLog
)
{
public
AjaxResult
sumVariableDuration
(
DurationLogVo
durationLog
)
{
SConsumer
user
=
FrontTokenComponent
.
getWxSConsumerEntry
();
SConsumer
user
=
FrontTokenComponent
.
getWxSConsumerEntry
();
durationLog
.
setConsumerId
(
user
.
getId
());
durationLog
.
setConsumerId
(
user
.
getId
());
durationLog
.
setDurationType
(
DurationTypeEnum
.
SHARE
.
getCode
());
BigDecimal
sumVariableDuration
=
durationLogService
.
sumVariableDuration
(
durationLog
);
List
<
DurationLogVo
>
list
=
durationLogService
.
selectDurationTypeList
(
durationLog
);
return
success
(
sumVariableDuration
);
return
success
(
list
);
}
}
}
}
share-system/src/main/java/share/system/service/DeviceService.java
View file @
12b51259
package
share
.
system
.
service
;
package
share
.
system
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
share.common.core.domain.AjaxResult
;
import
share.common.core.page.TableDataInfo
;
import
share.common.core.page.TableDataInfo
;
import
share.system.domain.Device
;
import
share.system.domain.Device
;
import
share.system.domain.DeviceDto
;
import
share.system.domain.DeviceDto
;
...
@@ -87,4 +88,6 @@ public interface DeviceService extends IService<Device>
...
@@ -87,4 +88,6 @@ public interface DeviceService extends IService<Device>
TableDataInfo
devicePage
(
DeviceDto
device
);
TableDataInfo
devicePage
(
DeviceDto
device
);
boolean
updateDeviceDoorLockPassword
(
Integer
validTime
,
Long
storeId
);
boolean
updateDeviceDoorLockPassword
(
Integer
validTime
,
Long
storeId
);
AjaxResult
updateRoomPassword
(
Device
device
);
}
}
share-system/src/main/java/share/system/service/DurationLogService.java
View file @
12b51259
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import
share.system.domain.DurationLog
;
import
share.system.domain.DurationLog
;
import
share.system.domain.vo.DurationLogVo
;
import
share.system.domain.vo.DurationLogVo
;
import
java.math.BigDecimal
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -62,4 +63,6 @@ public interface DurationLogService extends IService<DurationLog> {
...
@@ -62,4 +63,6 @@ public interface DurationLogService extends IService<DurationLog> {
public
int
deleteDurationLogById
(
Long
id
);
public
int
deleteDurationLogById
(
Long
id
);
List
<
DurationLogVo
>
selectDurationTypeList
(
DurationLogVo
durationLog
);
List
<
DurationLogVo
>
selectDurationTypeList
(
DurationLogVo
durationLog
);
BigDecimal
sumVariableDuration
(
DurationLogVo
durationLog
);
}
}
share-system/src/main/java/share/system/service/impl/DeviceServiceImpl.java
View file @
12b51259
...
@@ -12,6 +12,7 @@ import org.slf4j.LoggerFactory;
...
@@ -12,6 +12,7 @@ import org.slf4j.LoggerFactory;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
share.common.core.domain.AjaxResult
;
import
share.common.core.page.PageDomain
;
import
share.common.core.page.PageDomain
;
import
share.common.core.page.TableDataInfo
;
import
share.common.core.page.TableDataInfo
;
import
share.common.core.page.TableSupport
;
import
share.common.core.page.TableSupport
;
...
@@ -259,6 +260,31 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
...
@@ -259,6 +260,31 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
}
}
@Override
@Override
public
AjaxResult
updateRoomPassword
(
Device
device
)
{
Integer
validTime
=
365
;
Date
now
=
DateUtil
.
date
();
String
startTime
=
DateUtil
.
formatDateTime
(
now
);
String
endTime
=
DateUtil
.
formatDateTime
(
DateUtil
.
offsetDay
(
now
,
validTime
));
SRoom
room
=
new
SRoom
();
room
.
setId
(
device
.
getRoomId
());
room
.
setPassword
(
device
.
getNewDevPsw
());
roomService
.
updateById
(
room
);
// 设备密码修改记录
DevicePasswordLog
log
=
new
DevicePasswordLog
();
log
.
setRoomId
(
device
.
getRoomId
());
log
.
setPassword
(
device
.
getNewDevPsw
());
log
.
setDevId
(
device
.
getDevId
());
log
.
setStartTime
(
now
);
log
.
setEndTime
(
DateUtil
.
offsetDay
(
now
,
validTime
));
log
.
setCreateTime
(
now
);
devicePasswordLogService
.
insertDevicePasswordLog
(
log
);
deviceOpService
.
setDevicePassword
(
device
.
getRoomId
(),
device
.
getNewDevPsw
(),
startTime
,
endTime
,
"13800000000"
,
OpTypeEnum
.
OP_DEVICE_PASSWORD
.
getCode
(),
DeviceOpSourceEnum
.
DEVICE_SOURCE_40
.
getCode
());
return
AjaxResult
.
success
();
}
@Override
public
List
<
Device
>
notRoomIdList
(
Device
device
)
{
public
List
<
Device
>
notRoomIdList
(
Device
device
)
{
SRoom
room
=
roomMapper
.
selectSRoomById
(
device
.
getRoomId
());
SRoom
room
=
roomMapper
.
selectSRoomById
(
device
.
getRoomId
());
if
(
room
!=
null
)
{
if
(
room
!=
null
)
{
...
...
share-system/src/main/java/share/system/service/impl/DurationLogServiceImpl.java
View file @
12b51259
...
@@ -11,6 +11,7 @@ import share.system.domain.vo.DurationLogVo;
...
@@ -11,6 +11,7 @@ import share.system.domain.vo.DurationLogVo;
import
share.system.mapper.DurationLogMapper
;
import
share.system.mapper.DurationLogMapper
;
import
share.system.service.DurationLogService
;
import
share.system.service.DurationLogService
;
import
java.math.BigDecimal
;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.List
;
...
@@ -99,4 +100,14 @@ public class DurationLogServiceImpl extends ServiceImpl<DurationLogMapper, Durat
...
@@ -99,4 +100,14 @@ public class DurationLogServiceImpl extends ServiceImpl<DurationLogMapper, Durat
return
durationLogMapper
.
selectDurationLogList
(
durationLog
);
return
durationLogMapper
.
selectDurationLogList
(
durationLog
);
}
}
@Override
public
BigDecimal
sumVariableDuration
(
DurationLogVo
durationLog
)
{
LambdaQueryWrapper
<
DurationLog
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
DurationLog:
:
getConsumerId
,
durationLog
.
getConsumerId
());
queryWrapper
.
eq
(
DurationLog:
:
getDurationType
,
DurationTypeEnum
.
SHARE
.
getCode
());
return
durationLogMapper
.
selectList
(
queryWrapper
)
.
stream
().
map
(
DurationLog:
:
getVariableDuration
)
.
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
}
}
}
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