package cn.com.goldenwater.dcproj.controller.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.param.TacPblmInfoParam; import cn.com.goldenwater.dcproj.service.OlBisInspOrgService; import cn.com.goldenwater.dcproj.service.TacPblmInfoService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.StringUtils; 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 java.util.List; import java.util.Map; import java.util.TreeMap; /** * @author lune * @date 2019-6-19 */ @Api(value = "TAC 稽察问题信息表管理", tags = "TAC 稽察问题信息表管理") @RestController @RequestMapping("/tac/pblm/info") public class TacPblmStaticController extends BaseController { @Autowired private TacPblmInfoService tacPblmInfoService; @Autowired private OlBisInspOrgService olBisInspOrgService; @ApiOperation(value = "稽察问题统计新-- 标准库专业--对应新阶段流程信息") @RequestMapping(value = "/countPblmInfoByStbNew", method = RequestMethod.POST) public BaseResponse countPblmInfoByStb(@RequestBody TacPblmInfoParam pblmInfoParam) { pblmInfoParam.setProvince(olBisInspOrgService.getRlProvince(getCurrentOrgId())); if (StringUtils.isBlank(pblmInfoParam.getYears())) { return buildSuccessResponse(); } String[] yearArr = StringUtils.split(pblmInfoParam.getYears(), ","); Map> map = new TreeMap<>(); for (String year : yearArr) { pblmInfoParam.setYear(Long.parseLong(year)); List list = tacPblmInfoService.countPblmInfoByStbNew(pblmInfoParam); map.put(year, list); } return buildSuccessResponse(map); } }