| | |
| | | import com.mzl.flower.service.system.UserService; |
| | | import com.mzl.flower.utils.DateUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import java.io.FileInputStream; |
| | | import java.io.InputStream; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | |
| | | if(user == null){ |
| | | throw new ValidationException("用户不存在"); |
| | | } |
| | | |
| | | // 查看当前合伙人的手机号是否被占用 |
| | | |
| | | final List<User> userList = userMapper.selectList(new LambdaQueryWrapper<User>() |
| | | .eq(User::getDeleted, 0) |
| | | .eq(User::getType, Constants.USER_TYPE.partner.name()) |
| | | .eq(User::getLoginName, dto.getUsername())); |
| | | if(CollectionUtils.isNotEmpty(userList)){ |
| | | throw new ValidationException("用户已存在"); |
| | | } |
| | | |
| | | partner.setContactTel(dto.getUsername()); |
| | | partner.update(SecurityUtils.getUserId()); |
| | | partnerMapper.updateById(partner); |
| | |
| | | userMapper.updateById(user); |
| | | |
| | | } |
| | | |
| | | } |