| | |
| | | package com.doumee.cloud.web; |
| | | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.cloud.web.ApiController; |
| | | import com.doumee.config.annotation.LoginNoRequired; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | 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.core.utils.Constants; |
| | | import com.doumee.dao.business.model.Visits; |
| | | import com.doumee.dao.system.dto.LoginDTO; |
| | | import com.doumee.dao.web.reqeust.AccountLoginDTO; |
| | | import com.doumee.dao.web.reqeust.AuditApproveDTO; |
| | | import com.doumee.dao.web.reqeust.VisitMemberDTO; |
| | |
| | | import com.doumee.service.business.ApproveService; |
| | | import com.doumee.service.business.MemberService; |
| | | import com.doumee.service.business.VisitsService; |
| | | import com.doumee.service.system.SystemLoginService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.server.reactive.ServerHttpRequest; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.server.ServerWebExchange; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * Created by IntelliJ IDEA. |
| | |
| | | @RequestMapping(Constants.CLOUD_SERVICE_URL_INDEX+"/web/member") |
| | | @Slf4j |
| | | @LoginNoRequired |
| | | public class InternalWebController extends ApiController { |
| | | public class InternalWebController extends BaseController { |
| | | |
| | | @Autowired |
| | | private MemberService memberService; |
| | |
| | | @Autowired |
| | | private ApproveService approveService; |
| | | |
| | | @ApiOperation(value = "人员登录", notes = "H5") |
| | | @PostMapping("/accountLogin") |
| | | public ApiResponse<WxAuthorizeVO> accountLogin(@RequestBody AccountLoginDTO accountLoginDTO) { |
| | | WxAuthorizeVO wxAuthorizeVO = memberService.accountLogin(accountLoginDTO); |
| | | return ApiResponse.success("登录成功",wxAuthorizeVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "内部人员首页", notes = "H5") |
| | | @GetMapping("/internalHome") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true), |
| | | }) |
| | | public ApiResponse<InternalHomeVO> internalHome() { |
| | | return ApiResponse.success("查询成功",approveService.getHomeData(getMemberId())); |
| | | } |
| | | |
| | | // @ApiOperation(value = "内部人员首页", notes = "H5") |
| | | // @GetMapping("/internalHome") |
| | | // public ApiResponse<InternalHomeVO> internalHome(@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | // return ApiResponse.success("查询成功",approveService.getHomeData(getLoginUser(token).getMemberId())); |
| | | // } |
| | | |
| | | @ApiOperation("任务中心") |
| | | @PostMapping("/taskCenter") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true), |
| | | }) |
| | | public ApiResponse<PageData<VisitRecordVO>> taskCenter (@RequestBody PageWrap<VisitRecordDTO> pageWrap) { |
| | | pageWrap.getModel().setMemberId(getMemberId()); |
| | | public ApiResponse<PageData<VisitRecordVO>> taskCenter (@RequestBody PageWrap<VisitRecordDTO> pageWrap,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | pageWrap.getModel().setMemberId(getLoginUser(token).getMemberId()); |
| | | return ApiResponse.success(visitsService.taskCenter(pageWrap)); |
| | | } |
| | | |
| | | @ApiOperation("访客记录详情") |
| | | @GetMapping("/visitDetail") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true), |
| | | @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "id", value = "记录主键", required = true) |
| | | }) |
| | | public ApiResponse<VisitDetailVO> visitDetail (@RequestParam Integer id) { |
| | | return ApiResponse.success(visitsService.getVisitDetail(id)); |
| | | } |
| | | // @ApiOperation("访客记录详情") |
| | | // @GetMapping("/visitDetail") |
| | | // @ApiImplicitParams({ |
| | | // @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true), |
| | | // @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "id", value = "记录主键", required = true) |
| | | // }) |
| | | // public ApiResponse<VisitDetailVO> visitDetail (@RequestParam Integer id) { |
| | | // return ApiResponse.success(visitsService.getVisitDetail(id)); |
| | | // } |
| | | |
| | | |
| | | @ApiOperation(value = "人员分页",notes = "可拜访内部人员") |
| | | @PostMapping("/memberList") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true), |
| | | }) |
| | | public ApiResponse<PageData<MemberVO>> memberList (@RequestBody PageWrap<VisitMemberDTO> pageWrap) { |
| | | public ApiResponse<PageData<MemberVO>> memberList (@RequestBody PageWrap<VisitMemberDTO> pageWrap,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | return ApiResponse.success(memberService.getVisitedMemberList(pageWrap)); |
| | | } |
| | | |
| | | @ApiOperation(value = "访客记录提交", notes = "内部人员提交") |
| | | @PostMapping("/createVisit") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true), |
| | | }) |
| | | public ApiResponse createVisit(@RequestBody Visits visits) { |
| | | visits.setCreateMemberId(getMemberId()); |
| | | public ApiResponse createVisit(@RequestBody Visits visits,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | visits.setCreateMemberId(getLoginUser(token).getMemberId()); |
| | | return ApiResponse.success("查询成功", visitsService.createFk(visits,false)); |
| | | } |
| | | |
| | | @ApiOperation(value = "审批流记录审批", notes = "内部人员") |
| | | @PostMapping("/auditApprove") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true), |
| | | }) |
| | | public ApiResponse auditApprove(@RequestBody AuditApproveDTO auditApproveDTO) { |
| | | public ApiResponse auditApprove(@RequestBody AuditApproveDTO auditApproveDTO,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | visitsService.auditApprove(auditApproveDTO); |
| | | return ApiResponse.success("操作成功"); |
| | | } |