|  |  |  | 
|---|
|  |  |  | import com.doumee.config.annotation.LoginNoRequired; | 
|---|
|  |  |  | import com.doumee.core.annotation.excel.ExcelExporter; | 
|---|
|  |  |  | import com.doumee.core.annotation.pr.PreventRepeat; | 
|---|
|  |  |  | import com.doumee.core.model.ApiResponse; | 
|---|
|  |  |  | import com.doumee.core.model.PageData; | 
|---|
|  |  |  | import com.doumee.core.model.PageWrap; | 
|---|
|  |  |  | import com.doumee.service.business.third.model.ApiResponse; | 
|---|
|  |  |  | import com.doumee.service.business.third.model.LoginUserInfo; | 
|---|
|  |  |  | import com.doumee.service.business.third.model.PageData; | 
|---|
|  |  |  | import com.doumee.service.business.third.model.PageWrap; | 
|---|
|  |  |  | import com.doumee.core.utils.Constants; | 
|---|
|  |  |  | import com.doumee.dao.business.dto.ResetPasswordDTO; | 
|---|
|  |  |  | import com.doumee.dao.business.model.Visits; | 
|---|
|  |  |  | 
|---|
|  |  |  | import com.doumee.service.business.impl.hksync.fhk.HkSyncVisitFromHKServiceImpl; | 
|---|
|  |  |  | import com.doumee.service.system.SystemUserService; | 
|---|
|  |  |  | import io.swagger.annotations.Api; | 
|---|
|  |  |  | import io.swagger.annotations.ApiImplicitParam; | 
|---|
|  |  |  | import io.swagger.annotations.ApiImplicitParams; | 
|---|
|  |  |  | import io.swagger.annotations.ApiOperation; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.*; | 
|---|
|  |  |  | 
|---|
|  |  |  | @GetMapping("/delete/{id}") | 
|---|
|  |  |  | @CloudRequiredPermission("business:visits:delete") | 
|---|
|  |  |  | public ApiResponse deleteById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ | 
|---|
|  |  |  | visitsService.deleteById(id); | 
|---|
|  |  |  | visitsService.deleteById(id,this.getLoginUser(token)); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | visitsService.updateById(visits); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //    @ApiOperation("手动签离") | 
|---|
|  |  |  | //    @GetMapping("/visitCancel") | 
|---|
|  |  |  | //    @CloudRequiredPermission("business:visits:cancel") | 
|---|
|  |  |  | //    public ApiResponse visitCancel(@RequestParam Integer visitId,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ | 
|---|
|  |  |  | //        visitsService.visitCancel(visitId); | 
|---|
|  |  |  | //        return ApiResponse.success(null); | 
|---|
|  |  |  | //    } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 2025-3-25 14:14:34  加入取消预约 待审批、审批中、已审批 | 
|---|
|  |  |  | * @param visitId | 
|---|
|  |  |  | * @param token | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @ApiOperation("取消预约") | 
|---|
|  |  |  | @GetMapping("/visitCancel") | 
|---|
|  |  |  | @CloudRequiredPermission("business:visits:cancel") | 
|---|
|  |  |  | public ApiResponse visitCancel(@RequestParam Integer visitId,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ | 
|---|
|  |  |  | visitsService.visitCancel(visitId); | 
|---|
|  |  |  | @GetMapping("/visitsCancel") | 
|---|
|  |  |  | //    @CloudRequiredPermission("business:visits:cancel") | 
|---|
|  |  |  | public ApiResponse visitsCancel(@RequestParam Integer visitId,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ | 
|---|
|  |  |  | LoginUserInfo loginUserInfo = getLoginUser(token); | 
|---|
|  |  |  | visitsService.visitsCancel(visitId,loginUserInfo); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | @PostMapping("/page") | 
|---|
|  |  |  | @CloudRequiredPermission("business:visits:query") | 
|---|
|  |  |  | public ApiResponse<PageData<Visits>> findPage (@RequestBody PageWrap<Visits> pageWrap,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ | 
|---|
|  |  |  | //        pageWrap.getModel().setReceptMemberId(getLoginUser(token).getMemberId()); | 
|---|
|  |  |  | pageWrap.getModel().setLoginUserInfo(this.getLoginUser(token)); | 
|---|
|  |  |  | return ApiResponse.success(visitsService.findPage(pageWrap)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | @PostMapping("/exportExcel") | 
|---|
|  |  |  | @CloudRequiredPermission("business:visits:exportExcel") | 
|---|
|  |  |  | public void exportExcel (@RequestBody PageWrap<Visits> pageWrap, HttpServletResponse response,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ | 
|---|
|  |  |  | pageWrap.getModel().setLoginUserInfo(this.getLoginUser(token)); | 
|---|
|  |  |  | ExcelExporter.build(Visits.class).export(visitsService.findPage(pageWrap).getRecords(), "访客申请信息表", response); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | @GetMapping("/{id}") | 
|---|
|  |  |  | @CloudRequiredPermission("business:visits:query") | 
|---|
|  |  |  | public ApiResponse<Visits> findById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ | 
|---|
|  |  |  | return ApiResponse.success(visitsService.findById(id)); | 
|---|
|  |  |  | LoginUserInfo loginUserInfo = getLoginUser(token); | 
|---|
|  |  |  | return ApiResponse.success(visitsService.findById(id,loginUserInfo.getMemberId())); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("滞留人员") | 
|---|
|  |  |  | 
|---|
|  |  |  | return ApiResponse.success(visitsService.retentionPage(pageWrap)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation(value = "PC端访客记录提交", notes = "访客提交") | 
|---|
|  |  |  | @PostMapping("/createFk") | 
|---|
|  |  |  | public ApiResponse createFk(@RequestBody Visits visits) { | 
|---|
|  |  |  | visits.setSourceType(Constants.ZERO); | 
|---|
|  |  |  | return ApiResponse.success("查询成功", visitsService.createFk(visits,false,Constants.ONE)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation(value = "访客报备", notes = "访客报备") | 
|---|
|  |  |  | @PostMapping("/createVisit") | 
|---|
|  |  |  | public ApiResponse createVisit(@RequestBody Visits visits,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
|---|
|  |  |  | visits.setMemberId(getLoginUser(token).getMemberId()); | 
|---|
|  |  |  | LoginUserInfo loginUserInfo = getLoginUser(token); | 
|---|
|  |  |  | visits.setMemberId(loginUserInfo.getMemberId()); | 
|---|
|  |  |  | visits.setCreateMemberId(loginUserInfo.getMemberId()); | 
|---|
|  |  |  | visits.setReceptMemberId(visits.getMemberId()); | 
|---|
|  |  |  | visits.setLoginUserInfo(loginUserInfo); | 
|---|
|  |  |  | return ApiResponse.success("查询成功", visitsService.visitReporting(visits)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | return ApiResponse.success("重置成功"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("重新下发失败的预约") | 
|---|
|  |  |  | @GetMapping("/visitResend") | 
|---|
|  |  |  | @CloudRequiredPermission("business:visits:update") | 
|---|
|  |  |  | public ApiResponse   visitResend(@RequestParam Integer visitId) { | 
|---|
|  |  |  | visitsService.visitResend(visitId); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|