|
@@ -67,15 +67,8 @@ public class FosterwxFlowListController extends BaseController<FosterwxFlowList>
|
|
|
// 超过
|
|
// 超过
|
|
|
// 更新
|
|
// 更新
|
|
|
FosterwxFlowList lastPosition = fosterwxFlowListService.getOne(new QueryWrapper<FosterwxFlowList>().eq("pool_id", fosterwxFlowList.getPoolId()).orderByDesc("id").last("Limit 1"));
|
|
FosterwxFlowList lastPosition = fosterwxFlowListService.getOne(new QueryWrapper<FosterwxFlowList>().eq("pool_id", fosterwxFlowList.getPoolId()).orderByDesc("id").last("Limit 1"));
|
|
|
- String position = "";
|
|
|
|
|
- if (null == lastPosition) {
|
|
|
|
|
- // 新开账号 需要激活个微池状态
|
|
|
|
|
- position = "1001";
|
|
|
|
|
- } else {
|
|
|
|
|
- position = String.valueOf(Integer.parseInt(lastPosition.getFlowPosition()) + 1);
|
|
|
|
|
- }
|
|
|
|
|
// 设置流量位置
|
|
// 设置流量位置
|
|
|
- fosterwxFlowList.setFlowPosition(position);
|
|
|
|
|
|
|
+ fosterwxFlowList.setFlowPosition(fosterwxMobilePool.getFlowPosition());
|
|
|
// 设置状态
|
|
// 设置状态
|
|
|
fosterwxFlowList.setStatus(0);
|
|
fosterwxFlowList.setStatus(0);
|
|
|
fosterwxFlowListService.save(fosterwxFlowList);
|
|
fosterwxFlowListService.save(fosterwxFlowList);
|
|
@@ -85,36 +78,23 @@ public class FosterwxFlowListController extends BaseController<FosterwxFlowList>
|
|
|
|
|
|
|
|
// 更新个微池状态为停用
|
|
// 更新个微池状态为停用
|
|
|
fosterwxMobilePool.setStatus(0);
|
|
fosterwxMobilePool.setStatus(0);
|
|
|
- fosterwxMobilePool.setFlowPosition(position);
|
|
|
|
|
fosterwxMobilePool.setUpdateUid(fosterwxFlowList.getUpdateUid());
|
|
fosterwxMobilePool.setUpdateUid(fosterwxFlowList.getUpdateUid());
|
|
|
fosterwxMobilePool.setUpdateAt(LocalDateTime.now());
|
|
fosterwxMobilePool.setUpdateAt(LocalDateTime.now());
|
|
|
fosterwxMobilePoolService.updateById(fosterwxMobilePool);
|
|
fosterwxMobilePoolService.updateById(fosterwxMobilePool);
|
|
|
} else {
|
|
} else {
|
|
|
// 未超过
|
|
// 未超过
|
|
|
- // 查找上一个流量位置
|
|
|
|
|
- FosterwxFlowList lastPosition = fosterwxFlowListService.getOne(new QueryWrapper<FosterwxFlowList>().eq("pool_id", fosterwxFlowList.getPoolId()).orderByDesc("id").last("Limit 1"));
|
|
|
|
|
- String position = "";
|
|
|
|
|
- if (null == lastPosition) {
|
|
|
|
|
- // 新开账号 需要激活个微池状态
|
|
|
|
|
- position = "1001";
|
|
|
|
|
|
|
+ if (2 != fosterwxMobilePool.getStatus()) {
|
|
|
fosterwxMobilePool.setStatus(2);
|
|
fosterwxMobilePool.setStatus(2);
|
|
|
fosterwxMobilePool.setUpdateUid(fosterwxFlowList.getUpdateUid());
|
|
fosterwxMobilePool.setUpdateUid(fosterwxFlowList.getUpdateUid());
|
|
|
fosterwxMobilePool.setUpdateAt(LocalDateTime.now());
|
|
fosterwxMobilePool.setUpdateAt(LocalDateTime.now());
|
|
|
fosterwxMobilePoolService.updateById(fosterwxMobilePool);
|
|
fosterwxMobilePoolService.updateById(fosterwxMobilePool);
|
|
|
-
|
|
|
|
|
- } else {
|
|
|
|
|
- position = String.valueOf(Integer.parseInt(lastPosition.getFlowPosition()) + 1);
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
// 设置流量位置
|
|
// 设置流量位置
|
|
|
- fosterwxFlowList.setFlowPosition(position);
|
|
|
|
|
|
|
+ fosterwxFlowList.setFlowPosition(fosterwxMobilePool.getFlowPosition());
|
|
|
// 设置状态
|
|
// 设置状态
|
|
|
fosterwxFlowList.setStatus(1);
|
|
fosterwxFlowList.setStatus(1);
|
|
|
fosterwxFlowListService.save(fosterwxFlowList);
|
|
fosterwxFlowListService.save(fosterwxFlowList);
|
|
|
- // 更新个微池流量位置
|
|
|
|
|
- fosterwxMobilePool.setFlowPosition(position);
|
|
|
|
|
- fosterwxMobilePool.setUpdateUid(fosterwxFlowList.getUpdateUid());
|
|
|
|
|
- fosterwxMobilePool.setUpdateAt(LocalDateTime.now());
|
|
|
|
|
- fosterwxMobilePoolService.updateById(fosterwxMobilePool);
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|