|  |  | 
 |  |  | import com.doumee.api.BaseController; | 
 |  |  | import com.doumee.config.annotation.LoginNoRequired; | 
 |  |  | import com.doumee.core.annotation.trace.Trace; | 
 |  |  | import com.doumee.core.constants.ResponseStatus; | 
 |  |  | import com.doumee.core.exception.BusinessException; | 
 |  |  | import com.doumee.core.model.ApiResponse; | 
 |  |  | import com.doumee.core.model.LoginUserInfo; | 
 |  |  | 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.core.wx.wxPlat.WxPlatNotice; | 
 |  |  | import com.doumee.dao.business.model.VisitReason; | 
 |  |  | import com.doumee.dao.business.model.Visits; | 
 |  |  | import com.doumee.dao.web.reqeust.CheckVisitedDTO; | 
 |  |  | import com.doumee.dao.web.response.MemberVO; | 
 |  |  | import com.doumee.dao.web.response.VisitDetailVO; | 
 |  |  | import com.doumee.dao.web.response.VisitRecordVO; | 
 |  |  | import com.doumee.dao.web.response.WxAuthorizeVO; | 
 |  |  | import com.doumee.service.business.MemberService; | 
 |  |  | import com.doumee.service.business.VisitReasonService; | 
 |  |  | 
 |  |  | import io.swagger.annotations.ApiOperation; | 
 |  |  | import lombok.extern.slf4j.Slf4j; | 
 |  |  | import org.apache.commons.lang3.StringUtils; | 
 |  |  | import org.apache.shiro.authz.annotation.RequiresPermissions; | 
 |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
 |  |  | import org.springframework.web.bind.annotation.*; | 
 |  |  | import org.springframework.web.server.ServerWebExchange; | 
 |  |  |  | 
 |  |  | import javax.validation.Valid; | 
 |  |  | import java.util.Arrays; | 
 |  |  | import java.util.List; | 
 |  |  | import java.util.Objects; | 
 |  |  |  | 
 |  |  | 
 |  |  |         return ApiResponse.success("查询成功",wxAuthorizeVO); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     @LoginNoRequired | 
 |  |  |     @ApiOperation(value = "testSendNotice", notes = "testSendNotice") | 
 |  |  |     @GetMapping("/testSendNotice") | 
 |  |  |     @ApiImplicitParams({ | 
 |  |  |             @ApiImplicitParam(paramType = "query", dataType = "String", name = "openid", value = "openid", required = true), | 
 |  |  |             @ApiImplicitParam(paramType = "query", dataType = "String", name = "token", value = "token", required = true), | 
 |  |  |     }) | 
 |  |  |     public ApiResponse wxAuthorize(@RequestParam String openid,String token) { | 
 |  |  |         WxPlatNotice wxPlatNotice = new WxPlatNotice(); | 
 |  |  |         List<String> idList = Arrays.asList(openid.split(",")); | 
 |  |  |         wxPlatNotice.testSendNotice(idList,token); | 
 |  |  |         return ApiResponse.success("查询成功"); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     @ApiOperation(value = "查询被访问人信息", notes = "查询被访问人信息") | 
 |  |  |     @PostMapping("/getVisitedMember") | 
 |  |  |     public ApiResponse<List<MemberVO>> getVisitedMember(@Valid @RequestBody CheckVisitedDTO checkVisitedDTO) { | 
 |  |  | 
 |  |  |         visits.setSourceType(Constants.ZERO); | 
 |  |  |         return ApiResponse.success("查询成功", visitsService.createFk(visits,false,Constants.ZERO)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     @ApiOperation(value = "来访事由", notes = "来访事由") | 
 |  |  |     @PostMapping("/visitReason") | 
 |  |  |     public ApiResponse<List<VisitReason>> visitReason() { | 
 |  |  | 
 |  |  |     @ApiOperation("访客记录 - 分页列表") | 
 |  |  |     @PostMapping("/visitPage") | 
 |  |  |     public ApiResponse<PageData<Visits>> visitPage (@RequestBody PageWrap<Visits> pageWrap) { | 
 |  |  |         if(Objects.isNull(pageWrap.getModel().getMemberId())){ | 
 |  |  |         if(Objects.isNull(pageWrap.getModel()) || StringUtils.isBlank(pageWrap.getModel().getOpenid())){ | 
 |  |  |             pageWrap.getModel().setMemberId(0); | 
 |  |  |         }else{ | 
 |  |  |             if(Objects.nonNull(pageWrap.getModel()) && Objects.nonNull(pageWrap.getModel().getStatus()) ){ | 
 |  |  |                 pageWrap.getModel().setBusinessStatus(pageWrap.getModel().getStatus()); | 
 |  |  |                 pageWrap.getModel().setStatus(null); | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |         return ApiResponse.success(visitsService.findPage(pageWrap)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 2025-3-25 14:14:34  加入取消预约 待审批、审批中、已审批 | 
 |  |  |      * @param visitId | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     @ApiOperation("取消预约") | 
 |  |  |     @GetMapping("/visitsSelfCancel") | 
 |  |  |     public ApiResponse visitsSelfCancel(@RequestParam Integer visitId,Integer memberId,@RequestParam String openid){ | 
 |  |  |         if(Objects.isNull(memberId)){ | 
 |  |  |             memberId = Constants.ZERO; | 
 |  |  |         } | 
 |  |  |         visitsService.visitsSelfCancel(visitId,memberId,openid); | 
 |  |  |         return ApiResponse.success(null); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  | } |