Commit 4a451b7c by 吕明尚

保洁添加昵称没有的问题

parent b28415d1
......@@ -9,6 +9,7 @@ import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.codec.digest.DigestUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -78,6 +79,12 @@ public class SConsumerServiceImpl extends ServiceImpl<SConsumerMapper, SConsumer
@Override
public int insertSConsumer(SConsumer sConsumer)
{
QueryWrapper<SConsumer> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("phone", sConsumer.getPhone());
SConsumer consumer = baseMapper.selectOne(queryWrapper);
if (ObjectUtil.isNotEmpty(consumer)) {
throw new BaseException("该手机号已注册");
}
sConsumer.setAccount(sConsumer.getPhone());
return baseMapper.insertSConsumer(sConsumer);
}
......@@ -240,6 +247,7 @@ public class SConsumerServiceImpl extends ServiceImpl<SConsumerMapper, SConsumer
// 存在用户设置未保洁人员,不存在新增保洁人员
if (list.size() > 0) {
SConsumer consumer = list.get(0);
consumer.setNickName(sConsumer.getNickName());
consumer.setRoleType(RoleTypeEnum.CLEANER.getCode());
return baseMapper.updateSConsumer(consumer);
} else {
......
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