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
a88ffbac
Commit
a88ffbac
authored
Apr 12, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
保洁管理增加门店一健领取保洁记录
parent
68247ee2
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
27 deletions
+42
-27
SCleanRecordsController.java
.../share/web/controller/system/SCleanRecordsController.java
+10
-24
ISCleanRecordsService.java
...main/java/share/system/service/ISCleanRecordsService.java
+5
-3
SCleanRecordsServiceImpl.java
...a/share/system/service/impl/SCleanRecordsServiceImpl.java
+27
-0
No files found.
share-front/src/main/java/share/web/controller/system/SCleanRecordsController.java
View file @
a88ffbac
package
share
.
web
.
controller
.
system
;
package
share
.
web
.
controller
.
system
;
import
java.util.List
;
import
javax.servlet.http.HttpServletResponse
;
import
cn.hutool.core.date.DateUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.security.access.prepost.PreAuthorize
;
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.*
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
share.common.annotation.Log
;
import
share.common.core.controller.BaseController
;
import
share.common.core.controller.BaseController
;
import
share.common.core.domain.AjaxResult
;
import
share.common.core.domain.AjaxResult
;
import
share.common.enums.BusinessType
;
import
share.common.core.page.TableDataInfo
;
import
share.common.enums.CleaningStatusEnum
;
import
share.common.enums.PositionEnum
;
import
share.common.enums.RoleTypeEnum
;
import
share.system.domain.SCleanRecords
;
import
share.system.domain.SCleanRecords
;
import
share.system.domain.SConsumer
;
import
share.system.domain.SConsumer
;
import
share.system.domain.SStoreConsumer
;
import
share.system.domain.vo.FrontTokenComponent
;
import
share.system.domain.vo.FrontTokenComponent
;
import
share.system.domain.vo.SCleanRecordsVo
;
import
share.system.domain.vo.SCleanRecordsVo
;
import
share.system.mapper.SStoreConsumerMapper
;
import
share.system.service.DeviceOpService
;
import
share.system.service.ISCleanRecordsService
;
import
share.system.service.ISCleanRecordsService
;
import
share.common.utils.poi.ExcelUtil
;
import
share.common.core.page.TableDataInfo
;
import
java.util.List
;
/**
/**
* 保洁记录Controller
* 保洁记录Controller
...
@@ -141,5 +121,11 @@ public class SCleanRecordsController extends BaseController
...
@@ -141,5 +121,11 @@ public class SCleanRecordsController extends BaseController
return
success
(
sCleanRecordsService
.
getByCleanerId
());
return
success
(
sCleanRecordsService
.
getByCleanerId
());
}
}
//领取门店下所有房间的保洁记录
@GetMapping
(
"/startCleanByStore"
)
public
AjaxResult
startCleanByStore
(
Long
storeId
)
{
return
success
(
sCleanRecordsService
.
startCleanByStore
(
storeId
));
}
}
}
share-system/src/main/java/share/system/service/ISCleanRecordsService.java
View file @
a88ffbac
package
share
.
system
.
service
;
package
share
.
system
.
service
;
import
java.util.List
;
import
java.util.Map
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
share.common.core.page.TableDataInfo
;
import
share.common.core.page.TableDataInfo
;
import
share.system.domain.SCleanRecords
;
import
share.system.domain.SCleanRecords
;
import
share.system.domain.vo.SCleanRecordsVo
;
import
share.system.domain.vo.SCleanRecordsVo
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* 保洁记录Service接口
* 保洁记录Service接口
*
*
...
@@ -100,4 +100,6 @@ public interface ISCleanRecordsService extends IService<SCleanRecords>
...
@@ -100,4 +100,6 @@ public interface ISCleanRecordsService extends IService<SCleanRecords>
* @return
* @return
*/
*/
int
endCleanRecords
(
SCleanRecords
sCleanRecords
);
int
endCleanRecords
(
SCleanRecords
sCleanRecords
);
int
startCleanByStore
(
Long
storeId
);
}
}
share-system/src/main/java/share/system/service/impl/SCleanRecordsServiceImpl.java
View file @
a88ffbac
...
@@ -2,6 +2,7 @@ package share.system.service.impl;
...
@@ -2,6 +2,7 @@ package share.system.service.impl;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.date.DateUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -473,6 +474,32 @@ public class SCleanRecordsServiceImpl extends ServiceImpl<SCleanRecordsMapper,SC
...
@@ -473,6 +474,32 @@ public class SCleanRecordsServiceImpl extends ServiceImpl<SCleanRecordsMapper,SC
return
index
;
return
index
;
}
}
@Override
public
int
startCleanByStore
(
Long
storeId
)
{
SConsumer
user
=
FrontTokenComponent
.
getWxSConsumerEntry
();
if
(!
user
.
getRoleType
().
equals
(
RoleTypeEnum
.
CLEANER
.
getCode
()))
{
throw
new
RuntimeException
(
"当前用户不是店员"
);
}
List
<
Long
>
longs
=
storeConsumerMapper
.
selectByConsumerId
(
user
.
getId
(),
PositionEnum
.
CLEANER
.
getCode
());
if
(
CollectionUtils
.
isEmpty
(
longs
))
{
throw
new
RuntimeException
(
"当前用户不是保洁人员"
);
}
LambdaQueryWrapper
<
SCleanRecords
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
SCleanRecords:
:
getStoreId
,
storeId
);
queryWrapper
.
eq
(
SCleanRecords:
:
getStatus
,
CleaningStatusEnum
.
UNCLEAN
.
getCode
());
List
<
SCleanRecords
>
sCleanRecords
=
baseMapper
.
selectList
(
queryWrapper
);
if
(
CollectionUtils
.
isEmpty
(
sCleanRecords
))
{
throw
new
RuntimeException
(
"当前门店没有未保洁的保洁任务"
);
}
LambdaUpdateWrapper
<
SCleanRecords
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
updateWrapper
.
in
(
SCleanRecords:
:
getId
,
sCleanRecords
.
stream
().
map
(
SCleanRecords:
:
getId
).
collect
(
Collectors
.
toList
()));
SCleanRecords
cleanRecords
=
new
SCleanRecords
();
cleanRecords
.
setStatus
(
CleaningStatusEnum
.
CLEANING
.
getCode
());
cleanRecords
.
setStartDate
(
DateUtil
.
date
());
cleanRecords
.
setConsumerId
(
user
.
getId
());
return
baseMapper
.
update
(
cleanRecords
,
updateWrapper
);
}
private
void
isCleaner
(
SCleanRecords
sCleanRecords
)
{
private
void
isCleaner
(
SCleanRecords
sCleanRecords
)
{
SConsumer
user
=
FrontTokenComponent
.
getWxSConsumerEntry
();
SConsumer
user
=
FrontTokenComponent
.
getWxSConsumerEntry
();
if
(!
user
.
getRoleType
().
equals
(
RoleTypeEnum
.
CLEANER
.
getCode
()))
{
if
(!
user
.
getRoleType
().
equals
(
RoleTypeEnum
.
CLEANER
.
getCode
()))
{
...
...
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