Commit d981eb90 by 吕明尚

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

parent 0d848ecd
...@@ -389,7 +389,9 @@ public class SCleanRecordsServiceImpl extends ServiceImpl<SCleanRecordsMapper,SC ...@@ -389,7 +389,9 @@ public class SCleanRecordsServiceImpl extends ServiceImpl<SCleanRecordsMapper,SC
@Override @Override
public int startCleanRecords(SCleanRecords sCleanRecords) { public int startCleanRecords(SCleanRecords sCleanRecords) {
isCleaner(sCleanRecords); SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
isCleaner(sCleanRecords, user);
sCleanRecords.setConsumerId(user.getId());
sCleanRecords.setStartDate(DateUtil.date()); sCleanRecords.setStartDate(DateUtil.date());
sCleanRecords.setStatus(CleaningStatusEnum.CLEANING.getCode()); sCleanRecords.setStatus(CleaningStatusEnum.CLEANING.getCode());
LambdaQueryWrapper<SCleanRecords> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<SCleanRecords> queryWrapper = new LambdaQueryWrapper<>();
...@@ -453,7 +455,8 @@ public class SCleanRecordsServiceImpl extends ServiceImpl<SCleanRecordsMapper,SC ...@@ -453,7 +455,8 @@ public class SCleanRecordsServiceImpl extends ServiceImpl<SCleanRecordsMapper,SC
@Override @Override
public int endCleanRecords(SCleanRecords sCleanRecords) { public int endCleanRecords(SCleanRecords sCleanRecords) {
isCleaner(sCleanRecords); SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
isCleaner(sCleanRecords, user);
sCleanRecords.setEndDate(DateUtil.date()); sCleanRecords.setEndDate(DateUtil.date());
sCleanRecords.setStatus(CleaningStatusEnum.CLEANED.getCode()); sCleanRecords.setStatus(CleaningStatusEnum.CLEANED.getCode());
SCleanRecords records = baseMapper.selectSCleanRecordsById(sCleanRecords.getId()); SCleanRecords records = baseMapper.selectSCleanRecordsById(sCleanRecords.getId());
...@@ -504,8 +507,7 @@ public class SCleanRecordsServiceImpl extends ServiceImpl<SCleanRecordsMapper,SC ...@@ -504,8 +507,7 @@ public class SCleanRecordsServiceImpl extends ServiceImpl<SCleanRecordsMapper,SC
return baseMapper.update(cleanRecords, updateWrapper); return baseMapper.update(cleanRecords, updateWrapper);
} }
private void isCleaner(SCleanRecords sCleanRecords) { private void isCleaner(SCleanRecords sCleanRecords, SConsumer user) {
SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
if (!user.getRoleType().equals(RoleTypeEnum.CLEANER.getCode())) { if (!user.getRoleType().equals(RoleTypeEnum.CLEANER.getCode())) {
throw new RuntimeException("当前用户不是店员"); throw new RuntimeException("当前用户不是店员");
} }
...@@ -517,7 +519,7 @@ public class SCleanRecordsServiceImpl extends ServiceImpl<SCleanRecordsMapper,SC ...@@ -517,7 +519,7 @@ public class SCleanRecordsServiceImpl extends ServiceImpl<SCleanRecordsMapper,SC
if (CollectionUtils.isEmpty(storeConsumer)) { if (CollectionUtils.isEmpty(storeConsumer)) {
throw new RuntimeException("当前用户不是保洁人员"); throw new RuntimeException("当前用户不是保洁人员");
} }
sCleanRecords.setConsumerId(user.getId());
} }
private void sendSms(Long storeId,SStore store, SRoom room) { 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