package cn.com.goldenwater.dcproj.controller.homepage; import cn.com.goldenwater.core.web.BaseController; import cn.com.goldenwater.core.web.BaseResponse; import cn.com.goldenwater.dcproj.dto.*; import cn.com.goldenwater.dcproj.model.BisInspPblm; import cn.com.goldenwater.dcproj.model.DuchaObj; import cn.com.goldenwater.dcproj.model.ObjPerson; import cn.com.goldenwater.dcproj.param.IndexParam; import cn.com.goldenwater.dcproj.param.IndexParamPage; import cn.com.goldenwater.dcproj.param.IndexPblmParam; import cn.com.goldenwater.dcproj.service.OlBisInspOrgService; import cn.com.goldenwater.dcproj.service.PcIndexService; import com.github.pagehelper.PageInfo; 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.*; import java.time.LocalDate; import java.time.format.DateTimeFormatter; import java.util.List; import java.util.Map; @Api(value = "PC后台首页", tags = "PC后台首页接口") @RestController @RequestMapping("/pc/index") public class PcIndexController extends BaseController { @Autowired private PcIndexService pcIndexService; @Autowired private OlBisInspOrgService inspOrgService; @ApiOperation(value = "统计当前时间,日,周,月累计新增问题") @RequestMapping(value = "/timeCount", method = RequestMethod.GET) public BaseResponse> timeCount() { Map params = pcIndexService.timeCount(getCurrentOrgId()); return buildSuccessResponse(params); } @ApiOperation(value = "根据开始时间,结束时间,所选机构返回督查对象所排除的督查组") @RequestMapping(value = "/countGroup", method = RequestMethod.POST) public BaseResponse> countGroup(@RequestBody IndexParam indexParam) { indexParam.setProvince(inspOrgService.getProvince(getCurrentOrgId())); indexParam.setOrgId(getCurrentOrgId()); List typeDtoList = pcIndexService.countGroup(indexParam); return buildSuccessResponse(typeDtoList); } @ApiOperation(value = "根据开始时间,结束时间,所选机构返回督查对象所排除的督查人员数量") @RequestMapping(value = "/countPerson", method = RequestMethod.POST) public BaseResponse> countPerson(@RequestBody IndexParam indexParam) { indexParam.setProvince(inspOrgService.getProvince(getCurrentOrgId())); List typeDtoList = pcIndexService.countPerson(indexParam); return buildSuccessResponse(typeDtoList); } @ApiOperation(value = "根据开始时间,结束时间,所选机构返回全部类型督查对象个数(已督查)") @RequestMapping(value = "/countDucha", method = RequestMethod.POST) public BaseResponse> countDucha(@RequestBody IndexParam indexParam) { indexParam.setProvince(inspOrgService.getProvince(getCurrentOrgId())); List typeDtoList = pcIndexService.countDucha(indexParam); return buildSuccessResponse(typeDtoList); } @ApiOperation(value = "根据开始时间,结束时间,所选机构返回全部类别督查对象,发现问题统计") @RequestMapping(value = "/countPblmByType", method = RequestMethod.POST) public BaseResponse> countPblmByType(@RequestBody IndexParam indexParam) { indexParam.setProvince(inspOrgService.getProvince(getCurrentOrgId())); List typeDtoList = pcIndexService.countPblmByType(indexParam); return buildSuccessResponse(typeDtoList); } @ApiOperation(value = "返回不同机构,不同督查对象类型计划全部督查个数,按机构对象类型分,type=org为机构统计,type=pType为按对象类型统计") @RequestMapping(value = "/countPlanByOrgOrType/{type}", method = RequestMethod.POST) public BaseResponse> countPlanByOrgOrType(@PathVariable String type) { List typeDtoList = pcIndexService.countPlanByOrgOrType(type, getCurrentOrgId()); return buildSuccessResponse(typeDtoList); } @ApiOperation(value = "根据开始日期结束日期,所选机构,对象类型,返回督查对象个数统计") @RequestMapping(value = "/countPlan", method = RequestMethod.POST) public BaseResponse> countPlan(@RequestBody IndexParam indexParam) { indexParam.setProvince(inspOrgService.getProvince(getCurrentOrgId())); List typeDtoList = pcIndexService.countPlan(indexParam); return buildSuccessResponse(typeDtoList); } @ApiOperation(value = "根据开始日期结束日期,所选机构,对象类型,按行政省统计督查对象个数") @RequestMapping(value = "/countPlanByPro", method = RequestMethod.POST) public BaseResponse> countPlanByPro(@RequestBody IndexParam indexParam) { indexParam.setProvince(inspOrgService.getProvince(getCurrentOrgId())); List typeDtoList = pcIndexService.countPlanByPro(indexParam); return buildSuccessResponse(typeDtoList); } @ApiOperation(value = "根据开始日期结束日期,所选机构,对象类型,返回督查问题个数统计") @RequestMapping(value = "/countPblm", method = RequestMethod.POST) public BaseResponse> countPblm(@RequestBody IndexParam indexParam) { indexParam.setProvince(inspOrgService.getProvince(getCurrentOrgId())); List typeDtoList = pcIndexService.countPblm(indexParam); return buildSuccessResponse(typeDtoList); } @ApiOperation(value = "根据开始日期结束日期,所选机构,对象类型,按照行政省返回督查组统计") @RequestMapping(value = "/countGroupByPro", method = RequestMethod.POST) public BaseResponse> countGroupByPro(@RequestBody IndexParam indexParam) { indexParam.setProvince(inspOrgService.getProvince(getCurrentOrgId())); List typeDtoList = pcIndexService.countGroupByPro(indexParam); return buildSuccessResponse(typeDtoList); } @ApiOperation(value = "根据开始日期结束日期,所选机构,对象类型,按照行政省返回督查人员统计") @RequestMapping(value = "/countPersonByPro", method = RequestMethod.POST) public BaseResponse> countPersonByPro(@RequestBody IndexParam indexParam) { indexParam.setProvince(inspOrgService.getProvince(getCurrentOrgId())); List typeDtoList = pcIndexService.countPersonByPro(indexParam); return buildSuccessResponse(typeDtoList); } @ApiOperation(value = "根据开始日期结束日期,所选机构,对象类型,返回督查问题个数统计(按照严重程度,行政省统计)") @RequestMapping(value = "/countPblmByPro", method = RequestMethod.POST) public BaseResponse> countPblmByPro(@RequestBody IndexParam indexParam) { indexParam.setProvince(inspOrgService.getProvince(getCurrentOrgId())); List typeDtoList = pcIndexService.countPblmByPro(indexParam); return buildSuccessResponse(typeDtoList); } @ApiOperation(value = "获取在线人数和所在组") @RequestMapping(value = "/countPersOnline", method = RequestMethod.POST) public BaseResponse countPersOnline(@RequestBody IndexParam indexParam) { indexParam.setOrgId(getCurrentOrgId()); PersOnlineDto pers = pcIndexService.countPersOnline(indexParam); return buildSuccessResponse(pers); } @ApiOperation(value = "按照当前时间,统计问题数量") @RequestMapping(value = "/countPblmByTime", method = RequestMethod.POST) public BaseResponse> countPblmByTime(@RequestBody IndexPblmParam indexPblmParam) { indexPblmParam.setProvince(inspOrgService.getProvince(getCurrentOrgId())); if (StringUtils.isEmpty(indexPblmParam.getSttm())) { if (StringUtils.isEmpty(indexPblmParam.getEttm())) { LocalDate dttm = LocalDate.now(); DateTimeFormatter dtfDay = DateTimeFormatter.ofPattern("yyyy-MM-dd"); indexPblmParam.setEttm(dttm.format(dtfDay)); } } else { if (StringUtils.isEmpty(indexPblmParam.getEttm())) { indexPblmParam.setEttm(indexPblmParam.getSttm()); indexPblmParam.setSttm(""); } } List list = pcIndexService.countPblmByTime(indexPblmParam); return buildSuccessResponse(list); } @ApiOperation(value = "按照行政区划督查类型下督查组数量") @RequestMapping(value = "/findGroupByAdCode", method = RequestMethod.POST) public BaseResponse> findGroupByAdCode(@RequestBody IndexParamPage indexParamPage) { indexParamPage.setProvince(inspOrgService.getProvince(getCurrentOrgId())); return buildSuccessResponse(pcIndexService.countGroupByAdCode(indexParamPage)); } @ApiOperation(value = "按照行政区划督查类型下督查人员数量") @RequestMapping(value = "/findPerByAdCode", method = RequestMethod.POST) public BaseResponse> findPerByAdCode(@RequestBody IndexParamPage indexParamPage) { indexParamPage.setProvince(inspOrgService.getProvince(getCurrentOrgId())); return buildSuccessResponse(pcIndexService.findPerByAdCode(indexParamPage)); } @ApiOperation(value = "按照行政区划督查类型下督查对象数量") @RequestMapping(value = "/findObjByAdCode", method = RequestMethod.POST) public BaseResponse> findObjByAdCode(@RequestBody IndexParamPage indexParamPage) { indexParamPage.setProvince(inspOrgService.getProvince(getCurrentOrgId())); return buildSuccessResponse(pcIndexService.findObjByAdCode(indexParamPage)); } @ApiOperation(value = "按照行政区划督查类型下督查对象数量") @RequestMapping(value = "/findPblmByAdCode", method = RequestMethod.POST) public BaseResponse> findPblmByAdCode(@RequestBody IndexParamPage indexParamPage) { indexParamPage.setProvince(inspOrgService.getProvince(getCurrentOrgId())); return buildSuccessResponse(pcIndexService.findPblmByAdCode(indexParamPage)); } @ApiOperation(value = "按照行政区划督查类型下督查组数量") @RequestMapping(value = "/findGroupCountByAdCode", method = RequestMethod.POST) public BaseResponse> findGroupCountByAdCode(@RequestBody IndexParamPage indexParamPage) { indexParamPage.setProvince(inspOrgService.getProvince(getCurrentOrgId())); return buildSuccessResponse(pcIndexService.findGroupCountByAdCode(indexParamPage)); } @ApiOperation(value = "按照行政区划督查类型下督查人员数量") @RequestMapping(value = "/findPerCountByAdCode", method = RequestMethod.POST) public BaseResponse> findPerCountByAdCode(@RequestBody IndexParamPage indexParamPage) { indexParamPage.setProvince(inspOrgService.getProvince(getCurrentOrgId())); return buildSuccessResponse(pcIndexService.findPerCountByAdCode(indexParamPage)); } @ApiOperation(value = "按照行政区划督查类型下督查对象数量") @RequestMapping(value = "/findObjCountByAdCode", method = RequestMethod.POST) public BaseResponse> findObjCountByAdCode(@RequestBody IndexParamPage indexParamPage) { indexParamPage.setProvince(inspOrgService.getProvince(getCurrentOrgId())); return buildSuccessResponse(pcIndexService.findObjCountByAdCode(indexParamPage)); } @ApiOperation(value = "按照行政区划督查类型下督查对象数量") @RequestMapping(value = "/findPblmCountByAdCode", method = RequestMethod.POST) public BaseResponse> findPblmCountByAdCode(@RequestBody IndexParamPage indexParamPage) { indexParamPage.setProvince(inspOrgService.getProvince(getCurrentOrgId())); return buildSuccessResponse(pcIndexService.findPblmCountByAdCode(indexParamPage)); } }