|
|
@@ -31,8 +31,6 @@ import java.util.List;
|
|
|
@RequestMapping("/applets/group/relation")
|
|
|
public class GroupRelationController {
|
|
|
|
|
|
- private static final List<Long> GOODS_LIST = List.of(2L,4L,5L);
|
|
|
-
|
|
|
private final BeanSearcher beanSearcher;
|
|
|
|
|
|
private final OrderDonService orderDonService;
|
|
|
@@ -40,26 +38,27 @@ public class GroupRelationController {
|
|
|
private final GroupsRelationMapper relationMapper;
|
|
|
|
|
|
@RequestMapping("/get/renewal")
|
|
|
- public Result<List<RenewalView>> get(){
|
|
|
+ public Result<List<RenewalView>> get() {
|
|
|
long userId = StpUserUtil.getLoginIdAsLong();
|
|
|
List<RenewalView> list = beanSearcher.searchAll(RenewalView.class, MapUtils.builder()
|
|
|
.field(RenewalView::getUserId, userId)
|
|
|
- .field(RenewalView::getStatus,List.of("validity","overdue")).op(Operator.InList)
|
|
|
+ .field(RenewalView::getStatus, List.of("validity", "overdue")).op(Operator.InList)
|
|
|
.orderBy(RenewalView::getExpiryTime).asc()
|
|
|
.build());
|
|
|
//过滤邀请制
|
|
|
list.forEach((renewalView) -> {
|
|
|
- if (GOODS_LIST.contains(renewalView.getGoodsId())) {
|
|
|
+ if (renewalView.getSecondType() == 1) {
|
|
|
renewalView.setAccount(null);
|
|
|
renewalView.setPassword(null);
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
);
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(list);
|
|
|
}
|
|
|
|
|
|
@PostMapping("/post/renewal")
|
|
|
- public Result<OrderDon> renewal(@RequestBody OrderPayRequest request){
|
|
|
+ public Result<OrderDon> renewal(@RequestBody OrderPayRequest request) {
|
|
|
long userId = StpUserUtil.getLoginIdAsLong();
|
|
|
request.setUserId(userId);
|
|
|
|
|
|
@@ -68,13 +67,13 @@ public class GroupRelationController {
|
|
|
}
|
|
|
|
|
|
@PutMapping("/update/set/account")
|
|
|
- public Result<String> setAccount(@RequestBody GroupsRelation relation){
|
|
|
+ public Result<String> setAccount(@RequestBody GroupsRelation relation) {
|
|
|
long userId = StpUserUtil.getLoginIdAsLong();
|
|
|
- GroupsRelation re = relationMapper.selectOne(Wrappers.lambdaQuery(GroupsRelation.class).eq(GroupsRelation::getId,relation.getId()).eq(GroupsRelation::getUserId,userId).last(" limit 1"));
|
|
|
+ GroupsRelation re = relationMapper.selectOne(Wrappers.lambdaQuery(GroupsRelation.class).eq(GroupsRelation::getId, relation.getId()).eq(GroupsRelation::getUserId, userId).last(" limit 1"));
|
|
|
if (re == null) {
|
|
|
throw new BusinessRuntimeException("该车票不存在,请联系客服.");
|
|
|
}
|
|
|
- relationMapper.update(relation,Wrappers.lambdaUpdate(GroupsRelation.class).set(GroupsRelation::getAccount,relation.getAccount()).eq(GroupsRelation::getId,relation.getId()));
|
|
|
+ relationMapper.update(relation, Wrappers.lambdaUpdate(GroupsRelation.class).set(GroupsRelation::getAccount, relation.getAccount()).eq(GroupsRelation::getId, relation.getId()));
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|
|
|
|