package cn.com.goldenwater.dcproj.service.impl.tac; import cn.com.goldenwater.core.web.BaseController; import cn.com.goldenwater.core.web.BaseResponse; import cn.com.goldenwater.dcproj.dto.TacCountDto; import cn.com.goldenwater.dcproj.model.TacEvalationInform; import cn.com.goldenwater.dcproj.param.TacIndexParam; import cn.com.goldenwater.dcproj.service.OlBisInspOrgService; import cn.com.goldenwater.dcproj.service.TacIndexService; import cn.com.goldenwater.dcproj.target.Authority; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; import javax.servlet.http.HttpServletRequest; import java.util.List; /** * Created by jinshui on 2019/12/2. */ @Api(value = "稽察首页", tags = "稽察首页") @RestController @RequestMapping(value = "/tac/index") public class TacIndexController extends BaseController { private Logger logger = LoggerFactory.getLogger(getClass()); @Autowired private TacIndexService tacIndexService; @Autowired private OlBisInspOrgService olBisInspOrgService; @ApiOperation("本年度问题") @RequestMapping(value = "/countPblmByYear", method = RequestMethod.POST) public BaseResponse countPblmByYear(@RequestBody TacIndexParam tacIndexParam) { tacIndexParam.setProvince(olBisInspOrgService.getRlProvince(getCurrentOrgId())); TacCountDto tacCountDto = tacIndexService.countPblmByYear(tacIndexParam); return buildSuccessResponse(tacCountDto); } @ApiOperation("稽察进度") @RequestMapping(value = "/countAuditByYear", method = RequestMethod.POST) public BaseResponse countAuditByYear(@RequestBody TacIndexParam tacIndexParam) { tacIndexParam.setProvince(olBisInspOrgService.getRlProvince(getCurrentOrgId())); TacCountDto tacCountDto = tacIndexService.countAuditByYear(tacIndexParam); return buildSuccessResponse(tacCountDto); } @ApiOperation("项目类型") @RequestMapping(value = "/countObjByYear", method = RequestMethod.POST) public BaseResponse> countObjByYear(@RequestBody TacIndexParam tacIndexParam) { tacIndexParam.setProvince(olBisInspOrgService.getRlProvince(getCurrentOrgId())); List list = tacIndexService.countObjByYear(tacIndexParam); return buildSuccessResponse(list); } @Authority @ApiOperation("地区稽察次数统计") @RequestMapping(value = "/countAdcodeAuditByYear", method = RequestMethod.POST) public BaseResponse> countAdcodeAuditByYear(@RequestBody TacIndexParam tacIndexParam) { tacIndexParam.setProvince(olBisInspOrgService.getRlProvince(getCurrentOrgId())); List list = tacIndexService.countAdcodeAuditByYear(tacIndexParam); return buildSuccessResponse(list); } @ApiOperation(value = "稽察问题统计") @RequestMapping(value = "/countPblmInfoByYear", method = RequestMethod.POST) public BaseResponse> countPblmInfoByStb(@RequestBody TacIndexParam tacIndexParam) { tacIndexParam.setProvince(olBisInspOrgService.getRlProvince(getCurrentOrgId())); List list = tacIndexService.countPblmInfoByYear(tacIndexParam); return buildSuccessResponse(list); } @ApiOperation(value = "获取我的消息列表") @RequestMapping(value = "/getPersMessagePage", method = RequestMethod.POST) public BaseResponse> getPersMessagePage(@RequestBody TacIndexParam tacIndexParam, HttpServletRequest request) { if (StringUtils.isBlank(tacIndexParam.getPersId())) { tacIndexParam.setPersId(getCurrentPersId()); } tacIndexParam.setProvince(olBisInspOrgService.getRlProvince(getCurrentOrgId())); List pageInfo = tacIndexService.getPersMessagePage(tacIndexParam); return buildSuccessResponse(pageInfo); } @ApiOperation(value = "稽察首页地图") @RequestMapping(value = "/getAreaList", method = RequestMethod.POST) public BaseResponse> getAreaList(@RequestBody TacIndexParam tacIndexParam, HttpServletRequest request) { if (StringUtils.isBlank(tacIndexParam.getPersId())) { String persId = getCurrentPersId(); if (StringUtils.isBlank(persId)) { return buildFailResponse(); } tacIndexParam.setPersId(persId); } tacIndexParam.setProvince(olBisInspOrgService.getRlProvince(getCurrentOrgId())); List result = tacIndexService.getAreaList(tacIndexParam); return buildSuccessResponse(result); } }