|
@@ -475,8 +475,8 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
|
@@ -475,8 +475,8 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
475
|
BeanUtils.copyProperties(unionShareUser, bo);
|
475
|
BeanUtils.copyProperties(unionShareUser, bo);
|
476
|
}
|
476
|
}
|
477
|
|
477
|
|
478
|
- //是否存在申请中的请求
|
|
|
479
|
- bo.setHasApply(hasApply(uid));
|
478
|
+ //是否存在申请中的请求:0-无申请,1-申请中,2-申请通过,3-拒绝
|
|
|
479
|
+ bo.setApplyStatus(hasApply(uid));
|
480
|
}
|
480
|
}
|
481
|
|
481
|
|
482
|
//设置返回文案
|
482
|
//设置返回文案
|
|
@@ -492,15 +492,16 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
|
@@ -492,15 +492,16 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
492
|
/**
|
492
|
/**
|
493
|
* 是否存在申请中的请求
|
493
|
* 是否存在申请中的请求
|
494
|
* */
|
494
|
* */
|
495
|
- public boolean hasApply(int uid) {
|
495
|
+ public int hasApply(int uid) {
|
496
|
UnionShareUserApply record = new UnionShareUserApply();
|
496
|
UnionShareUserApply record = new UnionShareUserApply();
|
497
|
record.setUid(uid);
|
497
|
record.setUid(uid);
|
498
|
record.setStatus((byte)1);
|
498
|
record.setStatus((byte)1);
|
499
|
- int count = unionShareUserApplyMapper.selectCountByUid(record);
|
|
|
500
|
- if (count > 0) {
|
|
|
501
|
- return true;
|
499
|
+ UnionShareUserApply unionShareUserApply = unionShareUserApplyMapper.selectOneByUid(record);
|
|
|
500
|
+ // 状态:1-申请中,2-通过,3-拒绝,4-拒绝已读
|
|
|
501
|
+ if (unionShareUserApply == null||unionShareUserApply.getStatus()==2||unionShareUserApply.getStatus()==4) {
|
|
|
502
|
+ return 0;
|
502
|
}
|
503
|
}
|
503
|
- return false;
|
504
|
+ return unionShareUserApply.getStatus();
|
504
|
}
|
505
|
}
|
505
|
|
506
|
|
506
|
/**
|
507
|
/**
|
|
@@ -509,12 +510,7 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
|
@@ -509,12 +510,7 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
509
|
@Override
|
510
|
@Override
|
510
|
public JSONObject checkApply(int uid) {
|
511
|
public JSONObject checkApply(int uid) {
|
511
|
JSONObject result = new JSONObject();
|
512
|
JSONObject result = new JSONObject();
|
512
|
- if (hasApply(uid)) {
|
|
|
513
|
- result.put("status", 1);//0-无申请,1-申请中,2-申请通过
|
|
|
514
|
- return result;
|
|
|
515
|
- } else {
|
|
|
516
|
- result.put("status", 0);
|
|
|
517
|
- }
|
513
|
+ result.put("status", hasApply(uid));//0-无申请,1-申请中,2-申请通过,3-拒绝
|
518
|
UnionShareUser unionShareUser=unionShareUserMapper.selectByUid(uid);
|
514
|
UnionShareUser unionShareUser=unionShareUserMapper.selectByUid(uid);
|
519
|
if (unionShareUser != null) {
|
515
|
if (unionShareUser != null) {
|
520
|
result.put("status", 2);
|
516
|
result.put("status", 2);
|
|
@@ -522,6 +518,23 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
|
@@ -522,6 +518,23 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
522
|
}
|
518
|
}
|
523
|
return result;
|
519
|
return result;
|
524
|
}
|
520
|
}
|
|
|
521
|
+ /**
|
|
|
522
|
+ * 重置拒绝申请状态
|
|
|
523
|
+ * */
|
|
|
524
|
+ @Override
|
|
|
525
|
+ public String resetApply(int uid) {
|
|
|
526
|
+ UnionShareUserApply record = new UnionShareUserApply();
|
|
|
527
|
+ record.setUid(uid);
|
|
|
528
|
+ record.setStatus((byte)1);
|
|
|
529
|
+ UnionShareUserApply unionShareUserApply = unionShareUserApplyMapper.selectOneByUid(record);
|
|
|
530
|
+ if (unionShareUserApply != null&&unionShareUserApply.getStatus()==3) {//状态:1-申请中,2-通过,3-拒绝,4-拒绝已读
|
|
|
531
|
+ int result=unionShareUserApplyMapper.updateStatusByUid(uid, 3, 4, DateUtil.getCurrentTimeSecond());
|
|
|
532
|
+ if (result > 0) {
|
|
|
533
|
+ return "Y";
|
|
|
534
|
+ }
|
|
|
535
|
+ }
|
|
|
536
|
+ return "N";
|
|
|
537
|
+ }
|
525
|
|
538
|
|
526
|
/**
|
539
|
/**
|
527
|
* 申请
|
540
|
* 申请
|
|
@@ -538,7 +551,7 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
|
@@ -538,7 +551,7 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport |
538
|
//已是联盟用户
|
551
|
//已是联盟用户
|
539
|
throw new ServiceException(ServiceError.UNION_HAS_UNIONTYPE_ERROR);
|
552
|
throw new ServiceException(ServiceError.UNION_HAS_UNIONTYPE_ERROR);
|
540
|
}
|
553
|
}
|
541
|
- if (hasApply(req.getUid())) {
|
554
|
+ if (hasApply(req.getUid())>0) {//0-无申请,1-申请中,2-申请通过,3-拒绝
|
542
|
//已有申请中的
|
555
|
//已有申请中的
|
543
|
throw new ServiceException(ServiceError.UNION_HAS_APPLY_ERROR);
|
556
|
throw new ServiceException(ServiceError.UNION_HAS_APPLY_ERROR);
|
544
|
}
|
557
|
}
|