package cn.com.goldenwater.dcproj.controller.pblm; import cn.com.goldenwater.core.web.BaseController; import cn.com.goldenwater.core.web.BaseResponse; import cn.com.goldenwater.dcproj.constValue.AdCodeLabel; import cn.com.goldenwater.dcproj.constValue.BisInspEnum; import cn.com.goldenwater.dcproj.constValue.BisInspObjEnum; import cn.com.goldenwater.dcproj.constValue.CommonLabel; import cn.com.goldenwater.dcproj.dao.BisInspPblmDao; import cn.com.goldenwater.dcproj.dao.BisInspPblmRepeatDao; import cn.com.goldenwater.dcproj.dao.BisInspRsvrRgstrRepeatDao; import cn.com.goldenwater.dcproj.dto.*; import cn.com.goldenwater.dcproj.model.*; import cn.com.goldenwater.dcproj.param.*; import cn.com.goldenwater.dcproj.service.*; import cn.com.goldenwater.dcproj.target.Authority; import cn.com.goldenwater.dcproj.utils.AdLevelUtil; import cn.com.goldenwater.dcproj.utils.InspPblmUtils; import cn.com.goldenwater.dcproj.utils.InspUtils; import cn.com.goldenwater.target.CheckException; import cn.com.goldenwater.util.common.SqlUtils; import com.github.pagehelper.PageInfo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import org.apache.commons.lang3.StringUtils; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.net.URLEncoder; import java.text.SimpleDateFormat; import java.util.*; /** * @author lune * @date 2019-2-18 */ @Api(value = "APP 督查问题管理", tags = "APP 督查问题管理") @RestController @RequestMapping("/dc/insp/pblm") public class BisInspPblmController extends BaseController { private Logger logger = LoggerFactory.getLogger(getClass()); @Autowired private OlBisInspOrgService olBisInspOrgService; @Autowired private BisInspPblmService bisInspPblmService; @Autowired private ObjInspPblmsService objInspPblmsService; @Autowired private GwComFileService gwComFileService; @Autowired private BisInspAllRlationPersService inspAllRlationPersService; @Autowired private BisZhejiangVillRgstrService bisZhejiangVillRgstrService; @Autowired private BisInspMfdpRgstrService bisInspMfdpRgstrService; @Autowired private BisNewVillRgstrService bisNewVillRgstrService; @Autowired private BisInspWtdstTrackService bisInspWtdstTrackService; @Autowired private BisInspChmclsUseunitwkService bisInspChmclsUseunitwkService; @ApiOperation(value = "添加(修改)督查问题管理") @RequestMapping(value = "", method = RequestMethod.POST) public BaseResponse insert(@ApiParam(name = "bisInspPblm", value = "bisInspPblm", required = true) @RequestBody BisInspPblm bisInspPblm) { bisInspPblm.setOrgId(getCurrentOrgId()); bisInspPblm.setRecPers(getCurrentPersId()); if (StringUtils.isNotBlank(bisInspPblm.getPblmsTypeId()) && !BisInspEnum.EMPWT.getValue().equals(bisInspPblm.getObjType())) { bisInspPblm.setPblmsTypeId(bisInspPblm.getPblmsTypeId().trim()); ObjInspPblms objInspPblms = objInspPblmsService.get(bisInspPblm.getPblmsTypeId()); if (objInspPblms != null) { bisInspPblm.setInspPblmCode(objInspPblms.getSn()); bisInspPblm.setInspPblmType(objInspPblms.getSort2()); bisInspPblm.setCheckPointBz(objInspPblms.getCheckPoint()); bisInspPblm.setPblmDescBz(objInspPblms.getPblmDesc()); bisInspPblm.setPblmNameBz(objInspPblms.getInspPblmsName()); bisInspPblm.setSnNumBz(objInspPblms.getSnNum()); bisInspPblm.setFileNo(objInspPblms.getAttach()); bisInspPblm.setFileNoNumber(objInspPblms.getSnNum()); bisInspPblm.setScore(objInspPblms.getScore()); bisInspPblm.setSnNum(objInspPblms.getSnNum()); } } if (BisInspEnum.VILL2020.getValue().equals(bisInspPblm.getObjType())) { if (BisInspObjEnum.CWS2020.getDesc().equals(bisInspPblm.getInspPblmName())) { bisInspPblm.setVillType(BisInspObjEnum.CWS2020.getValue()); } if (BisInspObjEnum.CWS2020LAW.getDesc().equals(bisInspPblm.getInspPblmName())) { bisInspPblm.setVillType(BisInspObjEnum.CWS2020LAW.getValue()); } if (BisInspObjEnum.CWS2020WATER.getDesc().equals(bisInspPblm.getInspPblmName())) { bisInspPblm.setVillType(BisInspObjEnum.CWS2020WATER.getValue()); } } if (StringUtils.isNotBlank(bisInspPblm.getPblmId())) { // 修改问题 if (BisInspEnum.EMPWT.getValue().equals(bisInspPblm.getObjType()) || BisInspEnum.EMPWTRUN.getValue().equals(bisInspPblm.getObjType())) { if (StringUtils.isBlank(bisInspPblm.getPblmsId())) { bisInspPblm.setPblmsId(CommonLabel.INIT_DATA); } if (StringUtils.isBlank(bisInspPblm.getPblmsTypeId())) { bisInspPblm.setPblmsTypeId(CommonLabel.INIT_DATA); } if (StringUtils.isBlank(bisInspPblm.getQualityTypeId())) { bisInspPblm.setQualityTypeId(CommonLabel.INIT_DATA); } if (StringUtils.isBlank(bisInspPblm.getDefectTypeId())) { bisInspPblm.setDefectTypeId(CommonLabel.INIT_DATA); } } bisInspPblmService.updatePblm(bisInspPblm); return buildSuccessResponse(200, "修改成功", bisInspPblm); } bisInspPblmService.insertPblms(bisInspPblm); return buildSuccessResponse(bisInspPblm); } @ApiOperation(value = "问题列表") @RequestMapping(value = "/listWithImg", method = RequestMethod.POST) public BaseResponse listWithImg(@ApiParam(name = "bisInspPblm", value = "BisInspPblm", required = true) @RequestBody PlbmParam pblmParam) { pblmParam.setProvince(inspOrgService.getProvince(getCurrentOrgId())); pblmParam.setOrgId(getCurrentOrgId()); pblmParam.setOrderBy("COLL_TIME DESC"); PageInfo inspPblmList = bisInspPblmService.findPageList(pblmParam); inspPblmList.getList().forEach(pblm -> { List gwComFileList = gwComFileService.getImgByBizId(pblm.getPblmId(), 1); if (null != gwComFileList && gwComFileList.size() > 0) { pblm.setImg(gwComFileList.stream() .map(GwComFile::getFilePath) .filter(StringUtils::isNotBlank) .findFirst() .map(o -> o.replaceAll("\\\\", "/").replaceAll("//", "/")) .orElse(null)); } }); return buildSuccessResponse(inspPblmList); } @ApiOperation(value = "批量修改问题状态 比传objid,类型ID,状态值") @RequestMapping(value = "/updatePblmState", method = RequestMethod.POST) public BaseResponse> updatePblmState(@ApiParam(name = "bisInspPblm", value = "bisInspPblm", required = true) @RequestBody List bisInspPblmParams) throws Exception { for (BisInspPblmParam bisInspPblm : bisInspPblmParams) { bisInspPblmService.updatePblmState(bisInspPblm); } return buildSuccessResponse(bisInspPblmParams); } @ApiOperation(value = "根据ID删除和用户id督查问题管理") @RequestMapping(value = "/delete/{id}/{presId}", method = RequestMethod.GET) public Object delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id, @ApiParam(name = "presId", value = "presId", required = true) @PathVariable String presId) { BisInspPblm inspPblm = bisInspPblmService.get(id); if (inspPblm != null) { bisInspPblmService.delete(id); Map params = new HashMap<>(1); params.put("data", "删除成功"); return buildSuccessResponse(params); } return buildFailResponse("已删除,该问题清单已经不存在!!"); } @ApiOperation(value = "问题处置通用查询") @RequestMapping(value = "/chuzhi/pblmPage", method = RequestMethod.POST) public BaseResponse pblmPage(@ApiParam(name = "bisInspVo", value = "bisInspVo", required = true) @RequestBody BisInspVo bisInspVo) { bisInspVo.setObjType(String.valueOf(Integer.parseInt(bisInspVo.getObjType()))); String curPersId = getCurrentPersId(); BisInspAllRlationPers allRlationPers = inspAllRlationPersService.get(curPersId); if (allRlationPers != null && StringUtils.isNotBlank(allRlationPers.getProvince())) { String province = allRlationPers.getProvince().replace(AdCodeLabel.START_PARENT_ADCODE, ""); bisInspVo.setProvince(province); } String curOrgId = getCurrentOrgId(); if (StringUtils.isNotBlank(curOrgId)) { OlBisInspOrg olBisInspOrg = inspOrgService.get(curOrgId); if (olBisInspOrg == null) { return buildFailResponse("传入参数有误!"); } bisInspVo.setOrgId(""); bisInspVo.setBelongOrgId(olBisInspOrg.getOrgId()); String adCode = olBisInspOrg.getAdCode().replace("00", ""); bisInspVo.setAdCode(adCode); if ("80df1213ad9f493e85a771d6f4b18a17".equals(curPersId)) { bisInspVo.setProvince(AdLevelUtil.getAddvcd(olBisInspOrg.getRlcode())); } PageInfo retCountPageInfo = new PageInfo<>(); if (StringUtils.isNotBlank(bisInspVo.getObjAdCode())) { bisInspVo.setObjAdCode(AdLevelUtil.getAddvcd(bisInspVo.getObjAdCode())); } if (StringUtils.isBlank(bisInspVo.getState()) || "0".equals(bisInspVo.getState())) { retCountPageInfo = bisInspPblmService.pblmPage(bisInspVo); } else { retCountPageInfo = bisInspPblmService.pblmRectPage(bisInspVo); } return buildSuccessResponse(retCountPageInfo); } return buildFailResponse("参数缺失"); } @ApiOperation(value = "更新督查问题管理信息") @RequestMapping(value = "/update", method = RequestMethod.POST) public BaseResponse update(@ApiParam(name = "bisInspPblm", value = "bisInspPblm", required = true) @RequestBody BisInspPblm bisInspPblm) { insert(bisInspPblm); return buildSuccessResponse(bisInspPblm); } @ApiOperation(value = "查询人饮问题类型") @RequestMapping(value = "/findVillType", method = RequestMethod.GET) public BaseResponse> findVillType() { List inspPblmNames = bisInspPblmService.findVillType(getCurrentOrgId()); return buildSuccessResponse(inspPblmNames); } @ApiOperation(value = "根据用户id查找分离用户问题如为督查人员问题还是督查办问题统计") @RequestMapping(value = "/seperatePblm", method = RequestMethod.GET) public BaseResponse> seperatePblm(@ApiParam(name = "persId", value = "persId", required = true) @RequestParam String persId) { List roleList = bisInspPblmService.findPblmByPersId(persId, getCurrentOrgId()); List roleListNew = new ArrayList<>(); for (PblmRole pblmRole : roleList) { if ("1".equals(pblmRole.getPerType())) { pblmRole.setLength(6); } else { pblmRole.setLength(12); } //适配app端 pblmRole.setId(pblmRole.getId() + "01"); if (!roleListNew.contains(pblmRole)) { roleListNew.add(pblmRole); } } return buildSuccessResponse(roleListNew); } @ApiOperation(value = "统计小水库问题-问题详情图表-分页") @RequestMapping(value = "/countByReverPage", method = RequestMethod.POST) public BaseResponse> countByReverPage(@ApiParam(name = "countParam", value = "countParam", required = true) @RequestBody CountParam countParam) { countParam.setProvince(inspOrgService.getProvince(getCurrentOrgId())); countParam.setOrgId(getCurrentOrgId()); if (StringUtils.isBlank(countParam.getpType())) { countParam.setpType("1"); } countParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId()))); PageInfo retCountPageInfo = bisInspPblmService.countByReverPage(countParam); return buildSuccessResponse(retCountPageInfo); } @ApiOperation(value = "统计小水闸问题-问题详情图表-分页") @RequestMapping(value = "/countByWagaPage", method = RequestMethod.POST) public BaseResponse> countByWagaPage(@ApiParam(name = "countParam", value = "countParam", required = true) @RequestBody CountParam countParam) { countParam.setProvince(inspOrgService.getProvince(getCurrentOrgId())); countParam.setOrgId(getCurrentOrgId()); countParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId()))); PageInfo retCountPageInfo = bisInspPblmService.countByWagaPage(countParam); return buildSuccessResponse(retCountPageInfo); } @ApiOperation(value = "(督查人员与流域机构共有)统计172重点工程(pType=4工程建设,pType=7工程运行)问题-问题详情图表-分页") @RequestMapping(value = "/countByKeyRegPage", method = RequestMethod.POST) public BaseResponse> countByKeyRegPage(@ApiParam(name = "countParam", value = "countParam", required = true) @RequestBody CountParam countParam) { countParam.setProvince(inspOrgService.getProvince(getCurrentOrgId())); countParam.setOrgId(getCurrentOrgId()); countParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId()))); PageInfo retCountPageInfo = bisInspPblmService.countByKeyRegPage(countParam); return buildSuccessResponse(retCountPageInfo); } @ApiOperation(value = "统计淤地坝问题-问题统计") @RequestMapping(value = "/countBySdPage", method = RequestMethod.POST) public BaseResponse> countBySdPage(@ApiParam(name = "countParam", value = "countParam", required = true) @RequestBody CountParam countParam) { countParam.setProvince(inspOrgService.getProvince(getCurrentOrgId())); countParam.setOrgId(getCurrentOrgId()); countParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId()))); PageInfo pageInfo = bisInspPblmService.countBySdPage(countParam); return buildSuccessResponse(pageInfo); } @ApiOperation(value = "统计水源地问题-问题统计") @RequestMapping(value = "/countBySwhsPage", method = RequestMethod.POST) public BaseResponse> countBySwhsPage(@ApiParam(name = "countParam", value = "countParam", required = true) @RequestBody CountParam countParam) { countParam.setProvince(inspOrgService.getProvince(getCurrentOrgId())); countParam.setOrgId(getCurrentOrgId()); countParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId()))); PageInfo pageInfo = bisInspPblmService.countBySwhsPage(countParam); return buildSuccessResponse(pageInfo); } @ApiOperation(value = "统计取用水户问题-问题统计") @RequestMapping(value = "/countByWiuPage", method = RequestMethod.POST) public BaseResponse> countByWiuPage(@ApiParam(name = "countParam", value = "countParam", required = true) @RequestBody CountParam countParam) { countParam.setProvince(inspOrgService.getProvince(getCurrentOrgId())); countParam.setOrgId(getCurrentOrgId()); countParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId()))); PageInfo pageInfo = bisInspPblmService.countByWiuPage(countParam); return buildSuccessResponse(pageInfo); } @ApiOperation(value = "统计取水保督查问题-问题统计") @RequestMapping(value = "/countByPrdPage", method = RequestMethod.POST) public BaseResponse> countByPrdPage(@ApiParam(name = "countParam", value = "countParam", required = true) @RequestBody CountParam countParam) { countParam.setProvince(inspOrgService.getProvince(getCurrentOrgId())); countParam.setOrgId(getCurrentOrgId()); countParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId()))); PageInfo pageInfo = bisInspPblmService.countByPrdPage(countParam); return buildSuccessResponse(pageInfo); } @ApiOperation(value = "统计河湖四乱核查问题-问题统计") @RequestMapping(value = "/countByJsflPage", method = RequestMethod.POST) public BaseResponse> countByJsflPage(@ApiParam(name = "countParam", value = "countParam", required = true) @RequestBody CountParam countParam) { countParam.setProvince(inspOrgService.getProvince(getCurrentOrgId())); countParam.setOrgId(getCurrentOrgId()); countParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId()))); PageInfo pageInfo = bisInspPblmService.countByJsflPage(countParam); return buildSuccessResponse(pageInfo); } @ApiOperation(value = "统计非法采砂核查问题-问题统计") @RequestMapping(value = "/countByJswaPage", method = RequestMethod.POST) public BaseResponse> countByJswaPage(@ApiParam(name = "countParam", value = "countParam", required = true) @RequestBody CountParam countParam) { countParam.setProvince(inspOrgService.getProvince(getCurrentOrgId())); countParam.setOrgId(getCurrentOrgId()); countParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId()))); PageInfo pageInfo = bisInspPblmService.countByJswaPage(countParam); return buildSuccessResponse(pageInfo); } @ApiOperation(value = "统计人饮工程问题-问题详情图表-分页") @RequestMapping(value = "/countByVillPage", method = RequestMethod.POST) public BaseResponse> countByVillPage(@ApiParam(name = "countParam", value = "countParam", required = true) @RequestBody CountParam countParam) { countParam.setProvince(inspOrgService.getProvince(getCurrentOrgId())); countParam.setOrgId(getCurrentOrgId()); countParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId()))); PageInfo retCountPageInfo = bisInspPblmService.countByVillPage(countParam); return buildSuccessResponse(retCountPageInfo); } @ApiOperation(value = "统计流域机构下人饮问题-问题详情图表") @RequestMapping(value = "/countVillByArea/{persId}", method = RequestMethod.GET) public BaseResponse> countVillByArea(@ApiParam(name = "persId", value = "persId", required = true) @PathVariable String persId) { List retCountPageInfo = bisInspPblmService.findVillPblmBYAreaId("002%", persId, getCurrentOrgId(), BisInspEnum.VILL.getValue()); return buildSuccessResponse(retCountPageInfo); } @ApiOperation(value = "统计流域机构下小水闸问题-问题详情图表") @RequestMapping(value = "/countWagaByArea/{persId}", method = RequestMethod.GET) public BaseResponse> countWagaByArea(@ApiParam(name = "persId", value = "persId", required = true) @PathVariable String persId) { List retCountPageInfo = bisInspPblmService.findWagaPblmBYAreaId("006%", persId, getCurrentOrgId()); return buildSuccessResponse(retCountPageInfo); } @ApiOperation(value = "统计流域机构下水毁问题-问题详情图表") @RequestMapping(value = "/countTrackByArea/{persId}", method = RequestMethod.GET) public BaseResponse> countTrackByArea(@ApiParam(name = "persId", value = "persId", required = true) @PathVariable String persId) { List retCountPageInfo = bisInspPblmService.findTrackPblmBYAreaId("003%", persId, getCurrentOrgId()); return buildSuccessResponse(retCountPageInfo); } @ApiOperation(value = "统计水毁问题-问题详情图表-分页") @RequestMapping(value = "/countByTrackPage", method = RequestMethod.POST) public BaseResponse> countByTrackPage(@ApiParam(name = "countParam", value = "countParam", required = true) @RequestBody CountParam countParam) { countParam.setProvince(inspOrgService.getProvince(getCurrentOrgId())); countParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId()))); PageInfo retCountPageInfo = bisInspPblmService.countByTrackPage(countParam); return buildSuccessResponse(retCountPageInfo); } @ApiOperation(value = "统计人饮问题-问题详情图表-分页-总计") @RequestMapping(value = "/totalVillCount/{persId}", method = RequestMethod.GET) public BaseResponse totalVillCount(@ApiParam(name = "persId", value = "persId", required = true) @PathVariable String persId) { List typeCountList = bisInspPblmDao.totalCountVill(persId, getCurrentOrgId(), inspOrgService.getProvince(getCurrentOrgId())); VillCount villCount = new VillCount(); villCount.setAdFullName("总计"); int count = 0; for (VillTypeCount typeCount : typeCountList) { bisInspPblmService.setVillValue(villCount, typeCount, BisInspEnum.VILL.getValue()); count += typeCount.getTotal(); } villCount.setTotal(count); return buildSuccessResponse(villCount); } @ApiOperation(value = "统计水毁问题-问题详情图表-分页-总计") @RequestMapping(value = "/totalTrackCount/{persId}", method = RequestMethod.GET) public BaseResponse totalTrackCount(@ApiParam(name = "persId", value = "persId", required = true) @PathVariable String persId) { List totalCountTrack = bisInspPblmDao.totalCountTrack(persId, getCurrentOrgId(), inspOrgService.getProvince(getCurrentOrgId())); TrackCount trackCount = new TrackCount(); trackCount.setNm("总计"); int count = 0; for (TrackTypeCount typeCount : totalCountTrack) { bisInspPblmService.setValue(trackCount, typeCount); count += typeCount.getTotal(); } trackCount.setTotal(count); return buildSuccessResponse(trackCount); } @ApiOperation(value = "统计小水库问题-问题详情图表-分页-总计") @RequestMapping(value = "/totalCount/{persId}", method = RequestMethod.GET) public BaseResponse countByReverPage(@ApiParam(name = "persId", value = "persId", required = true) @PathVariable String persId ) { List cateTotals = bisInspPblmDao.totalCount(persId, "1", inspOrgService.getProvince(getCurrentOrgId()), getCurrentOrgId()); return buildSuccessResponse(InspUtils.setPblmCount(cateTotals)); } @ApiOperation(value = "统计小水闸问题-问题详情图表-分页-总计") @RequestMapping(value = "/totalWagaCount/{persId}", method = RequestMethod.GET) public BaseResponse totalWagaCount(@ApiParam(name = "persId", value = "persId", required = true) @PathVariable String persId ) { List cateTotals = bisInspPblmDao.totalCount(persId, "6", inspOrgService.getProvince(getCurrentOrgId()), getCurrentOrgId()); return buildSuccessResponse(InspUtils.setPblmCount(cateTotals)); } @ApiOperation(value = "统计72工程问题-问题详情图表-分页-总计,当流域机构统计时,不需要传入用户") @RequestMapping(value = "/totalKeyRegCount/{persId}/{pType}", method = RequestMethod.GET) public BaseResponse totalKeyRegCount(@ApiParam(name = "persId", value = "persId", required = true) @PathVariable String persId, @ApiParam(name = "pType", value = "pType", required = true) @PathVariable String pType ) { if ("0".equals(persId)) { persId = ""; } List cateTotals = bisInspPblmDao.totalCount(persId, pType, inspOrgService.getProvince(getCurrentOrgId()), getCurrentOrgId()); return buildSuccessResponse(InspUtils.setPblmCount(cateTotals)); } @Autowired private AttAdXBaseService attAdXBaseService; @Autowired private BisInspRsvrRgstrService bisInspRsvrRgstrService; @Autowired private BisInspPblmRepeatDao pblmRepeatDao; @Autowired private BisInspRsvrRgstrRepeatDao rsvrRgstrRepeatDao; @ApiOperation(value = "根据ID获取督查问题管理(单表)") @RequestMapping(value = "/{id}", method = RequestMethod.GET) public BaseResponse get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id, HttpServletRequest request) { String repeat = request.getParameter("repeat"); BisInspPblm bisInspPblm = null; if (StringUtils.isBlank(repeat)) { bisInspPblm = bisInspPblmService.get(id); if (bisInspPblm == null) { return buildSuccessResponse(); } } else { bisInspPblm = pblmRepeatDao.get(id); } if (StringUtils.isNotBlank(bisInspPblm.getNm())) { bisInspPblm.setSrcDesc(bisInspPblm.getNm()); } if (StringUtils.isNotBlank(bisInspPblm.getVillageCode())) { AttAdXBase attAdXBase = attAdXBaseService.get(bisInspPblm.getVillageCode()); if (attAdXBase != null) { bisInspPblm.setSrcDesc(attAdXBase.getAdName()); } } if (StringUtils.isNotBlank(bisInspPblm.getRegid()) && BisInspEnum.REVER.getValue().equals(bisInspPblm.getObjType())) { BisInspRsvrRgstr bisInspRsvrRgstr = null; if (StringUtils.isBlank(repeat)) { bisInspRsvrRgstr = bisInspRsvrRgstrService.get(bisInspPblm.getRegid()); } else { bisInspRsvrRgstr = rsvrRgstrRepeatDao.get(bisInspPblm.getRegid()); } if (bisInspRsvrRgstr != null) { bisInspPblm.setSrcDesc(bisInspRsvrRgstr.getRsvrNm()); } } changePblm(bisInspPblm); List gwComFiles = gwComFileService.findFileByBiz(bisInspPblm.getPblmId()); bisInspPblm.setGwComFiles(gwComFiles); return buildSuccessResponse(bisInspPblm); } @Autowired private BisInspVill2021UsrService bisInspVill2021UsrService; @Autowired private BisInspVill2021VillService bisInspVill2021VillService; @Autowired private BisInspVill2021PblmService bisInspVill2021PblmService; @Autowired private BisInspVill2021CwsService bisInspVill2021CwsService; void changePblm(BisInspPblm pblm) { if (StringUtils.isBlank(pblm.getRegid())) { return; } BisInspEnum bisInspEnum = BisInspEnum.getEnumByType(pblm.getObjType()); if (bisInspEnum == null) { return; } switch (bisInspEnum) { case VILL2021: if (StringUtils.isNotBlank(pblm.getVillType())) { switch (pblm.getVillType()) { case "251": BisInspVill2021Usr vill2021Usr = bisInspVill2021UsrService.get(pblm.getRegid()); Optional.ofNullable(vill2021Usr).ifPresent(usr -> { pblm.setNm(usr.getUsrNm()); BisInspVill2021Vill vill = bisInspVill2021VillService.get(usr.getVillId()); Optional.ofNullable(vill).map(BisInspVill2021Vill::getAdCode).ifPresent(adCode -> { AttAdXBase adXBase = attAdXBaseService.get(adCode); Optional.ofNullable(adXBase).ifPresent(base -> { pblm.setAdFullName(base.getAdFullName()); }); }); }); break; case "252": BisInspVill2021Cws cws = bisInspVill2021CwsService.get(pblm.getRegid()); Optional.ofNullable(cws).ifPresent(c -> { pblm.setNm(c.getCwsNm()); if (StringUtils.isNotBlank(c.getAdCode())) { AttAdXBase adXBase = attAdXBaseService.get(c.getAdCode()); Optional.ofNullable(adXBase).ifPresent(base -> { pblm.setAdFullName(base.getAdFullName()); }); } else { pblm.setAdFullName(c.getCwsLoc()); } }); break; case "253": BisInspVill2021Pblm vill2021Pblm = bisInspVill2021PblmService.get(pblm.getRegid()); Optional.ofNullable(vill2021Pblm).ifPresent(p -> { pblm.setNm(p.getPblmNm()); pblm.setAdFullName(p.getLoc()); }); break; default: } } break; case CHMCLS: BisInspChmclsUseunitwk bisInspChmclsUseunitwk = bisInspChmclsUseunitwkService.get(pblm.getRegid()); if (bisInspChmclsUseunitwk != null) { pblm.setNm(bisInspChmclsUseunitwk.getDepName()); } break; case TRACK: BisInspWtdstTrack bisInspWtdstTrack = bisInspWtdstTrackService.get(pblm.getRegid()); if (bisInspWtdstTrack != null) { pblm.setSrcDesc(bisInspWtdstTrack.getAdNm()); } break; default: } } @ApiOperation(value = "审核及驳回审核") @RequestMapping(value = "/audit/{id}/{dataStat}", method = RequestMethod.GET) public Object audit(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id, @ApiParam(name = "dataStat", value = "dataStat", required = true) @PathVariable String dataStat) { Map params = new HashMap<>(); BisInspPblm bisInspPblm = bisInspPblmService.get(id); //审核 if ("2".equals(dataStat) && "1".equals(bisInspPblm.getDataStat())) { bisInspPblm.setDataStat(dataStat); bisInspPblmService.update(bisInspPblm); params.put("data", "审核完成"); return buildSuccessResponse(params); } //退回 if ("3".equals(dataStat) && "1".equals(bisInspPblm.getDataStat())) { bisInspPblm.setDataStat(dataStat); bisInspPblmService.update(bisInspPblm); params.put("data", "驳回完成"); return buildSuccessResponse(params); } return buildFailResponse("数据错误"); } @ApiOperation(value = "问题栏目:问题列表根据当前登录用户id获取需要督查问题列表") @RequestMapping(value = "/list/{persId}", method = RequestMethod.POST) public BaseResponse> list(@ApiParam(name = "persId", value = "persId", required = true) @PathVariable String persId , @RequestBody(required = false) PlbmParam pblmParam) { pblmParam.setProvince(inspOrgService.getProvince(getCurrentOrgId())); pblmParam.setPresId(persId); pblmParam.setOrgId(getCurrentOrgId()); pblmParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId()))); PageInfo inspPblmList = bisInspPblmService.findPageList(pblmParam); if (inspPblmList.getList() != null) { inspPblmList.getList().forEach(bisInspPblm -> { if (StringUtils.isNotBlank(bisInspPblm.getRegid()) && BisInspEnum.CHMCLS.getValue().equals(bisInspPblm.getObjType())) { BisInspChmclsUseunitwk bisInspChmclsUseunitwk = bisInspChmclsUseunitwkService.get(bisInspPblm.getRegid()); if (bisInspChmclsUseunitwk != null) { bisInspPblm.setNm(bisInspChmclsUseunitwk.getDepName()); } } }); } return buildSuccessResponse(inspPblmList); } @ApiOperation(value = "小水库,行政村,水源地,饮水工程,水毁统计") @RequestMapping(value = "/count/{persId}/{adCode}", method = RequestMethod.GET) public BaseResponse> list(@ApiParam(name = "persId", value = "persId", required = true) @PathVariable String persId, @ApiParam(name = "adCode", value = "adCode", required = false) @PathVariable(name = "adCode", required = false) String adCode ) { List countTypes = bisInspPblmService.countByType(persId, adCode, getCurrentOrgId()); return buildSuccessResponse(countTypes); } @ApiOperation(value = "根据督查组id获取需要督查问题列表,分页") @RequestMapping(value = "/page", method = RequestMethod.POST) public BaseResponse> page(@ApiParam(name = "bisInspPblm", value = "BisInspPblm", required = true) @RequestBody PlbmParam pblmParam, HttpServletRequest request) { pblmParam.setProvince(inspOrgService.getProvince(getCurrentOrgId())); pblmParam.setOrgId(getCurrentOrgId()); if (StringUtils.isBlank(pblmParam.getTabType())) { pblmParam.setTabType(CommonLabel.TAB_TYPE); String source = request.getHeader("source"); if (StringUtils.isNotBlank(source)) { pblmParam.setTabType("0"); } } String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); String nowYear = new SimpleDateFormat("yyyy").format(new Date()); String nowMonth = new SimpleDateFormat("yyyy-MM").format(new Date()); pblmParam.setNowMonth(nowMonth); pblmParam.setNowYear(nowYear); pblmParam.setNowTime(nowTime); pblmParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId()))); PageInfo inspPblmList = new PageInfo<>(); if (BisInspEnum.VILL2020.getValue().equals(pblmParam.getObjType())) { inspPblmList = bisNewVillRgstrService.findPageList(pblmParam); } else if (BisInspEnum.VILLZHEJIANG.getValue().equals(pblmParam.getObjType())) { inspPblmList = bisZhejiangVillRgstrService.findPageList(pblmParam); } else if (BisInspEnum.MFDP.getValue().equals(pblmParam.getObjType())) { inspPblmList = bisInspMfdpRgstrService.findPblmPage(pblmParam); } else { inspPblmList = bisInspPblmService.findPageList(pblmParam); } return buildSuccessResponse(inspPblmList); } @Authority @ApiOperation(value = "统计人饮问题-问题详情图表-分页-总计") @RequestMapping(value = "/totalVill2020Count/{persId}", method = RequestMethod.GET) public BaseResponse totalVill2020Count(@ApiParam(name = "persId", value = "persId", required = true) @PathVariable String persId) { List typeCountList = bisInspPblmDao.totalCountVill(persId, BisInspEnum.VILL2020.getValue(), olBisInspOrgService.getProvince(getCurrentOrgId())); VillCount villCount = new VillCount(); villCount.setAdFullName("总计"); int count = 0; for (VillTypeCount typeCount : typeCountList) { bisInspPblmService.setVillValue(villCount, typeCount, "25"); count += typeCount.getTotal(); } villCount.setTotal(count); return buildSuccessResponse(villCount); } @ApiOperation(value = "获取新人饮问题列表-新,villType传1,2,3多个用逗号分隔") @RequestMapping(value = "/page/vill2020", method = RequestMethod.POST) public BaseResponse> vill2020(@ApiParam(name = "pblmParam", value = "pblmParam", required = true) @RequestBody PlbmParam pblmParam) { pblmParam.setPresId(getCurrentPersId()); pblmParam.setProvince(olBisInspOrgService.getProvince(getCurrentOrgId())); if (StringUtils.isBlank(pblmParam.getTabType())) { pblmParam.setTabType(CommonLabel.TAB_TYPE); } String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); pblmParam.setNowTime(nowTime); pblmParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId()))); PageInfo inspPblmList = bisNewVillRgstrService.findPageList(pblmParam); InspUtils.addLocs(inspPblmList); return buildSuccessResponse(inspPblmList); } @ApiOperation(value = "根据规则id和类型获取对应的问题列表") @RequestMapping(value = "/getPblmList/{id}/{type}/{objId}", method = {RequestMethod.GET}) public BaseResponse> getPblmList(@ApiParam(name = "id", value = "规则id", required = true) @PathVariable String id, @ApiParam(name = "type", value = "类型", required = true) @PathVariable String type, @ApiParam(name = "objId", value = "项目id", required = true) @PathVariable String objId) { List list = bisInspPblmService.getPblmList(id, type, objId, getCurrentOrgId()); return buildSuccessResponse(list); } @ApiOperation(value = "根据规则id和类型获取对应的问题列表") @RequestMapping(value = "/getPblmList/{id}/{type}", method = {RequestMethod.GET}) public BaseResponse> getPblmListById(@ApiParam(name = "id", value = "规则id", required = true) @PathVariable String id, @ApiParam(name = "type", value = "类型", required = true) @PathVariable String type) { List list = bisInspPblmService.getPblmList(id, type, "", getCurrentOrgId()); return buildSuccessResponse(list); } @ApiOperation(value = "获取小水库问题列表-新") @RequestMapping(value = "/page/rever", method = RequestMethod.POST) public BaseResponse> rever(@ApiParam(name = "reverParam", value = "reverParam", required = true) @RequestBody ReverParam reverParam) { if (StringUtils.isBlank(reverParam.getpType())) { reverParam.setpType("1"); } if (StringUtils.isBlank(reverParam.getObjType())) { reverParam.setObjType("1"); } reverParam.setPersId(getCurrentPersId()); reverParam.setOrgId(getCurrentOrgId()); reverParam.setProvince(inspOrgService.getProvince(getCurrentOrgId())); if (StringUtils.isBlank(reverParam.getTabType())) { reverParam.setTabType(CommonLabel.TAB_TYPE); } String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); reverParam.setNowTime(nowTime); reverParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId()))); PageInfo inspPblmList = bisInspPblmService.findReverPlbmList(reverParam); InspUtils.addLocs(inspPblmList); return buildSuccessResponse(inspPblmList); } @Autowired private OlBisInspOrgService inspOrgService; @ApiOperation(value = "获取172工程问题列表-新") @RequestMapping(value = "/page/keyReg", method = RequestMethod.POST) public BaseResponse> rever(@ApiParam(name = "reverParam", value = "reverParam", required = true) @RequestBody KeyRegPatam keyRegPatam, HttpServletRequest request) { if (StringUtils.isNotBlank(keyRegPatam.getProblemType())) { keyRegPatam.setInspPblmName(InspUtils.setPlbmName(keyRegPatam.getProblemType())); keyRegPatam.setProblemType(""); } if (StringUtils.isBlank(keyRegPatam.getOrderBy())) { keyRegPatam.setOrderBy("order by coll_time desc"); } keyRegPatam.setPersId(getCurrentPersId()); keyRegPatam.setOrgId(getCurrentOrgId()); keyRegPatam.setProvince(inspOrgService.getProvince(getCurrentOrgId())); if (StringUtils.isBlank(keyRegPatam.getTabType())) { keyRegPatam.setTabType(CommonLabel.TAB_TYPE); String source = request.getHeader("source"); if (StringUtils.isNotBlank(source)) { keyRegPatam.setTabType("0"); } } String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); keyRegPatam.setNowTime(nowTime); keyRegPatam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId()))); PageInfo inspPblmList = bisInspPblmService.findKeyRegPlbmList(keyRegPatam); InspUtils.addLocsNew(inspPblmList); return buildSuccessResponse(inspPblmList); } @ApiOperation(value = "获取水闸问题列表-新") @RequestMapping(value = "/page/waga", method = RequestMethod.POST) public BaseResponse> waga(@ApiParam(name = "wagaParam", value = "wagaParam", required = true) @RequestBody WagaParam wagaParam) { wagaParam.setProvince(inspOrgService.getProvince(getCurrentOrgId())); wagaParam.setPersId(getCurrentPersId()); wagaParam.setOrgId(getCurrentOrgId()); if (StringUtils.isBlank(wagaParam.getTabType())) { wagaParam.setTabType(CommonLabel.TAB_TYPE); } String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); wagaParam.setNowTime(nowTime); wagaParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId()))); PageInfo inspPblmList = bisInspPblmService.findWagaPlbmList(wagaParam); InspUtils.addLocs(inspPblmList); return buildSuccessResponse(inspPblmList); } @ApiOperation(value = "通用问题导出xls") @RequestMapping(value = "/page/export", method = RequestMethod.POST) public void pblmExport(@ApiParam(name = "pblmParam", value = "pblmParam", required = true) @RequestBody PblmParam pblmParam, HttpServletResponse response) throws Exception { if (StringUtils.isBlank(pblmParam.getpType())) { throw new Exception("没有传类型"); } pblmParam.setOrgId(getCurrentOrgId()); pblmParam.setProvince(inspOrgService.getProvince(pblmParam.getOrgId())); bisInspPblmService.exportPblmForExcel(pblmParam, response); } @ApiOperation(value = "水闸导出问题列表-导出excel") @RequestMapping(value = "/page/waga/export", method = RequestMethod.POST) public void reverExport(@ApiParam(name = "wagaParam", value = "wagaParam", required = true) @RequestBody WagaParam wagaParam, HttpServletResponse response) { response.setContentType("application/binary;charset=UTF-8"); String orgIds = InspUtils.setOrgIds(wagaParam.getOrgIds()); wagaParam.setOrgIds(orgIds); wagaParam.setProvince(inspOrgService.getProvince(getCurrentOrgId())); wagaParam.setPersId(getCurrentPersId()); wagaParam.setOrgId(getCurrentOrgId()); wagaParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId()))); List pblmList = bisInspPblmDao.findWagaPlbmList(wagaParam); InspPblmUtils.Export(response, "waga", pblmList, "水闸名称"); } @ApiOperation(value = "172工程导出问题列表-导出excel") @RequestMapping(value = "/page/keyReg/export", method = RequestMethod.POST) public void keyRegExport(@ApiParam(name = "wagaParam", value = "wagaParam", required = true) @RequestBody KeyRegPatam keyRegPatam, HttpServletResponse response) { response.setContentType("application/binary;charset=UTF-8"); String orgIds = InspUtils.setOrgIds(keyRegPatam.getOrgIds()); keyRegPatam.setOrgIds(orgIds); keyRegPatam.setPersId(getCurrentPersId()); keyRegPatam.setOrgId(getCurrentOrgId()); keyRegPatam.setProvince(inspOrgService.getProvince(getCurrentOrgId())); if (StringUtils.isBlank(keyRegPatam.getTabType())) { keyRegPatam.setTabType(CommonLabel.TAB_TYPE); } String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); keyRegPatam.setNowTime(nowTime); keyRegPatam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId()))); List pblmList = bisInspPblmDao.findKeyRegPlbmList(keyRegPatam); InspPblmUtils.ExportNew(response, "172", pblmList, "172重点工程"); } @Autowired private BisInspPblmDao bisInspPblmDao; @ApiOperation(value = "问题清单导出xlsx") @RequestMapping(value = "/page/problemList/export", method = RequestMethod.POST) public void problemListExport(@ApiParam(name = "pblmParam", value = "pblmParam", required = true) @RequestBody PblmParam pblmParam, HttpServletResponse response) { response.setContentType("application/binary;charset=UTF-8"); // 设置参数 String orgIds = InspUtils.setOrgIds(pblmParam.getOrgIds()); pblmParam.setOrgIds(orgIds); pblmParam.setProvince(inspOrgService.getProvince(getCurrentOrgId())); pblmParam.setPersId(getCurrentPersId()); pblmParam.setOrgId(getCurrentOrgId()); pblmParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId()))); // 获取数据 List pblmList = bisInspPblmDao.findPblmList(pblmParam); // 导出问题清单 InspPblmUtils.ExportProblemList(response, pblmList, "问题清单"); } @ApiOperation(value = "人饮,水源地,行政村导出问题列表-导出excel") @RequestMapping(value = "/page/vill/export", method = RequestMethod.POST) public void villExport(@ApiParam(name = "reverParam", value = "reverParam", required = true) @RequestBody VillParam villParam, HttpServletResponse response) { response.setContentType("application/binary;charset=UTF-8"); String orgIds = InspUtils.setOrgIds(villParam.getOrgIds()); villParam.setOrgIds(orgIds); villParam.setOrgId(getCurrentOrgId()); villParam.setProvince(inspOrgService.getProvince(getCurrentOrgId())); villParam.setPersId(getCurrentPersId()); villParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId()))); List pblmList = bisInspPblmDao.findVillPlbmList(villParam); String name = "督查对象(区、县)"; InspPblmUtils.Export(response, "vill", pblmList, name); } @ApiOperation(value = "小水库导出问题列表-导出excel") @RequestMapping(value = "/page/rever/export", method = RequestMethod.POST) public void reverExport(@ApiParam(name = "reverParam", value = "reverParam", required = true) @RequestBody ReverParam reverParam, HttpServletResponse response) { response.setContentType("application/binary;charset=UTF-8"); String orgIds = InspUtils.setOrgIds(reverParam.getOrgIds()); reverParam.setOrgIds(orgIds); reverParam.setOrgId(getCurrentOrgId()); reverParam.setProvince(inspOrgService.getProvince(getCurrentOrgId())); reverParam.setPersId(getCurrentPersId()); if (StringUtils.isBlank(reverParam.getTabType())) { reverParam.setTabType(CommonLabel.TAB_TYPE); } String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); reverParam.setNowTime(nowTime); reverParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId()))); List pblmList = bisInspPblmDao.findReverPlbmList(reverParam); InspPblmUtils.Export(response, "rever", pblmList, "督查水库名称"); } @ApiOperation(value = "水毁导出问题列表-导出excel") @RequestMapping(value = "/page/track/export", method = RequestMethod.POST) public void trackExport(@ApiParam(name = "reverParam", value = "reverParam", required = true) @RequestBody TrackParam trackParam, HttpServletResponse response) { response.setContentType("application/binary;charset=UTF-8"); String orgIds = InspUtils.setOrgIds(trackParam.getOrgIds()); trackParam.setOrgIds(orgIds); trackParam.setPersId(getCurrentPersId()); trackParam.setOrgId(getCurrentOrgId()); trackParam.setProvince(inspOrgService.getProvince(getCurrentOrgId())); if (StringUtils.isBlank(trackParam.getTabType())) { trackParam.setTabType(CommonLabel.TAB_TYPE); } String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); trackParam.setNowTime(nowTime); trackParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId()))); List pblmList = bisInspPblmDao.findTrackPlbmList(trackParam); InspPblmUtils.Export(response, "track", pblmList, "督查水毁名称"); } @ApiOperation(value = "获取人饮问题列表-新") @RequestMapping(value = "/page/vill", method = RequestMethod.POST) public BaseResponse> rever(@ApiParam(name = "villParam", value = "villParam", required = true) @RequestBody VillParam villParam) { villParam.setProvince(inspOrgService.getProvince(getCurrentOrgId())); villParam.setPersId(getCurrentPersId()); villParam.setOrgId(getCurrentOrgId()); villParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId()))); PageInfo inspPblmList = bisInspPblmService.findVillPlbmList(villParam); InspUtils.addLocs(inspPblmList); return buildSuccessResponse(inspPblmList); } @ApiOperation(value = "获取水毁问题列表-新") @RequestMapping(value = "/page/track", method = RequestMethod.POST) public BaseResponse> track(@ApiParam(name = "trackParam", value = "trackParam", required = true) @RequestBody TrackParam trackParam) { trackParam.setProvince(inspOrgService.getProvince(getCurrentOrgId())); trackParam.setPersId(getCurrentPersId()); trackParam.setOrgId(getCurrentOrgId()); if (StringUtils.isBlank(trackParam.getTabType())) { trackParam.setTabType(CommonLabel.TAB_TYPE); } String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); trackParam.setNowTime(nowTime); trackParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId()))); PageInfo inspPblmList = bisInspPblmService.findTrackPlbmList(trackParam); InspUtils.addLocs(inspPblmList); return buildSuccessResponse(inspPblmList); } @ApiOperation(value = "地下水问题列表-新") @RequestMapping(value = "/page/grw", method = RequestMethod.POST) public BaseResponse> underWater(@ApiParam(name = "waterParam", value = "waterParam", required = true) @RequestBody UnderWaterParam waterParam) { waterParam.setProvince(inspOrgService.getProvince(getCurrentOrgId())); waterParam.setPersId(getCurrentPersId()); waterParam.setOrgId(getCurrentOrgId()); if (StringUtils.isBlank(waterParam.getTabType())) { waterParam.setTabType(CommonLabel.TAB_TYPE); } String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); waterParam.setNowTime(nowTime); waterParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId()))); PageInfo inspPblmList = bisInspPblmService.findWaterPlbmList(waterParam); InspUtils.addLocs(inspPblmList); return buildSuccessResponse(inspPblmList); } @ApiOperation(value = "地下水导出问题列表-导出excel") @RequestMapping(value = "/page/grw/export", method = RequestMethod.POST) public void grwExport(@ApiParam(name = "waterParam", value = "waterParam", required = true) @RequestBody UnderWaterParam waterParam, HttpServletResponse response) { response.setContentType("application/binary;charset=UTF-8"); String orgIds = InspUtils.setOrgIds(waterParam.getOrgIds()); waterParam.setOrgIds(orgIds); waterParam.setOrgId(getCurrentOrgId()); waterParam.setProvince(inspOrgService.getProvince(getCurrentOrgId())); waterParam.setPersId(getCurrentPersId()); if (StringUtils.isBlank(waterParam.getTabType())) { waterParam.setTabType(CommonLabel.TAB_TYPE); } String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); waterParam.setNowTime(nowTime); waterParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId()))); List pblmList = bisInspPblmDao.findWaterPlbmList(waterParam); InspPblmUtils.Export(response, "grw", pblmList, "测站名称"); } @ApiOperation(value = "获取列表(分页)") @RequestMapping(value = "/queryListByPage", method = {RequestMethod.GET, RequestMethod.POST}) public BaseResponse> queryListByPage(@RequestBody BisInspPblmParam param) { PageInfo list = new PageInfo<>(); try { param.setOrgId(getCurrentOrgId()); param.setProvince(inspOrgService.getProvince(getCurrentOrgId())); param.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId()))); list = bisInspPblmService.queryListByPage(param); } catch (Exception e) { e.printStackTrace(); logger.error(e.getMessage()); return buildFailResponse(e.getMessage()); } return buildSuccessResponse(list); } @ApiOperation(value = "获取列表") @RequestMapping(value = "/queryList", method = {RequestMethod.GET, RequestMethod.POST}) public BaseResponse> queryList(@RequestBody BisInspPblmParam param) { List list = new ArrayList<>(); try { param.setProvince(inspOrgService.getProvince(getCurrentOrgId())); param.setOrgId(getCurrentOrgId()); param.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId()))); list = bisInspPblmService.queryList(param); } catch (Exception e) { e.printStackTrace(); logger.error(e.getMessage()); return buildFailResponse(e.getMessage()); } return buildSuccessResponse(list); } @ApiOperation(value = "新增问题删除原因") @RequestMapping(value = "/insertPblmLog", method = RequestMethod.POST) public BaseResponse insertPblmLog(@RequestBody BisInspPblmDelLogDto bisInspPblmDelLogDto) { bisInspPblmDelLogDto.setProvince(inspOrgService.getProvince(getCurrentOrgId())); try { BisInspPblmDelLog bisInspPblmDelLog = bisInspPblmService.insertPblmLog(bisInspPblmDelLogDto); return buildSuccessResponse(bisInspPblmDelLog); } catch (Exception e) { e.printStackTrace(); logger.error(e.getMessage()); } return buildFailResponse(); } @ApiOperation(value = "获取淤地坝问题列表") @RequestMapping(value = "/page/sdPblm", method = RequestMethod.POST) public BaseResponse> sdPblm(@ApiParam(name = "reverParam", value = "reverParam", required = true) @RequestBody SdPblmParam param) { param.setProvince(inspOrgService.getProvince(getCurrentOrgId())); param.setOrgId(getCurrentOrgId()); if (StringUtils.isBlank(param.getTabType())) { param.setTabType(CommonLabel.TAB_TYPE); } String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); param.setNowTime(nowTime); param.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId()))); PageInfo inspPblmList = bisInspPblmService.findSdPblmList(param); InspUtils.addLocs(inspPblmList); return buildSuccessResponse(inspPblmList); } @ApiOperation(value = "获取水源地问题列表") @RequestMapping(value = "/page/swhsPblm", method = RequestMethod.POST) public BaseResponse> swhsPblm(@RequestBody PblmParam param) { param.setProvince(inspOrgService.getProvince(getCurrentOrgId())); param.setOrgId(getCurrentOrgId()); if (StringUtils.isBlank(param.getTabType())) { param.setTabType(CommonLabel.TAB_TYPE); } String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); param.setNowTime(nowTime); param.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId()))); PageInfo inspPblmList = bisInspPblmService.findPblmList(param); InspUtils.addLocs(inspPblmList); return buildSuccessResponse(inspPblmList); } @ApiOperation(value = "获取取用水户问题列表") @RequestMapping(value = "/page/wiuPblm", method = RequestMethod.POST) public BaseResponse> wiuPblm(@RequestBody PblmParam param) { param.setProvince(inspOrgService.getProvince(getCurrentOrgId())); param.setOrgId(getCurrentOrgId()); if (StringUtils.isBlank(param.getTabType())) { param.setTabType(CommonLabel.TAB_TYPE); } String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); param.setNowTime(nowTime); param.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId()))); PageInfo inspPblmList = bisInspPblmService.findPblmList(param); InspUtils.addLocs(inspPblmList); return buildSuccessResponse(inspPblmList); } @ApiOperation(value = "获取取小水库标准化问题列表") @RequestMapping(value = "/page/stnd", method = RequestMethod.POST) public BaseResponse> stndPblm(@RequestBody PblmParam param) { param.setProvince(inspOrgService.getProvince(getCurrentOrgId())); param.setOrgId(getCurrentOrgId()); if (StringUtils.isBlank(param.getTabType())) { param.setTabType(CommonLabel.TAB_TYPE); } String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); param.setNowTime(nowTime); param.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId()))); PageInfo inspPblmList = bisInspPblmService.findPblmList(param); InspUtils.addLocs(inspPblmList); return buildSuccessResponse(inspPblmList); } @ApiOperation(value = "获取行政区划取水量问题列表") @RequestMapping(value = "/page/cityPblm", method = RequestMethod.POST) public BaseResponse> cityPblm(@RequestBody PblmParam param) { param.setProvince(inspOrgService.getProvince(getCurrentOrgId())); param.setPersId(getCurrentPersId()); param.setOrgId(getCurrentOrgId()); if (StringUtils.isBlank(param.getTabType())) { param.setTabType(CommonLabel.TAB_TYPE); } String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); param.setNowTime(nowTime); param.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId()))); PageInfo inspPblmList = bisInspPblmService.findPblmList(param); InspUtils.addLocs(inspPblmList); return buildSuccessResponse(inspPblmList); } @ApiOperation(value = "获取节水管理与评价督查问题列表") @RequestMapping(value = "/page/svwtPblm", method = RequestMethod.POST) public BaseResponse> svwtPblm(@RequestBody PblmParam param) { param.setProvince(inspOrgService.getProvince(getCurrentOrgId())); param.setPersId(getCurrentPersId()); param.setOrgId(getCurrentOrgId()); if (StringUtils.isBlank(param.getTabType())) { param.setTabType(CommonLabel.TAB_TYPE); } String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); param.setNowTime(nowTime); param.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId()))); PageInfo inspPblmList = bisInspPblmService.findPblmList(param); InspUtils.addLocs(inspPblmList); return buildSuccessResponse(inspPblmList); } @ApiOperation(value = "问题处理通用接口") @RequestMapping(value = "/page/pblm", method = RequestMethod.POST) public BaseResponse> pblm(@RequestBody PblmParam param) { if (StringUtils.isBlank(param.getpType())) { throw new CheckException("pType为必传参数"); } param.setProvince(inspOrgService.getProvince(getCurrentOrgId())); param.setPersId(getCurrentPersId()); param.setOrgId(getCurrentOrgId()); if (StringUtils.isBlank(param.getTabType())) { param.setTabType(CommonLabel.TAB_TYPE); } String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); param.setNowTime(nowTime); param.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId()))); PageInfo inspPblmList = bisInspPblmService.findPblmList(param); InspUtils.addLocs(inspPblmList); return buildSuccessResponse(inspPblmList); } @ApiOperation(value = "水保问题") @RequestMapping(value = "/page/prdPblm", method = RequestMethod.POST) public BaseResponse> prdPblm(@RequestBody PblmParam param) { param.setProvince(inspOrgService.getProvince(getCurrentOrgId())); param.setpType("17"); param.setPersId(getCurrentPersId()); param.setOrgId(getCurrentOrgId()); if (StringUtils.isBlank(param.getTabType())) { param.setTabType(CommonLabel.TAB_TYPE); } String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); param.setNowTime(nowTime); param.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId()))); PageInfo inspPblmList = bisInspPblmService.findPblmList(param); InspUtils.addLocs(inspPblmList); return buildSuccessResponse(inspPblmList); } @ApiOperation(value = "河湖四乱问题") @RequestMapping(value = "/page/jsflPblm", method = RequestMethod.POST) public BaseResponse> jsflPblm(@RequestBody PblmParam param) { param.setProvince(inspOrgService.getProvince(getCurrentOrgId())); param.setpType("18"); param.setPersId(getCurrentPersId()); param.setOrgId(getCurrentOrgId()); if (StringUtils.isBlank(param.getTabType())) { param.setTabType(CommonLabel.TAB_TYPE); } String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); param.setNowTime(nowTime); param.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId()))); PageInfo inspPblmList = bisInspPblmService.findPblmList(param); InspUtils.addLocs(inspPblmList); return buildSuccessResponse(inspPblmList); } @ApiOperation(value = "非法采砂问题") @RequestMapping(value = "/page/jswaPblm", method = RequestMethod.POST) public BaseResponse> jswaPblm(@RequestBody PblmParam param) { param.setProvince(inspOrgService.getProvince(getCurrentOrgId())); param.setOrgId(getCurrentOrgId()); param.setpType("19"); param.setPersId(getCurrentPersId()); if (StringUtils.isBlank(param.getTabType())) { param.setTabType(CommonLabel.TAB_TYPE); } String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); param.setNowTime(nowTime); param.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId()))); PageInfo inspPblmList = bisInspPblmService.findPblmList(param); InspUtils.addLocs(inspPblmList); return buildSuccessResponse(inspPblmList); } @ApiOperation(value = "节水载体复核") @RequestMapping(value = "/page/jsztfh/export", method = RequestMethod.POST) public void jsztfh(@RequestBody PblmParam param, HttpServletResponse response) { response.setContentType("application/binary;charset=UTF-8"); String orgIds = InspUtils.setOrgIds(param.getOrgIds()); param.setOrgIds(orgIds); param.setProvince(inspOrgService.getProvince(getCurrentOrgId())); param.setPersId(getCurrentPersId()); param.setOrgId(getCurrentOrgId()); if (StringUtils.isBlank(param.getTabType())) { param.setTabType(CommonLabel.TAB_TYPE); } String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); param.setNowTime(nowTime); param.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId()))); List pblmList = bisInspPblmDao.findPblmList(param); String name = "对象名称"; InspPblmUtils.Export(response, "wtcrr", pblmList, name); } @ApiOperation(value = "取水许可管理复核") @RequestMapping(value = "/page/qsxkglfh/export", method = RequestMethod.POST) public void qsxkglfh(@RequestBody PblmParam param, HttpServletResponse response) { response.setContentType("application/binary;charset=UTF-8"); String orgIds = InspUtils.setOrgIds(param.getOrgIds()); param.setOrgIds(orgIds); param.setProvince(inspOrgService.getProvince(getCurrentOrgId())); param.setPersId(getCurrentPersId()); param.setOrgId(getCurrentOrgId()); if (StringUtils.isBlank(param.getTabType())) { param.setTabType(CommonLabel.TAB_TYPE); } String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); param.setNowTime(nowTime); param.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId()))); List pblmList = bisInspPblmDao.findPblmList(param); String name = "对象名称"; InspPblmUtils.Export(response, "wtgt", pblmList, name); } @ApiOperation(value = "水资源管理及节水管理复核") @RequestMapping(value = "/page/szygljsgl/export", method = RequestMethod.POST) public void szygljsgl(@RequestBody PblmParam param, HttpServletResponse response) { response.setContentType("application/binary;charset=UTF-8"); String orgIds = InspUtils.setOrgIds(param.getOrgIds()); param.setOrgIds(orgIds); param.setProvince(inspOrgService.getProvince(getCurrentOrgId())); param.setPersId(getCurrentPersId()); param.setOrgId(getCurrentOrgId()); if (StringUtils.isBlank(param.getTabType())) { param.setTabType(CommonLabel.TAB_TYPE); } String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); param.setNowTime(nowTime); param.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId()))); List pblmList = bisInspPblmDao.findPblmList(param); String name = "对象名称"; InspPblmUtils.Export(response, "wrws", pblmList, name); } @ApiOperation(value = "河湖四乱问题导出问题列表-导出excel") @RequestMapping(value = "/page/jsflPblm/export", method = RequestMethod.POST) public void jsflPblmExport(@ApiParam(name = "prdParam", value = "prdParam", required = true) @RequestBody PrdParam prdParam, HttpServletResponse response) { response.setContentType("application/binary;charset=UTF-8"); String orgIds = InspUtils.setOrgIds(prdParam.getOrgIds()); prdParam.setOrgIds(orgIds); prdParam.setProvince(inspOrgService.getProvince(getCurrentOrgId())); prdParam.setPersId(getCurrentPersId()); prdParam.setOrgId(getCurrentOrgId()); if (StringUtils.isBlank(prdParam.getTabType())) { prdParam.setTabType(CommonLabel.TAB_TYPE); } String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); prdParam.setNowTime(nowTime); prdParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId()))); List pblmList = bisInspPblmDao.findJsflPlbmList(prdParam); String name = "河湖四乱"; InspPblmUtils.Export(response, "jsfl", pblmList, name); } @ApiOperation(value = "非法采砂导出问题列表-导出excel") @RequestMapping(value = "/page/jswaPblm/export", method = RequestMethod.POST) public void jswaPblmExport(@ApiParam(name = "prdParam", value = "prdParam", required = true) @RequestBody PrdParam prdParam, HttpServletResponse response) { response.setContentType("application/binary;charset=UTF-8"); String orgIds = InspUtils.setOrgIds(prdParam.getOrgIds()); prdParam.setOrgIds(orgIds); prdParam.setOrgId(getCurrentOrgId()); prdParam.setProvince(inspOrgService.getProvince(getCurrentOrgId())); prdParam.setPersId(getCurrentPersId()); if (StringUtils.isBlank(prdParam.getTabType())) { prdParam.setTabType(CommonLabel.TAB_TYPE); } String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); prdParam.setNowTime(nowTime); prdParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId()))); List pblmList = bisInspPblmDao.findJswaPlbmList(prdParam); String name = "非法采砂"; InspPblmUtils.Export(response, "jswa", pblmList, name); } @ApiOperation(value = "水保督查导出问题列表-导出excel") @RequestMapping(value = "/page/prdPblm/export", method = RequestMethod.POST) public void prdPblmExport(@ApiParam(name = "prdParam", value = "prdParam", required = true) @RequestBody PrdParam prdParam, HttpServletResponse response) { response.setContentType("application/binary;charset=UTF-8"); String orgIds = InspUtils.setOrgIds(prdParam.getOrgIds()); prdParam.setOrgIds(orgIds); prdParam.setOrgId(getCurrentOrgId()); prdParam.setProvince(inspOrgService.getProvince(getCurrentOrgId())); prdParam.setPersId(getCurrentPersId()); if (StringUtils.isBlank(prdParam.getTabType())) { prdParam.setTabType(CommonLabel.TAB_TYPE); } String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); prdParam.setNowTime(nowTime); prdParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId()))); List pblmList = bisInspPblmDao.findPrdPlbmList(prdParam); String name = "水保工作核实"; InspPblmUtils.Export(response, "prd", pblmList, name); } @ApiOperation(value = "百日攻坚(中央环保督查)问题") @RequestMapping(value = "/page/ecofrdPblm", method = RequestMethod.POST) public BaseResponse> ecofrdPblm(@RequestBody PblmParam param) { param.setProvince(inspOrgService.getProvince(getCurrentOrgId())); param.setpType("20"); param.setOrgId(getCurrentOrgId()); param.setPersId(getCurrentPersId()); if (StringUtils.isBlank(param.getTabType())) { param.setTabType(CommonLabel.TAB_TYPE); } String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); param.setNowTime(nowTime); param.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId()))); PageInfo inspPblmList = bisInspPblmService.findPblmList(param); InspUtils.addLocs(inspPblmList); return buildSuccessResponse(inspPblmList); } @ApiOperation(value = "百日攻坚(中央环保督查)导出问题列表-导出excel") @RequestMapping(value = "/page/ecofrdPblm/export", method = RequestMethod.POST) public void ecofrdPblm(@ApiParam(name = "prdParam", value = "prdParam", required = true) @RequestBody PrdParam prdParam, HttpServletResponse response) { response.setContentType("application/binary;charset=UTF-8"); String orgIds = InspUtils.setOrgIds(prdParam.getOrgIds()); prdParam.setOrgIds(orgIds); prdParam.setOrgId(getCurrentOrgId()); prdParam.setProvince(inspOrgService.getProvince(getCurrentOrgId())); prdParam.setPersId(getCurrentPersId()); if (StringUtils.isBlank(prdParam.getTabType())) { prdParam.setTabType(CommonLabel.TAB_TYPE); } String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); prdParam.setNowTime(nowTime); prdParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId()))); List pblmList = bisInspPblmDao.findEcofrdPlbmList(prdParam); String name = "中央环保督查问题"; InspPblmUtils.Export(response, "ecofrd", pblmList, name); } @Autowired private BisBisRdwspRgstrFeeService bisBisRdwspRgstrFeeService; @ApiOperation(value = "获取回头看,villType传1,2,3多个用逗号分隔") @RequestMapping(value = "/page/rdwsp", method = RequestMethod.POST) public BaseResponse> rdwsp(@ApiParam(name = "pblmParam", value = "pblmParam", required = true) @RequestBody PlbmParam pblmParam) { pblmParam.setPresId(getCurrentPersId()); PageInfo inspPblmList = bisBisRdwspRgstrFeeService.findPageList(pblmParam); InspUtils.addLocs(inspPblmList); return buildSuccessResponse(inspPblmList); } @ApiOperation(value = "根据督查组id获取需要督查问题列表,分页") @RequestMapping(value = "/pageHaveFilePath", method = RequestMethod.POST) public BaseResponse> pageHaveFilePath(@ApiParam(name = "bisInspPblm", value = "BisInspPblm", required = true) @RequestBody PlbmParam pblmParam, HttpServletRequest request) { pblmParam.setProvince(inspOrgService.getProvince(getCurrentOrgId())); pblmParam.setOrgId(getCurrentOrgId()); if (StringUtils.isBlank(pblmParam.getTabType())) { pblmParam.setTabType(CommonLabel.TAB_TYPE); String source = request.getHeader("source"); if (StringUtils.isNotBlank(source)) { pblmParam.setTabType("0"); } } String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); String nowYear = new SimpleDateFormat("yyyy").format(new Date()); String nowMonth = new SimpleDateFormat("yyyy-MM").format(new Date()); pblmParam.setNowMonth(nowMonth); pblmParam.setNowYear(nowYear); pblmParam.setNowTime(nowTime); pblmParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId()))); PageInfo inspPblmList = new PageInfo<>(); if (BisInspEnum.VILL2020.getValue().equals(pblmParam.getObjType())) { inspPblmList = bisNewVillRgstrService.findPageList(pblmParam); } else if (BisInspEnum.VILLZHEJIANG.getValue().equals(pblmParam.getObjType())) { inspPblmList = bisZhejiangVillRgstrService.findPageList(pblmParam); } else if (BisInspEnum.MFDP.getValue().equals(pblmParam.getObjType())) { inspPblmList = bisInspMfdpRgstrService.findPblmPage(pblmParam); } else { inspPblmList = bisInspPblmService.findPageList(pblmParam); } List list = inspPblmList.getList(); for (BisInspPblm bisInspPblm : list) { List pathList = bisInspPblmService.getPblmPath(bisInspPblm.getPblmId()); bisInspPblm.setFilePath(pathList); } PageInfo bisInspPblmList = new PageInfo<>(list); return buildSuccessResponse(bisInspPblmList); } @ApiOperation(value = "问题汇总功能增加外部问题导入 ") @PostMapping("/page/import") public BaseResponse pblmImport(@RequestParam("file") MultipartFile f) { try { bisInspPblmService.excelImport(f, getCurrentPersId()); } catch (Exception e) { logger.error(e.getMessage()); } return buildSuccessResponse(); } @ApiOperation(value = "excel导入问题查询") @PostMapping("/page/getImport") public BaseResponse> getPblmListFromImport(@ApiParam(name = "PblmParam", value = "PblmParam", required = true) @RequestBody PblmParam param) { param.setProvince(AdLevelUtil.getAddvcd(olBisInspOrgService.getRlProvince(getCurrentOrgId()))); param.setOrgId(getCurrentOrgId()); List pblmListFromImport = bisInspPblmService.getPblmListFromImport(param); PageInfo bisInspPblmList = new PageInfo<>(pblmListFromImport); return buildSuccessResponse(bisInspPblmList); } @ApiOperation(value = "批量逻辑删除导入问题查询") @PostMapping("/batch/delete") public void batchDelete(@ApiParam(name = "PblmParam", value = "PblmParam", required = true) @RequestBody List param) { bisInspPblmService.batchDelete(param); } @Value("${export.templatePath}") String excelFilePath; @ApiOperation(value = "下载Excel导入模板") @GetMapping("/page/downloadExcel") public void downExcelModel(HttpServletResponse response) throws Exception { InputStream inStream = new FileInputStream(excelFilePath + "/importPblm.xlsx"); response.reset(); response.setContentType("application/octet-stream; charset=UTF-8"); response.setCharacterEncoding("utf-8"); response.addHeader("Content-Disposition", "attachment; filename=" + URLEncoder.encode("问题导入模板.xlsx", "UTF-8")); byte[] b = new byte[4096]; int len; try { while ((len = inStream.read(b)) > 0) response.getOutputStream().write(b, 0, len); inStream.close(); } catch (IOException e) { e.printStackTrace(); } } @ApiOperation(value = "128导出问题列表-导出excel") @RequestMapping(value = "/genrl/export", method = RequestMethod.POST) public void genrlExport(@ApiParam(name = "reverParam", value = "reverParam", required = true) @RequestBody ReverParam reverParam, HttpServletResponse response) { reverParam.setPageNum(1); reverParam.setPageSize(1000000); BaseResponse> response1 = rever(reverParam); List pblmList = response1.getData().getList(); response.setContentType("application/binary;charset=UTF-8"); InspPblmUtils.ExportProblemList(response, pblmList, "问题列表"); } }