|  |  |  | 
|---|
|  |  |  | 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 io.swagger.annotations.ApiImplicitParams; | 
|---|
|  |  |  | 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.List; | 
|---|
|  |  |  | import java.util.Objects; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * Created by IntelliJ IDEA. | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiOperation(value = "访客微信授权", notes = "访客微信授权获取openId") | 
|---|
|  |  |  | @GetMapping("/wxAuthorize") | 
|---|
|  |  |  | @ApiImplicitParams({ | 
|---|
|  |  |  | @ApiImplicitParam(paramType = "query", dataType = "String", name = "code", value = "授权码", required = true) | 
|---|
|  |  |  | @ApiImplicitParam(paramType = "query", dataType = "String", name = "code", value = "授权码", required = true), | 
|---|
|  |  |  | @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "source", value = "来源:0=司机;1=访客;2=内部员工", required = true) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | public ApiResponse<WxAuthorizeVO> wxAuthorize(@RequestParam String code) { | 
|---|
|  |  |  | WxAuthorizeVO wxAuthorizeVO =  memberService.wxAuthorize(code); | 
|---|
|  |  |  | public ApiResponse<WxAuthorizeVO> wxAuthorize(@RequestParam String code,@RequestParam Integer source) { | 
|---|
|  |  |  | WxAuthorizeVO wxAuthorizeVO =  memberService.wxAuthorize(code,source); | 
|---|
|  |  |  | return ApiResponse.success("查询成功",wxAuthorizeVO); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | @PostMapping("/createFk") | 
|---|
|  |  |  | public ApiResponse createFk(@RequestBody Visits visits) { | 
|---|
|  |  |  | visits.setSourceType(Constants.ZERO); | 
|---|
|  |  |  | return ApiResponse.success("查询成功", visitsService.createFk(visits,false)); | 
|---|
|  |  |  | return ApiResponse.success("查询成功", visitsService.createFk(visits,false,Constants.ZERO)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation(value = "访客记录详情", notes = "访客记录详情") | 
|---|
|  |  |  | @GetMapping("/detail") | 
|---|
|  |  |  | public ApiResponse<VisitDetailVO> detail(@RequestParam Integer id) { | 
|---|
|  |  |  | return ApiResponse.success("查询成功", visitsService.getVisitDetail(id,null)); | 
|---|
|  |  |  | public ApiResponse<VisitDetailVO> detail(@RequestParam Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
|---|
|  |  |  | LoginUserInfo loginUserInfo = getLoginUser(token); | 
|---|
|  |  |  | return ApiResponse.success("查询成功", visitsService.getVisitDetail(id, Objects.isNull(loginUserInfo)?null:loginUserInfo.getMemberId())); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("访客记录 - 分页列表") | 
|---|
|  |  |  | @PostMapping("/visitPage") | 
|---|
|  |  |  | public ApiResponse<PageData<Visits>> visitPage (@RequestBody PageWrap<Visits> pageWrap,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
|---|
|  |  |  | LoginUserInfo loginUserInfo = getLoginUser(token); | 
|---|
|  |  |  | pageWrap.getModel().setMemberId(loginUserInfo.getMemberId()); | 
|---|
|  |  |  | public ApiResponse<PageData<Visits>> visitPage (@RequestBody PageWrap<Visits> pageWrap) { | 
|---|
|  |  |  | return ApiResponse.success(visitsService.findPage(pageWrap)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|