Sfoglia il codice sorgente

个微池调用typer接口 更新阈值和状态字段

lqc 4 anni fa
parent
commit
9fcb2df3a3

+ 17 - 0
src/main/java/com/mokamrp/privates/controller/pangu/FosterwxMobilePoolController.java

@@ -88,6 +88,23 @@ public class FosterwxMobilePoolController extends BaseController<FosterwxMobileP
             }
             fosterwxMobilePoolService.updateById(editHandle.getRaw());
 
+            // 判断专挑或阈值是否有更改
+            Map<String, Object> body = new HashMap<>(1);
+            body.put("ids", id);
+            boolean ischange = false;
+            if (!Objects.equals(oldVO.getStatus(), editHandle.getRaw().getStatus())) {
+                ischange = true;
+                body.put("status", editHandle.getRaw().getStatus() == 0 ? 2 : 1);
+            }
+            if (!Objects.equals(oldVO.getMaxFans(), editHandle.getRaw().getMaxFans())) {
+                ischange = true;
+                body.put("threshold", editHandle.getRaw().getMaxFans());
+            }
+
+            if (ischange) {
+                HttpEntity<Map<String, Object>> httpEntity = new HttpEntity<>(body, null);
+                JSONObject result = restTemplate.exchange(domain + "/poster/qrcode/update", HttpMethod.POST, httpEntity, JSONObject.class).getBody();
+            }
         });
         return AjaxResult.success("新增成功!");
     }