|
@@ -180,30 +180,39 @@ public class GroupRelationController {
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(orderDon);
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(orderDon);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 邀请制绑定账号
|
|
|
|
|
+ */
|
|
|
@PutMapping("/update/set/account")
|
|
@PutMapping("/update/set/account")
|
|
|
- public Result<String> setAccount(@RequestBody GroupsRelation relation) {
|
|
|
|
|
|
|
+ public Result<String> setAccount(@RequestBody @Validated InviteBindAccountReq req) {
|
|
|
long userId = StpUserUtil.getLoginIdAsLong();
|
|
long userId = StpUserUtil.getLoginIdAsLong();
|
|
|
|
|
+ Long relationId = req.getId();
|
|
|
List<Long> userIds = userBindRelationService.getRelationUserIdList(userId, null);
|
|
List<Long> userIds = userBindRelationService.getRelationUserIdList(userId, null);
|
|
|
- GroupsRelation re = relationMapper.selectOne(Wrappers.lambdaQuery(GroupsRelation.class)
|
|
|
|
|
- .eq(GroupsRelation::getId, relation.getId())
|
|
|
|
|
|
|
+ GroupsRelation relation = relationMapper.selectOne(Wrappers.lambdaQuery(GroupsRelation.class)
|
|
|
|
|
+ .eq(GroupsRelation::getId, relationId)
|
|
|
.in(GroupsRelation::getUserId, userIds)
|
|
.in(GroupsRelation::getUserId, userIds)
|
|
|
.last(" limit 1"));
|
|
.last(" limit 1"));
|
|
|
- if (re == null) {
|
|
|
|
|
|
|
+ if (relation == null) {
|
|
|
throw new BusinessRuntimeException("该车票不存在,请联系客服.");
|
|
throw new BusinessRuntimeException("该车票不存在,请联系客服.");
|
|
|
}
|
|
}
|
|
|
|
|
+ String account = req.getAccount();
|
|
|
|
|
+ String password = req.getPassword();
|
|
|
|
|
+ String contact = req.getContact();
|
|
|
|
|
+ String bpVerifyCode = req.getBpVerifyCode();
|
|
|
LambdaUpdateWrapper<GroupsRelation> updateWrapper = Wrappers.lambdaUpdate(GroupsRelation.class)
|
|
LambdaUpdateWrapper<GroupsRelation> updateWrapper = Wrappers.lambdaUpdate(GroupsRelation.class)
|
|
|
- .set(GroupsRelation::getAccount, relation.getAccount())
|
|
|
|
|
- .set(GroupsRelation::getPassword, relation.getPassword())
|
|
|
|
|
- .set(GroupsRelation::getContact, relation.getContact())
|
|
|
|
|
- .eq(GroupsRelation::getId, relation.getId());
|
|
|
|
|
- if (re.getRechargeStatus() != null) {
|
|
|
|
|
- if (re.getRechargeStatus() == GroupsRelation.RechargeStatus.complete) {
|
|
|
|
|
|
|
+ .set(GroupsRelation::getAccount, account)
|
|
|
|
|
+ .set(GroupsRelation::getPassword, password)
|
|
|
|
|
+ .set(GroupsRelation::getContact, contact)
|
|
|
|
|
+ .set(GroupsRelation::getBpVerifyCode, bpVerifyCode)
|
|
|
|
|
+ .eq(GroupsRelation::getId, relationId);
|
|
|
|
|
+ if (relation.getRechargeStatus() != null) {
|
|
|
|
|
+ if (relation.getRechargeStatus() == GroupsRelation.RechargeStatus.complete) {
|
|
|
throw BusinessRuntimeException.getInstance("代充账号已充值");
|
|
throw BusinessRuntimeException.getInstance("代充账号已充值");
|
|
|
}
|
|
}
|
|
|
- if (StrUtil.isEmpty(relation.getAccount())) {
|
|
|
|
|
|
|
+ if (StrUtil.isEmpty(account)) {
|
|
|
throw BusinessRuntimeException.getInstance("请输入正确的账号信息");
|
|
throw BusinessRuntimeException.getInstance("请输入正确的账号信息");
|
|
|
}
|
|
}
|
|
|
- if (re.getRechargeStatus() == GroupsRelation.RechargeStatus.error) {
|
|
|
|
|
|
|
+ if (relation.getRechargeStatus() == GroupsRelation.RechargeStatus.error) {
|
|
|
updateWrapper.set(GroupsRelation::getRechargeStatus, GroupsRelation.RechargeStatus.waiting);
|
|
updateWrapper.set(GroupsRelation::getRechargeStatus, GroupsRelation.RechargeStatus.waiting);
|
|
|
}
|
|
}
|
|
|
relationMapper.update(relation, updateWrapper);
|
|
relationMapper.update(relation, updateWrapper);
|
|
@@ -1420,4 +1429,28 @@ public class GroupRelationController {
|
|
|
TicketRenewUpgradeView renewView = groupRelationFrontService.getRenewUpgradeInfo(userId, relationId);
|
|
TicketRenewUpgradeView renewView = groupRelationFrontService.getRenewUpgradeInfo(userId, relationId);
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(renewView);
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(renewView);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 代充记录
|
|
|
|
|
+ */
|
|
|
|
|
+ @GetMapping("/get/recharge/record")
|
|
|
|
|
+ public Result<List<GptUserRechargeNumRecordView>> getRechargeRecord(Long relationId) {
|
|
|
|
|
+ long userId = StpUserUtil.getLoginIdAsLong();
|
|
|
|
|
+ List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, null);
|
|
|
|
|
+ GroupsRelation relation = relationMapper.selectById(relationId);
|
|
|
|
|
+ if (relation == null || !userIdList.contains(relation.getUserId())) {
|
|
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
|
|
+ }
|
|
|
|
|
+ Date filterDate = relation.getSubmitTime();
|
|
|
|
|
+ if (filterDate == null) {
|
|
|
|
|
+ filterDate = relation.getStartTime();
|
|
|
|
|
+ }
|
|
|
|
|
+ List<GptUserRechargeNumRecordView> search = beanSearcher.searchAll(GptUserRechargeNumRecordView.class, MapUtils.flatBuilder(request.getParameterMap())
|
|
|
|
|
+ .field(GptUserRechargeNumRecordView::getUserId, userIdList).op(Operator.InList)
|
|
|
|
|
+ .field(GptUserRechargeNumRecordView::getRelationId, relationId)
|
|
|
|
|
+ .field(GptUserRechargeNumRecordView::getCreatedTime, filterDate).op(Operator.GreaterEqual)
|
|
|
|
|
+ .orderBy(GptUserRechargeNumRecordView::getCreatedTime).desc()
|
|
|
|
|
+ .build());
|
|
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(search);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|