| | |
| | | import com.doumee.dao.business.CompanyMapper; |
| | | import com.doumee.dao.business.CompanyMemberMapper; |
| | | import com.doumee.dao.business.MemberMapper; |
| | | import com.doumee.dao.business.model.Category; |
| | | import com.doumee.dao.business.model.Company; |
| | | import com.doumee.dao.business.model.CompanyMember; |
| | | import com.doumee.dao.business.model.Member; |
| | |
| | | |
| | | @Override |
| | | public void updateById(Member member) { |
| | | memberMapper.updateById(member); |
| | | if( member.getId() == null){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | memberMapper.update(null,new UpdateWrapper<Member>().lambda() |
| | | .eq(Member::getId,member.getId() ) |
| | | .set(Member::getSex,member.getSex() ) |
| | | .set(Member::getPhone,member.getPhone() ) |
| | | .set(Member::getRemark,member.getRemark() ) |
| | | .set(Member::getEmail,member.getEmail() ) |
| | | .set(Member::getEditDate,new Date()) |
| | | .set(Member::getEditor,user.getId()) |
| | | ); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | String token = systemDictDataBiz.queryByCode(Constants.QYWX,Constants.QYWX_TOKEN).getCode(); |
| | | //根据code换区企业微信ID |
| | | QywxBaseResponse<String> qwIdBaseResponse= null;// QywxUtil.getUserInfoByCode(token,dto.getCode()); |
| | | // if(Objects.isNull(qwIdBaseResponse)||Objects.isNull(qwIdBaseResponse.getErrcode())){ |
| | | // throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"企业微信登录码解析失败,请联系管理员"); |
| | | // } |
| | | // if(Constants.equalsInteger(qwIdBaseResponse.getErrcode(),Constants.ZERO)){ |
| | | // throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"企业微信登录失败:"+qwIdBaseResponse.getErrmsg()); |
| | | // } |
| | | // if(Objects.isNull(qwIdBaseResponse.getData())){ |
| | | // throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"企业微信用户信息解析失败,请联系管理员"); |
| | | // } |
| | | // String qwId = qwIdBaseResponse.getData(); |
| | | String qwId = dto.getCode(); |
| | | QywxBaseResponse<String> qwIdBaseResponse= QywxUtil.getUserInfoByCode(token,dto.getCode()); |
| | | if(Objects.isNull(qwIdBaseResponse)||Objects.isNull(qwIdBaseResponse.getErrcode())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"企业微信登录码解析失败,请联系管理员"); |
| | | } |
| | | if(!Constants.equalsInteger(qwIdBaseResponse.getErrcode(),Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"企业微信登录失败:"+qwIdBaseResponse.getErrmsg()); |
| | | } |
| | | if(Objects.isNull(qwIdBaseResponse.getData())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"企业微信用户信息解析失败,请联系管理员"); |
| | | } |
| | | String qwId = qwIdBaseResponse.getData(); |
| | | // String qwId = dto.getCode(); |
| | | Member member = memberMapper.selectOne(new QueryWrapper<Member>().lambda().eq(Member::getQwId,qwId).eq(Member::getIsdeleted,Constants.ZERO).last(" limit 1 ")); |
| | | if(Objects.isNull(member)){ |
| | | //根据企业微信ID 查询用户信息 |
| | |
| | | if(Objects.isNull(qywxUserInfoResponse)||Objects.isNull(qywxUserInfoResponse.getErrcode())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"企业微信获取用户信息解析失败,请联系管理员"); |
| | | } |
| | | if(Constants.equalsInteger(qywxUserInfoResponse.getErrcode(),Constants.ZERO)){ |
| | | if(!Constants.equalsInteger(qywxUserInfoResponse.getErrcode(),Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"企业微信获取用户信息失败:"+qwIdBaseResponse.getErrmsg()); |
| | | } |
| | | member = new Member(); |