|
|
@@ -41,6 +41,7 @@ import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.IOException;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.math.RoundingMode;
|
|
|
+import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.Optional;
|
|
|
|
|
|
@@ -500,6 +501,34 @@ public class AccountTempController {
|
|
|
|
|
|
private final UserMapper userMapper;
|
|
|
|
|
|
+ /**
|
|
|
+ * 正常奈飞账号 车队被下架 上车
|
|
|
+ */
|
|
|
+ @GetMapping("/normal")
|
|
|
+ public Result<String> normal() {
|
|
|
+ List<GroupsTrips> groupsTrips = groupsMapper.selectList(Wrappers.lambdaQuery(GroupsTrips.class)
|
|
|
+ .in(GroupsTrips::getSkuId, List.of(4, 5, 6))
|
|
|
+ .eq(GroupsTrips::getStatus, GroupsTrips.Status.down));
|
|
|
+ DateTime now = DateTime.now();
|
|
|
+ groupsTrips.forEach(groups->{
|
|
|
+
|
|
|
+ Account account = accountMapper.selectOne(Wrappers.lambdaQuery(Account.class)
|
|
|
+ .eq(Account::getId, groups.getGroupId()));
|
|
|
+ if (account != null) {
|
|
|
+ Date expiryTime = account.getExpiryTime();
|
|
|
+ if (expiryTime.compareTo(now) > 0) {
|
|
|
+ Integer state = accountMapper.isNormal(account.getAccount());
|
|
|
+ if (state == null || state == 1) {
|
|
|
+ log.info("正常奈飞账号:{}", account.getAccount());
|
|
|
+ groups.setStatus(GroupsTrips.Status.validity);
|
|
|
+ groupsMapper.updateById(groups);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 拉黑用户 车票
|
|
|
*/
|