...
|
...
|
@@ -475,8 +475,8 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
|
|
BeanUtils.copyProperties(unionShareUser, bo);
|
|
|
}
|
|
|
|
|
|
//是否存在申请中的请求
|
|
|
bo.setHasApply(hasApply(uid));
|
|
|
//是否存在申请中的请求:0-无申请,1-申请中,2-申请通过,3-拒绝
|
|
|
bo.setApplyStatus(hasApply(uid));
|
|
|
}
|
|
|
|
|
|
//设置返回文案
|
...
|
...
|
@@ -492,15 +492,16 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
|
|
/**
|
|
|
* 是否存在申请中的请求
|
|
|
* */
|
|
|
public boolean hasApply(int uid) {
|
|
|
public int hasApply(int uid) {
|
|
|
UnionShareUserApply record = new UnionShareUserApply();
|
|
|
record.setUid(uid);
|
|
|
record.setStatus((byte)1);
|
|
|
int count = unionShareUserApplyMapper.selectCountByUid(record);
|
|
|
if (count > 0) {
|
|
|
return true;
|
|
|
UnionShareUserApply unionShareUserApply = unionShareUserApplyMapper.selectOneByUid(record);
|
|
|
// 状态:1-申请中,2-通过,3-拒绝,4-拒绝已读
|
|
|
if (unionShareUserApply == null||unionShareUserApply.getStatus()==2||unionShareUserApply.getStatus()==4) {
|
|
|
return 0;
|
|
|
}
|
|
|
return false;
|
|
|
return unionShareUserApply.getStatus();
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -509,12 +510,7 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
|
|
@Override
|
|
|
public JSONObject checkApply(int uid) {
|
|
|
JSONObject result = new JSONObject();
|
|
|
if (hasApply(uid)) {
|
|
|
result.put("status", 1);//0-无申请,1-申请中,2-申请通过
|
|
|
return result;
|
|
|
} else {
|
|
|
result.put("status", 0);
|
|
|
}
|
|
|
result.put("status", hasApply(uid));//0-无申请,1-申请中,2-申请通过,3-拒绝
|
|
|
UnionShareUser unionShareUser=unionShareUserMapper.selectByUid(uid);
|
|
|
if (unionShareUser != null) {
|
|
|
result.put("status", 2);
|
...
|
...
|
@@ -522,6 +518,23 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
/**
|
|
|
* 重置拒绝申请状态
|
|
|
* */
|
|
|
@Override
|
|
|
public String resetApply(int uid) {
|
|
|
UnionShareUserApply record = new UnionShareUserApply();
|
|
|
record.setUid(uid);
|
|
|
record.setStatus((byte)1);
|
|
|
UnionShareUserApply unionShareUserApply = unionShareUserApplyMapper.selectOneByUid(record);
|
|
|
if (unionShareUserApply != null&&unionShareUserApply.getStatus()==3) {//状态:1-申请中,2-通过,3-拒绝,4-拒绝已读
|
|
|
int result=unionShareUserApplyMapper.updateStatusByUid(uid, 3, 4, DateUtil.getCurrentTimeSecond());
|
|
|
if (result > 0) {
|
|
|
return "Y";
|
|
|
}
|
|
|
}
|
|
|
return "N";
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 申请
|
...
|
...
|
@@ -538,7 +551,7 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
|
|
//已是联盟用户
|
|
|
throw new ServiceException(ServiceError.UNION_HAS_UNIONTYPE_ERROR);
|
|
|
}
|
|
|
if (hasApply(req.getUid())) {
|
|
|
if (hasApply(req.getUid())>0) {//0-无申请,1-申请中,2-申请通过,3-拒绝
|
|
|
//已有申请中的
|
|
|
throw new ServiceException(ServiceError.UNION_HAS_APPLY_ERROR);
|
|
|
}
|
...
|
...
|
|