| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- 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<TacCountDto> 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<TacCountDto> 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<List<TacCountDto>> countObjByYear(@RequestBody TacIndexParam tacIndexParam) {
- tacIndexParam.setProvince(olBisInspOrgService.getRlProvince(getCurrentOrgId()));
- List<TacCountDto> list = tacIndexService.countObjByYear(tacIndexParam);
- return buildSuccessResponse(list);
- }
- @Authority
- @ApiOperation("地区稽察次数统计")
- @RequestMapping(value = "/countAdcodeAuditByYear", method = RequestMethod.POST)
- public BaseResponse<List<TacCountDto>> countAdcodeAuditByYear(@RequestBody TacIndexParam tacIndexParam) {
- tacIndexParam.setProvince(olBisInspOrgService.getRlProvince(getCurrentOrgId()));
- List<TacCountDto> list = tacIndexService.countAdcodeAuditByYear(tacIndexParam);
- return buildSuccessResponse(list);
- }
- @ApiOperation(value = "稽察问题统计")
- @RequestMapping(value = "/countPblmInfoByYear", method = RequestMethod.POST)
- public BaseResponse<List<TacCountDto>> countPblmInfoByStb(@RequestBody TacIndexParam tacIndexParam) {
- tacIndexParam.setProvince(olBisInspOrgService.getRlProvince(getCurrentOrgId()));
- List<TacCountDto> list = tacIndexService.countPblmInfoByYear(tacIndexParam);
- return buildSuccessResponse(list);
- }
- @ApiOperation(value = "获取我的消息列表")
- @RequestMapping(value = "/getPersMessagePage", method = RequestMethod.POST)
- public BaseResponse<List<TacEvalationInform>> getPersMessagePage(@RequestBody TacIndexParam tacIndexParam, HttpServletRequest request) {
- if (StringUtils.isBlank(tacIndexParam.getPersId())) {
- tacIndexParam.setPersId(getCurrentPersId());
- }
- tacIndexParam.setProvince(olBisInspOrgService.getRlProvince(getCurrentOrgId()));
- List<TacEvalationInform> pageInfo = tacIndexService.getPersMessagePage(tacIndexParam);
- return buildSuccessResponse(pageInfo);
- }
- @ApiOperation(value = "稽察首页地图")
- @RequestMapping(value = "/getAreaList", method = RequestMethod.POST)
- public BaseResponse<List<TacCountDto>> 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<TacCountDto> result = tacIndexService.getAreaList(tacIndexParam);
- return buildSuccessResponse(result);
- }
- }
|