Commit d981eb90 by 吕明尚

结束保洁不修改保洁负责人员

parent 0d848ecd
......@@ -389,7 +389,9 @@ public class SCleanRecordsServiceImpl extends ServiceImpl<SCleanRecordsMapper,SC
@Override
public int startCleanRecords(SCleanRecords sCleanRecords) {
isCleaner(sCleanRecords);
SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
isCleaner(sCleanRecords, user);
sCleanRecords.setConsumerId(user.getId());
sCleanRecords.setStartDate(DateUtil.date());
sCleanRecords.setStatus(CleaningStatusEnum.CLEANING.getCode());
LambdaQueryWrapper<SCleanRecords> queryWrapper = new LambdaQueryWrapper<>();
......@@ -453,7 +455,8 @@ public class SCleanRecordsServiceImpl extends ServiceImpl<SCleanRecordsMapper,SC
@Override
public int endCleanRecords(SCleanRecords sCleanRecords) {
isCleaner(sCleanRecords);
SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
isCleaner(sCleanRecords, user);
sCleanRecords.setEndDate(DateUtil.date());
sCleanRecords.setStatus(CleaningStatusEnum.CLEANED.getCode());
SCleanRecords records = baseMapper.selectSCleanRecordsById(sCleanRecords.getId());
......@@ -504,8 +507,7 @@ public class SCleanRecordsServiceImpl extends ServiceImpl<SCleanRecordsMapper,SC
return baseMapper.update(cleanRecords, updateWrapper);
}
private void isCleaner(SCleanRecords sCleanRecords) {
SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
private void isCleaner(SCleanRecords sCleanRecords, SConsumer user) {
if (!user.getRoleType().equals(RoleTypeEnum.CLEANER.getCode())) {
throw new RuntimeException("当前用户不是店员");
}
......@@ -517,7 +519,7 @@ public class SCleanRecordsServiceImpl extends ServiceImpl<SCleanRecordsMapper,SC
if (CollectionUtils.isEmpty(storeConsumer)) {
throw new RuntimeException("当前用户不是保洁人员");
}
sCleanRecords.setConsumerId(user.getId());
}
private void sendSms(Long storeId,SStore store, SRoom room) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment