cbe11e9522326dc9ab7037eeab46e4724a3f3bb2.svn-base 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. package cn.com.goldenwater.dcproj.controller.tac;
  2. import cn.com.goldenwater.core.web.BaseController;
  3. import cn.com.goldenwater.core.web.BaseResponse;
  4. import cn.com.goldenwater.dcproj.dto.TacCountDto;
  5. import cn.com.goldenwater.dcproj.param.TacPblmInfoParam;
  6. import cn.com.goldenwater.dcproj.service.OlBisInspOrgService;
  7. import cn.com.goldenwater.dcproj.service.TacPblmInfoService;
  8. import io.swagger.annotations.Api;
  9. import io.swagger.annotations.ApiOperation;
  10. import org.apache.commons.lang3.StringUtils;
  11. import org.springframework.beans.factory.annotation.Autowired;
  12. import org.springframework.web.bind.annotation.RequestBody;
  13. import org.springframework.web.bind.annotation.RequestMapping;
  14. import org.springframework.web.bind.annotation.RequestMethod;
  15. import org.springframework.web.bind.annotation.RestController;
  16. import java.util.List;
  17. import java.util.Map;
  18. import java.util.TreeMap;
  19. /**
  20. * @author lune
  21. * @date 2019-6-19
  22. */
  23. @Api(value = "TAC 稽察问题信息表管理", tags = "TAC 稽察问题信息表管理")
  24. @RestController
  25. @RequestMapping("/tac/pblm/info")
  26. public class TacPblmStaticController extends BaseController {
  27. @Autowired
  28. private TacPblmInfoService tacPblmInfoService;
  29. @Autowired
  30. private OlBisInspOrgService olBisInspOrgService;
  31. @ApiOperation(value = "稽察问题统计新-- 标准库专业--对应新阶段流程信息")
  32. @RequestMapping(value = "/countPblmInfoByStbNew", method = RequestMethod.POST)
  33. public BaseResponse countPblmInfoByStb(@RequestBody TacPblmInfoParam pblmInfoParam) {
  34. pblmInfoParam.setProvince(olBisInspOrgService.getRlProvince(getCurrentOrgId()));
  35. if (StringUtils.isBlank(pblmInfoParam.getYears())) {
  36. return buildSuccessResponse();
  37. }
  38. String[] yearArr = StringUtils.split(pblmInfoParam.getYears(), ",");
  39. Map<String, List<TacCountDto>> map = new TreeMap<>();
  40. for (String year : yearArr) {
  41. pblmInfoParam.setYear(Long.parseLong(year));
  42. List<TacCountDto> list = tacPblmInfoService.countPblmInfoByStbNew(pblmInfoParam);
  43. map.put(year, list);
  44. }
  45. return buildSuccessResponse(map);
  46. }
  47. }