| | |
| | | package com.doumee.cloud.admin; |
| | | |
| | | import com.doumee.api.BaseController; |
| | | 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.admin.response.PCWorkPlatformDataVO; |
| | | import com.doumee.dao.admin.response.StagingDataVO; |
| | | import com.doumee.dao.business.model.Visits; |
| | | import com.doumee.dao.system.dto.NoticesDTO; |
| | | import com.doumee.dao.system.model.Notices; |
| | | import com.doumee.dao.web.response.InternalHomeVO; |
| | | import com.doumee.service.business.ApproveService; |
| | | import com.doumee.service.business.MemberService; |
| | | import com.doumee.service.business.VisitsService; |
| | | import com.doumee.service.business.impl.hksync.HkSyncNoticeServiceImpl; |
| | | import com.doumee.service.system.NoticesService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * Created by IntelliJ IDEA. |
| | |
| | | private VisitsService visitsService; |
| | | |
| | | @Autowired |
| | | private HkSyncNoticeServiceImpl hkSyncNoticeService; |
| | | @Autowired |
| | | private NoticesService noticesService; |
| | | |
| | | @Autowired |
| | | private ApproveService approveService; |
| | | |
| | | |
| | | @ApiOperation("头部数据") |
| | |
| | | } |
| | | |
| | | |
| | | @ApiOperation("任务中心分页") |
| | | @PostMapping("/taskPage") |
| | | @RequiresPermissions("business:notices:query") |
| | | public ApiResponse<PageData<Notices>> taskPage (@RequestBody PageWrap<Notices> pageWrap) { |
| | | pageWrap.getModel().setPalt(Constants.ZERO); |
| | | return ApiResponse.success(noticesService.findPage(pageWrap)); |
| | | |
| | | @ApiOperation(value = "任务中心头部 - H5", notes = "H5") |
| | | @GetMapping("/taskCenterHead") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "isDetail", value = " 是否查询详细 1是;0否", required = true), |
| | | }) |
| | | public ApiResponse<InternalHomeVO> taskCenterHead(@RequestParam Integer isDetail,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | LoginUserInfo loginUserInfo = getLoginUser(token); |
| | | hkSyncNoticeService.syncHkNotices(loginUserInfo.getUsername()); |
| | | return ApiResponse.success("查询成功",approveService.getHomeDataH5(getLoginUser(token).getMemberId(),isDetail)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "任务中心头部 - PC", notes = "PC") |
| | | @PostMapping("/taskCenterHeadPC") |
| | | public ApiResponse<InternalHomeVO> taskCenterHeadPC(@RequestBody NoticesDTO noticesDTO,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | LoginUserInfo loginUserInfo = getLoginUser(token); |
| | | hkSyncNoticeService.syncHkNotices(loginUserInfo.getUsername()); |
| | | noticesDTO.setMemberId(loginUserInfo.getMemberId()); |
| | | noticesDTO.setUserId(loginUserInfo.getId()); |
| | | return ApiResponse.success("查询成功",approveService.getHomeDataPC(noticesDTO)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("任务中心分页") |
| | | @PostMapping("/taskPage") |
| | | public ApiResponse<PageData<Notices>> taskPage (@RequestBody PageWrap<NoticesDTO> pageWrap, @RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | LoginUserInfo loginUserInfo = getLoginUser(token); |
| | | pageWrap.getModel().setMemberId(loginUserInfo.getMemberId()); |
| | | // pageWrap.getModel().setUserId(loginUserInfo.getId()); |
| | | return ApiResponse.success(noticesService.taskCanterPage(pageWrap)); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation("标记已读") |
| | | @GetMapping("/signRead") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "noticesId", value = "记录主键", required = false), |
| | | @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "signType", value = "标记类型:0=单个标记;1=标记全部未读", required = false), |
| | | }) |
| | | public ApiResponse signRead (Integer noticesId,@RequestParam Integer signType, @RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | LoginUserInfo loginUserInfo = getLoginUser(token); |
| | | if(Constants.equalsInteger(signType,Constants.ZERO)){ |
| | | noticesService.signReadById(noticesId); |
| | | }else{ |
| | | noticesService.signRead(loginUserInfo.getMemberId()); |
| | | } |
| | | return ApiResponse.success("操作成功"); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("PC工作台") |
| | | @GetMapping("/pCWorkPlatformData") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "queryType", value = "查询类型:1=在园人数;2=报表数据;3=待办事项;4=超时预警", required = true), |
| | | }) |
| | | public ApiResponse<PCWorkPlatformDataVO> pCWorkPlatformData (@RequestParam Integer queryType, @RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | if(queryType==Constants.THREE){ |
| | | //同步海康代办数据 |
| | | hkSyncNoticeService.syncHkNotices(this.getLoginUser(token).getUsername()); |
| | | } |
| | | PCWorkPlatformDataVO pcWorkPlatformDataVO = visitsService.getPcWorkPlatformData(queryType,getLoginUser(token)); |
| | | return ApiResponse.success("查询成功",pcWorkPlatformDataVO); |
| | | } |
| | | } |