Browse Source

Merge branch '20250903-wyp-autoCreateRoom' of Server/growth-manager into master

wangyunpeng 1 week ago
parent
commit
859fa24bd1

+ 12 - 0
api-module/src/main/java/com/tzld/piaoquan/api/controller/WeComThirdPartyController.java

@@ -78,4 +78,16 @@ public class WeComThirdPartyController {
         return CommonResponse.success();
     }
 
+    @PostMapping("/updateStaffStatus")
+    public CommonResponse<Void> updateStaffStatus(@RequestBody UpdateStaffStatusRequest request) {
+        service.updateStaffStatus(request);
+        return CommonResponse.success();
+    }
+
+    @PostMapping("/updateAutoCreateRoomStatus")
+    public CommonResponse<Void> updateAutoCreateRoomStatus(@RequestBody UpdateAutoCreateRoomStatusRequest request) {
+        service.updateAutoCreateRoomStatus(request);
+        return CommonResponse.success();
+    }
+
 }

+ 9 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/param/wecom/thirdpart/UpdateAutoCreateRoomStatusRequest.java

@@ -0,0 +1,9 @@
+package com.tzld.piaoquan.api.model.param.wecom.thirdpart;
+
+import lombok.Data;
+
+@Data
+public class UpdateAutoCreateRoomStatusRequest {
+    private String staffName;
+    private Integer autoCreateRoomStatus;
+}

+ 9 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/param/wecom/thirdpart/UpdateStaffStatusRequest.java

@@ -0,0 +1,9 @@
+package com.tzld.piaoquan.api.model.param.wecom.thirdpart;
+
+import lombok.Data;
+
+@Data
+public class UpdateStaffStatusRequest {
+    private String staffName;
+    private Integer status;
+}

+ 4 - 0
api-module/src/main/java/com/tzld/piaoquan/api/service/WeComThirdPartyService.java

@@ -50,4 +50,8 @@ public interface WeComThirdPartyService {
     ThirdPartWeComRoom getRoomByRoomId(Long roomid);
 
     ThirdPartWeComStaff getStaffByUuid(String uuid);
+
+    void updateStaffStatus(UpdateStaffStatusRequest request);
+
+    void updateAutoCreateRoomStatus(UpdateAutoCreateRoomStatusRequest request);
 }

+ 20 - 0
api-module/src/main/java/com/tzld/piaoquan/api/service/impl/WeComThirdPartyServiceImpl.java

@@ -437,4 +437,24 @@ public class WeComThirdPartyServiceImpl implements WeComThirdPartyService {
         return staffList.get(0);
     }
 
+    @Override
+    public void updateStaffStatus(UpdateStaffStatusRequest request) {
+        ThirdPartWeComStaff staff = getStaffByName(request.getStaffName());
+        if (Objects.isNull(staff)) {
+            throw new CommonException(ExceptionEnum.THIRD_PART_STAFF_NOT_FOUND);
+        }
+        staff.setStatus(request.getStatus());
+        thirdPartWeComStaffMapper.updateByPrimaryKeySelective(staff);
+    }
+
+    @Override
+    public void updateAutoCreateRoomStatus(UpdateAutoCreateRoomStatusRequest request) {
+        ThirdPartWeComStaff staff = getStaffByName(request.getStaffName());
+        if (Objects.isNull(staff)) {
+            throw new CommonException(ExceptionEnum.THIRD_PART_STAFF_NOT_FOUND);
+        }
+        staff.setAutoCreateRoom(request.getAutoCreateRoomStatus());
+        thirdPartWeComStaffMapper.updateByPrimaryKeySelective(staff);
+    }
+
 }