2024-11-25 09:32:39 +08:00
|
|
|
package com.changhu.controller;
|
2024-09-10 10:12:37 +08:00
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
import com.changhu.common.annotation.CheckUserType;
|
2024-11-25 09:32:39 +08:00
|
|
|
import com.changhu.common.annotation.IsWhiteList;
|
2024-09-10 10:12:37 +08:00
|
|
|
import com.changhu.common.annotation.JsonBody;
|
2024-11-28 16:00:50 +08:00
|
|
|
import com.changhu.common.db.enums.MiniProgramUserIdentity;
|
2024-11-13 09:31:37 +08:00
|
|
|
import com.changhu.common.db.enums.UserType;
|
2024-11-28 16:00:50 +08:00
|
|
|
import com.changhu.common.pojo.vo.SelectNodeVo;
|
2024-11-25 09:32:39 +08:00
|
|
|
import com.changhu.pojo.params.CheckStatusParams;
|
|
|
|
import com.changhu.pojo.params.UnitDisableOrEnableParams;
|
|
|
|
import com.changhu.pojo.vo.UnitCheckStatusVo;
|
|
|
|
import com.changhu.pojo.vo.UnitMiniProgramUserPagerQueryParams;
|
|
|
|
import com.changhu.pojo.vo.UnitMiniProgramUserPagerVo;
|
|
|
|
import com.changhu.service.ManagementService;
|
2024-09-10 10:12:37 +08:00
|
|
|
import com.changhu.support.mybatisplus.pojo.params.PageParams;
|
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
2024-11-28 16:00:50 +08:00
|
|
|
import io.swagger.v3.oas.annotations.media.Schema;
|
2024-09-10 10:12:37 +08:00
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
|
import jakarta.validation.Valid;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
2024-11-28 16:00:50 +08:00
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
import java.util.List;
|
2024-09-10 10:12:37 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @author 20252
|
2024-11-25 09:32:39 +08:00
|
|
|
* @createTime 2024/11/22 上午9:03
|
|
|
|
* @desc ManagementController...
|
2024-09-10 10:12:37 +08:00
|
|
|
*/
|
|
|
|
@Tag(name = "后台-通用接口")
|
|
|
|
@JsonBody
|
|
|
|
@RequestMapping("/management")
|
2024-11-25 09:32:39 +08:00
|
|
|
@RestController
|
2024-09-10 10:12:37 +08:00
|
|
|
public class ManagementController {
|
|
|
|
@Autowired
|
|
|
|
private ManagementService managementService;
|
|
|
|
|
|
|
|
@Operation(summary = "获取审核状态")
|
|
|
|
@PostMapping("/getCheckStatus")
|
2024-11-25 09:32:39 +08:00
|
|
|
@IsWhiteList
|
|
|
|
public UnitCheckStatusVo getCheckStatus(@RequestBody @Valid CheckStatusParams params) {
|
2024-09-10 10:12:37 +08:00
|
|
|
return managementService.getCheckStatus(params);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Operation(summary = "查询单位下的小程序用户")
|
|
|
|
@PostMapping("/miniProgramUserPager")
|
|
|
|
@CheckUserType(userTypes = {UserType.MANAGEMENT_POLICE, UserType.MANAGEMENT_SECURITY})
|
|
|
|
public Page<UnitMiniProgramUserPagerVo> miniProgramUserPager(@RequestBody PageParams<UnitMiniProgramUserPagerQueryParams, UnitMiniProgramUserPagerVo> queryParams) {
|
|
|
|
return managementService.miniProgramUserPager(queryParams);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Operation(summary = "审核通过小程序用户")
|
|
|
|
@PostMapping("/passMiniProgramUser")
|
2024-09-11 11:31:10 +08:00
|
|
|
@CheckUserType(userTypes = {UserType.MANAGEMENT_POLICE, UserType.MANAGEMENT_SECURITY})
|
2024-11-25 09:32:39 +08:00
|
|
|
public void passMiniProgramUser(@RequestBody @Valid UnitDisableOrEnableParams params) {
|
2024-09-10 10:12:37 +08:00
|
|
|
managementService.passMiniProgramUser(params);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Operation(summary = "禁用或启用小程序用户")
|
|
|
|
@PostMapping("/disableOrEnableMiniProgramUser")
|
2024-09-11 11:31:10 +08:00
|
|
|
@CheckUserType(userTypes = {UserType.MANAGEMENT_POLICE, UserType.MANAGEMENT_SECURITY})
|
2024-11-25 09:32:39 +08:00
|
|
|
public void disableOrEnableMiniProgramUser(@RequestBody @Valid UnitDisableOrEnableParams params) {
|
2024-09-10 10:12:37 +08:00
|
|
|
managementService.disableOrEnableMiniProgramUser(params);
|
|
|
|
}
|
2024-11-28 16:00:50 +08:00
|
|
|
|
|
|
|
@Operation(summary = "所有的保安单位列表")
|
|
|
|
@GetMapping("/listSecurityUnit")
|
|
|
|
public List<SelectNodeVo<Long>> listSecurityUnit() {
|
|
|
|
return managementService.listSecurityUnit();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Operation(summary = "保安单位下的项目经理")
|
|
|
|
@GetMapping("/listMinUserByUnitId")
|
|
|
|
public List<SelectNodeVo<Long>> listMinUserByUnitId(@RequestParam @Schema(description = "保安单位id") Long securityUnitId,
|
|
|
|
@RequestParam @Schema(description = "身份类型") MiniProgramUserIdentity identity) {
|
|
|
|
return managementService.listMinUserByUnitId(securityUnitId, identity);
|
|
|
|
}
|
2024-09-10 10:12:37 +08:00
|
|
|
}
|