|
@@ -56,12 +56,9 @@ public class InvitationRecordServiceImpl extends ServiceImpl<InvitationRecordMap
|
|
|
vo.setCompanyName(project.getOwnerCompanyName());
|
|
|
User user = userMapper.selectOne(new QueryWrapper<User>().eq("head_imgurl", token));
|
|
|
User invitee = userMapper.selectById(invitationRecord.getInviteeId());
|
|
|
- if(null == user){
|
|
|
- msg.setError("当前角色涉及权限问题,请重新登录");
|
|
|
- return msg;
|
|
|
- }else{
|
|
|
+ if(null == token){
|
|
|
InvitationRecord record = invitationRecordMapper.selectOne(new QueryWrapper<InvitationRecord>()
|
|
|
- .eq("operator_id", user.getId())
|
|
|
+ .eq("operator_id", invitationRecord.getOperatorId())
|
|
|
.eq("project_id", invitationRecord.getProjectId())
|
|
|
.eq("invitee_id", invitationRecord.getInviteeId()));
|
|
|
if(null == record){
|
|
@@ -76,6 +73,28 @@ public class InvitationRecordServiceImpl extends ServiceImpl<InvitationRecordMap
|
|
|
BeanUtils.copyProperties(record,vo);
|
|
|
msg.data = vo;
|
|
|
}
|
|
|
+ }else{
|
|
|
+ if(null == user){
|
|
|
+ msg.setError("当前角色涉及权限问题,请重新登录");
|
|
|
+ return msg;
|
|
|
+ }else{
|
|
|
+ InvitationRecord record = invitationRecordMapper.selectOne(new QueryWrapper<InvitationRecord>()
|
|
|
+ .eq("operator_id", user.getId())
|
|
|
+ .eq("project_id", invitationRecord.getProjectId())
|
|
|
+ .eq("invitee_id", invitationRecord.getInviteeId()));
|
|
|
+ if(null == record){
|
|
|
+ invitationRecord.setOperator(user.getUsername());
|
|
|
+ invitationRecord.setOperatorId(user.getId());
|
|
|
+ invitationRecord.setInvitee(invitee.getUsername());
|
|
|
+ invitationRecord.setAddressUrl(invitationUrl+invitationRecord.getInviteeId()+"/"+invitationRecord.getProjectId()+"/"+user.getId());
|
|
|
+ invitationRecordMapper.insert(invitationRecord);
|
|
|
+ BeanUtils.copyProperties(invitationRecord,vo);
|
|
|
+ msg.data = vo;
|
|
|
+ }else{
|
|
|
+ BeanUtils.copyProperties(record,vo);
|
|
|
+ msg.data = vo;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
return msg;
|
|
|
}
|