|  |  |  | 
|---|
|  |  |  | import lombok.extern.slf4j.Slf4j; | 
|---|
|  |  |  | import org.apache.commons.lang3.StringUtils; | 
|---|
|  |  |  | import org.springframework.beans.BeanUtils; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.stereotype.Service; | 
|---|
|  |  |  | import org.springframework.transaction.annotation.Transactional; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Resource | 
|---|
|  |  |  | private BaseService baseService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private UserService userService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public PartnerService(PartnerMapper partnerMapper, UserMapper userMapper, WxMaService maService, UploadService uploadService) { | 
|---|
|  |  |  | this.partnerMapper = partnerMapper; | 
|---|
|  |  |  | 
|---|
|  |  |  | partnerMapper.updateById(partner); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Transactional | 
|---|
|  |  |  | public void phoneUpdate(UpdatePhoneDTO dto) { | 
|---|
|  |  |  | Partner partner = partnerMapper.selectById(dto.getId()); | 
|---|
|  |  |  | if(partner==null){ | 
|---|
|  |  |  | throw new ValidationException("合伙人信息未登记"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | User user = userService.getUserById(partner.getUserId()); | 
|---|
|  |  |  | if(user == null){ | 
|---|
|  |  |  | throw new ValidationException("用户不存在"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | partner.setContactTel(dto.getUsername()); | 
|---|
|  |  |  | partner.update(SecurityUtils.getUserId()); | 
|---|
|  |  |  | partnerMapper.updateById(partner); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | user.setTel(dto.getUsername()); | 
|---|
|  |  |  | user.setLoginName(dto.getUsername()); | 
|---|
|  |  |  | user.update(SecurityUtils.getUserId()); | 
|---|
|  |  |  | userMapper.updateById(user); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|