|
@@ -3,12 +3,18 @@ package com.yonge.cooleshow.admin.controller;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.microsvc.toolkit.common.response.paging.PageInfo;
|
|
|
import com.microsvc.toolkit.common.response.paging.QueryInfo;
|
|
|
+import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
|
|
|
import com.yonge.cooleshow.biz.dal.entity.SysArea;
|
|
|
+import com.yonge.cooleshow.biz.dal.entity.TenantUnbindRecord;
|
|
|
+import com.yonge.cooleshow.biz.dal.service.EmployeeService;
|
|
|
import com.yonge.cooleshow.biz.dal.service.SysAreaService;
|
|
|
import com.yonge.cooleshow.biz.dal.service.TenantUnbindRecordService;
|
|
|
+import com.yonge.cooleshow.biz.dal.vo.EmployeeVo;
|
|
|
import com.yonge.cooleshow.biz.dal.wrapper.TenantUnbindRecordWrapper;
|
|
|
import com.yonge.cooleshow.common.controller.BaseController;
|
|
|
import com.yonge.cooleshow.common.entity.HttpResponseResult;
|
|
|
+import com.yonge.cooleshow.common.enums.UserLockFlag;
|
|
|
+import com.yonge.toolset.base.exception.BizException;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -40,6 +46,12 @@ public class TenantUnbindRecordController extends BaseController {
|
|
|
@Autowired
|
|
|
private SysAreaService sysAreaService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private SysUserFeignService sysUserFeignService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private EmployeeService employeeService;
|
|
|
+
|
|
|
|
|
|
@ApiOperation(value = "查询分页", notes = "机构解绑申请记录- 传入 TenantUnbindRecordVo.TenantUnbindRecordQuery")
|
|
|
@PostMapping("/page")
|
|
@@ -70,5 +82,32 @@ public class TenantUnbindRecordController extends BaseController {
|
|
|
return succeed(QueryInfo.pageInfo(pages, pages.getRecords()));
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "审核")
|
|
|
+ @PostMapping("/audit")
|
|
|
+ public HttpResponseResult<Boolean> audit(@RequestBody TenantUnbindRecordWrapper.Audio audio) {
|
|
|
+ if (sysUserFeignService.queryUserInfo() == null) {
|
|
|
+ throw new BizException("请登录");
|
|
|
+ }
|
|
|
+ EmployeeVo employeeVo = employeeService.detail(sysUserFeignService.queryUserInfo().getId());
|
|
|
+ if (employeeVo == null || UserLockFlag.LOCKED.equals(employeeVo.getLockFlag())) {
|
|
|
+ throw new BizException("权限不足");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (audio.getId() == null || audio.getStatus() == null) {
|
|
|
+ throw new BizException("参数错误");
|
|
|
+ }
|
|
|
+
|
|
|
+ boolean update = tenantUnbindRecordService.lambdaUpdate()
|
|
|
+ .set(TenantUnbindRecord::getStatus, audio.getStatus() ? "PASS" : "UNPASS")
|
|
|
+ .set(TenantUnbindRecord::getReason, audio.getReason())
|
|
|
+ .set(TenantUnbindRecord::getVerifyUserId, sysUserFeignService.queryUserInfo().getId())
|
|
|
+ .eq(TenantUnbindRecord::getId, audio.getId())
|
|
|
+ .eq(TenantUnbindRecord::getStatus, "DOING").update();
|
|
|
+ if (!update) {
|
|
|
+ throw new BizException("审核失败,请刷新后重试");
|
|
|
+ }
|
|
|
+ return succeed();
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|