Просмотр исходного кода

Merge branch 'master' of http://git.mokasz.com/marketing/moka-private

leon 5 лет назад
Родитель
Сommit
60fef95bf8

+ 3 - 3
src/main/java/com/mokamrp/privates/controller/pangu/FosterwxFlowListController.java

@@ -55,7 +55,7 @@ public class FosterwxFlowListController extends BaseController<FosterwxFlowList>
     }
 
     @PostMapping("/changeStatus")
-    public Object changeStatus(FosterwxFlowList fosterwxFlowList) {
+    public Object changeStatus(@RequestBody FosterwxFlowList fosterwxFlowList) {
         // 先从个微池中获取进粉阈值
         FosterwxMobilePool fosterwxMobilePool = fosterwxMobilePoolService.getOne(new QueryWrapper<FosterwxMobilePool>().eq("pool_index", fosterwxFlowList.getPoolId()).last("Limit 1"));
 
@@ -66,7 +66,7 @@ public class FosterwxFlowListController extends BaseController<FosterwxFlowList>
         if (fosterwxFlowList.getBusFans() > maxFans / 2.0) {
             // 超过
             // 更新
-            FosterwxFlowList lastPosition = fosterwxFlowListService.getOne(new QueryWrapper<FosterwxFlowList>().eq("pool_id", fosterwxFlowList.getPoolId()));
+            FosterwxFlowList lastPosition = fosterwxFlowListService.getOne(new QueryWrapper<FosterwxFlowList>().eq("pool_id", fosterwxFlowList.getPoolId()).orderByDesc("id").last("Limit 1"));
             String position = "";
             if (null == lastPosition) {
                 // 新开账号 需要激活个微池状态
@@ -92,7 +92,7 @@ public class FosterwxFlowListController extends BaseController<FosterwxFlowList>
         } else {
             // 未超过
             // 查找上一个流量位置
-            FosterwxFlowList lastPosition = fosterwxFlowListService.getOne(new QueryWrapper<FosterwxFlowList>().eq("pool_id", fosterwxFlowList.getPoolId()));
+            FosterwxFlowList lastPosition = fosterwxFlowListService.getOne(new QueryWrapper<FosterwxFlowList>().eq("pool_id", fosterwxFlowList.getPoolId()).orderByDesc("id").last("Limit 1"));
             String position = "";
             if (null == lastPosition) {
                 // 新开账号 需要激活个微池状态

+ 7 - 3
src/main/java/com/mokamrp/privates/mapper/pangu/pojo/FosterwxFlowList.java

@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.AllArgsConstructor;
+import lombok.NoArgsConstructor;
 
 import java.io.Serializable;
 import java.time.LocalDateTime;
@@ -17,6 +19,8 @@ import java.time.LocalDateTime;
  * @since 2021-07-30
  */
 @TableName("pan_fosterwx_flow_list")
+@AllArgsConstructor
+@NoArgsConstructor
 public class FosterwxFlowList extends Model<FosterwxFlowList> {
 
     private static final long serialVersionUID = 1L;
@@ -39,7 +43,7 @@ public class FosterwxFlowList extends Model<FosterwxFlowList> {
     /**
      * 个微池id
      */
-    private Integer poolId;
+    private String poolId;
 
     /**
      * 流量位置
@@ -98,11 +102,11 @@ public class FosterwxFlowList extends Model<FosterwxFlowList> {
         this.timeLine = timeLine;
     }
 
-    public Integer getPoolId() {
+    public String getPoolId() {
         return poolId;
     }
 
-    public void setPoolId(Integer poolId) {
+    public void setPoolId(String poolId) {
         this.poolId = poolId;
     }