f1476d5f99a0052f604f14895bfee99a2a4c2dc3.svn-base 80 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567
  1. package cn.com.goldenwater.dcproj.controller.pblm;
  2. import cn.com.goldenwater.core.web.BaseController;
  3. import cn.com.goldenwater.core.web.BaseResponse;
  4. import cn.com.goldenwater.dcproj.constValue.AdCodeLabel;
  5. import cn.com.goldenwater.dcproj.constValue.BisInspEnum;
  6. import cn.com.goldenwater.dcproj.constValue.BisInspObjEnum;
  7. import cn.com.goldenwater.dcproj.constValue.CommonLabel;
  8. import cn.com.goldenwater.dcproj.dao.BisInspPblmDao;
  9. import cn.com.goldenwater.dcproj.dao.BisInspPblmRepeatDao;
  10. import cn.com.goldenwater.dcproj.dao.BisInspRsvrRgstrRepeatDao;
  11. import cn.com.goldenwater.dcproj.dto.*;
  12. import cn.com.goldenwater.dcproj.model.*;
  13. import cn.com.goldenwater.dcproj.param.*;
  14. import cn.com.goldenwater.dcproj.service.*;
  15. import cn.com.goldenwater.dcproj.target.Authority;
  16. import cn.com.goldenwater.dcproj.utils.AdLevelUtil;
  17. import cn.com.goldenwater.dcproj.utils.InspPblmUtils;
  18. import cn.com.goldenwater.dcproj.utils.InspUtils;
  19. import cn.com.goldenwater.target.CheckException;
  20. import cn.com.goldenwater.util.common.SqlUtils;
  21. import com.github.pagehelper.PageInfo;
  22. import io.swagger.annotations.Api;
  23. import io.swagger.annotations.ApiOperation;
  24. import io.swagger.annotations.ApiParam;
  25. import org.apache.commons.lang3.StringUtils;
  26. import org.apache.poi.ss.usermodel.Row;
  27. import org.apache.poi.ss.usermodel.Sheet;
  28. import org.apache.poi.xssf.usermodel.XSSFWorkbook;
  29. import org.slf4j.Logger;
  30. import org.slf4j.LoggerFactory;
  31. import org.springframework.beans.factory.annotation.Autowired;
  32. import org.springframework.beans.factory.annotation.Value;
  33. import org.springframework.web.bind.annotation.*;
  34. import org.springframework.web.multipart.MultipartFile;
  35. import javax.servlet.http.HttpServletRequest;
  36. import javax.servlet.http.HttpServletResponse;
  37. import java.io.FileInputStream;
  38. import java.io.IOException;
  39. import java.io.InputStream;
  40. import java.net.URLEncoder;
  41. import java.text.SimpleDateFormat;
  42. import java.util.*;
  43. /**
  44. * @author lune
  45. * @date 2019-2-18
  46. */
  47. @Api(value = "APP 督查问题管理", tags = "APP 督查问题管理")
  48. @RestController
  49. @RequestMapping("/dc/insp/pblm")
  50. public class BisInspPblmController extends BaseController {
  51. private Logger logger = LoggerFactory.getLogger(getClass());
  52. @Autowired
  53. private OlBisInspOrgService olBisInspOrgService;
  54. @Autowired
  55. private BisInspPblmService bisInspPblmService;
  56. @Autowired
  57. private ObjInspPblmsService objInspPblmsService;
  58. @Autowired
  59. private GwComFileService gwComFileService;
  60. @Autowired
  61. private BisInspAllRlationPersService inspAllRlationPersService;
  62. @Autowired
  63. private BisZhejiangVillRgstrService bisZhejiangVillRgstrService;
  64. @Autowired
  65. private BisInspMfdpRgstrService bisInspMfdpRgstrService;
  66. @Autowired
  67. private BisNewVillRgstrService bisNewVillRgstrService;
  68. @Autowired
  69. private BisInspWtdstTrackService bisInspWtdstTrackService;
  70. @Autowired
  71. private BisInspChmclsUseunitwkService bisInspChmclsUseunitwkService;
  72. @ApiOperation(value = "添加(修改)督查问题管理")
  73. @RequestMapping(value = "", method = RequestMethod.POST)
  74. public BaseResponse<BisInspPblm> insert(@ApiParam(name = "bisInspPblm", value = "bisInspPblm", required = true)
  75. @RequestBody BisInspPblm bisInspPblm) {
  76. bisInspPblm.setOrgId(getCurrentOrgId());
  77. bisInspPblm.setRecPers(getCurrentPersId());
  78. if (StringUtils.isNotBlank(bisInspPblm.getPblmsTypeId()) &&
  79. !BisInspEnum.EMPWT.getValue().equals(bisInspPblm.getObjType())) {
  80. bisInspPblm.setPblmsTypeId(bisInspPblm.getPblmsTypeId().trim());
  81. ObjInspPblms objInspPblms = objInspPblmsService.get(bisInspPblm.getPblmsTypeId());
  82. if (objInspPblms != null) {
  83. bisInspPblm.setInspPblmCode(objInspPblms.getSn());
  84. bisInspPblm.setInspPblmType(objInspPblms.getSort2());
  85. bisInspPblm.setCheckPointBz(objInspPblms.getCheckPoint());
  86. bisInspPblm.setPblmDescBz(objInspPblms.getPblmDesc());
  87. bisInspPblm.setPblmNameBz(objInspPblms.getInspPblmsName());
  88. bisInspPblm.setSnNumBz(objInspPblms.getSnNum());
  89. bisInspPblm.setFileNo(objInspPblms.getAttach());
  90. bisInspPblm.setFileNoNumber(objInspPblms.getSnNum());
  91. bisInspPblm.setScore(objInspPblms.getScore());
  92. bisInspPblm.setSnNum(objInspPblms.getSnNum());
  93. }
  94. }
  95. if (BisInspEnum.VILL2020.getValue().equals(bisInspPblm.getObjType())) {
  96. if (BisInspObjEnum.CWS2020.getDesc().equals(bisInspPblm.getInspPblmName())) {
  97. bisInspPblm.setVillType(BisInspObjEnum.CWS2020.getValue());
  98. }
  99. if (BisInspObjEnum.CWS2020LAW.getDesc().equals(bisInspPblm.getInspPblmName())) {
  100. bisInspPblm.setVillType(BisInspObjEnum.CWS2020LAW.getValue());
  101. }
  102. if (BisInspObjEnum.CWS2020WATER.getDesc().equals(bisInspPblm.getInspPblmName())) {
  103. bisInspPblm.setVillType(BisInspObjEnum.CWS2020WATER.getValue());
  104. }
  105. }
  106. if (StringUtils.isNotBlank(bisInspPblm.getPblmId())) {
  107. // 修改问题
  108. if (BisInspEnum.EMPWT.getValue().equals(bisInspPblm.getObjType()) ||
  109. BisInspEnum.EMPWTRUN.getValue().equals(bisInspPblm.getObjType())) {
  110. if (StringUtils.isBlank(bisInspPblm.getPblmsId())) {
  111. bisInspPblm.setPblmsId(CommonLabel.INIT_DATA);
  112. }
  113. if (StringUtils.isBlank(bisInspPblm.getPblmsTypeId())) {
  114. bisInspPblm.setPblmsTypeId(CommonLabel.INIT_DATA);
  115. }
  116. if (StringUtils.isBlank(bisInspPblm.getQualityTypeId())) {
  117. bisInspPblm.setQualityTypeId(CommonLabel.INIT_DATA);
  118. }
  119. if (StringUtils.isBlank(bisInspPblm.getDefectTypeId())) {
  120. bisInspPblm.setDefectTypeId(CommonLabel.INIT_DATA);
  121. }
  122. }
  123. bisInspPblmService.updatePblm(bisInspPblm);
  124. return buildSuccessResponse(200, "修改成功", bisInspPblm);
  125. }
  126. bisInspPblmService.insertPblms(bisInspPblm);
  127. return buildSuccessResponse(bisInspPblm);
  128. }
  129. @ApiOperation(value = "问题列表")
  130. @RequestMapping(value = "/listWithImg", method = RequestMethod.POST)
  131. public BaseResponse listWithImg(@ApiParam(name = "bisInspPblm", value = "BisInspPblm", required = true)
  132. @RequestBody PlbmParam pblmParam) {
  133. pblmParam.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  134. pblmParam.setOrgId(getCurrentOrgId());
  135. pblmParam.setOrderBy("COLL_TIME DESC");
  136. PageInfo<BisInspPblm> inspPblmList = bisInspPblmService.findPageList(pblmParam);
  137. inspPblmList.getList().forEach(pblm -> {
  138. List<GwComFile> gwComFileList = gwComFileService.getImgByBizId(pblm.getPblmId(), 1);
  139. if (null != gwComFileList && gwComFileList.size() > 0) {
  140. pblm.setImg(gwComFileList.stream()
  141. .map(GwComFile::getFilePath)
  142. .filter(StringUtils::isNotBlank)
  143. .findFirst()
  144. .map(o -> o.replaceAll("\\\\", "/").replaceAll("//", "/"))
  145. .orElse(null));
  146. }
  147. });
  148. return buildSuccessResponse(inspPblmList);
  149. }
  150. @ApiOperation(value = "批量修改问题状态 比传objid,类型ID,状态值")
  151. @RequestMapping(value = "/updatePblmState", method = RequestMethod.POST)
  152. public BaseResponse<List<BisInspPblmParam>> updatePblmState(@ApiParam(name = "bisInspPblm", value = "bisInspPblm", required = true)
  153. @RequestBody List<BisInspPblmParam> bisInspPblmParams) throws Exception {
  154. for (BisInspPblmParam bisInspPblm : bisInspPblmParams) {
  155. bisInspPblmService.updatePblmState(bisInspPblm);
  156. }
  157. return buildSuccessResponse(bisInspPblmParams);
  158. }
  159. @ApiOperation(value = "根据ID删除和用户id督查问题管理")
  160. @RequestMapping(value = "/delete/{id}/{presId}", method = RequestMethod.GET)
  161. public Object delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id, @ApiParam(name = "presId", value = "presId", required = true) @PathVariable String presId) {
  162. BisInspPblm inspPblm = bisInspPblmService.get(id);
  163. if (inspPblm != null) {
  164. bisInspPblmService.delete(id);
  165. Map<String, String> params = new HashMap<>(1);
  166. params.put("data", "删除成功");
  167. return buildSuccessResponse(params);
  168. }
  169. return buildFailResponse("已删除,该问题清单已经不存在!!");
  170. }
  171. @ApiOperation(value = "问题处置通用查询")
  172. @RequestMapping(value = "/chuzhi/pblmPage", method = RequestMethod.POST)
  173. public BaseResponse pblmPage(@ApiParam(name = "bisInspVo", value = "bisInspVo", required = true) @RequestBody BisInspVo bisInspVo) {
  174. bisInspVo.setObjType(String.valueOf(Integer.parseInt(bisInspVo.getObjType())));
  175. String curPersId = getCurrentPersId();
  176. BisInspAllRlationPers allRlationPers = inspAllRlationPersService.get(curPersId);
  177. if (allRlationPers != null && StringUtils.isNotBlank(allRlationPers.getProvince())) {
  178. String province = allRlationPers.getProvince().replace(AdCodeLabel.START_PARENT_ADCODE, "");
  179. bisInspVo.setProvince(province);
  180. }
  181. String curOrgId = getCurrentOrgId();
  182. if (StringUtils.isNotBlank(curOrgId)) {
  183. OlBisInspOrg olBisInspOrg = inspOrgService.get(curOrgId);
  184. if (olBisInspOrg == null) {
  185. return buildFailResponse("传入参数有误!");
  186. }
  187. bisInspVo.setOrgId("");
  188. bisInspVo.setBelongOrgId(olBisInspOrg.getOrgId());
  189. String adCode = olBisInspOrg.getAdCode().replace("00", "");
  190. bisInspVo.setAdCode(adCode);
  191. if ("80df1213ad9f493e85a771d6f4b18a17".equals(curPersId)) {
  192. bisInspVo.setProvince(AdLevelUtil.getAddvcd(olBisInspOrg.getRlcode()));
  193. }
  194. PageInfo<BisInspVo> retCountPageInfo = new PageInfo<>();
  195. if (StringUtils.isNotBlank(bisInspVo.getObjAdCode())) {
  196. bisInspVo.setObjAdCode(AdLevelUtil.getAddvcd(bisInspVo.getObjAdCode()));
  197. }
  198. if (StringUtils.isBlank(bisInspVo.getState()) || "0".equals(bisInspVo.getState())) {
  199. retCountPageInfo = bisInspPblmService.pblmPage(bisInspVo);
  200. } else {
  201. retCountPageInfo = bisInspPblmService.pblmRectPage(bisInspVo);
  202. }
  203. return buildSuccessResponse(retCountPageInfo);
  204. }
  205. return buildFailResponse("参数缺失");
  206. }
  207. @ApiOperation(value = "更新督查问题管理信息")
  208. @RequestMapping(value = "/update", method = RequestMethod.POST)
  209. public BaseResponse update(@ApiParam(name = "bisInspPblm", value = "bisInspPblm", required = true)
  210. @RequestBody BisInspPblm bisInspPblm) {
  211. insert(bisInspPblm);
  212. return buildSuccessResponse(bisInspPblm);
  213. }
  214. @ApiOperation(value = "查询人饮问题类型")
  215. @RequestMapping(value = "/findVillType", method = RequestMethod.GET)
  216. public BaseResponse<List<String>> findVillType() {
  217. List<String> inspPblmNames = bisInspPblmService.findVillType(getCurrentOrgId());
  218. return buildSuccessResponse(inspPblmNames);
  219. }
  220. @ApiOperation(value = "根据用户id查找分离用户问题如为督查人员问题还是督查办问题统计")
  221. @RequestMapping(value = "/seperatePblm", method = RequestMethod.GET)
  222. public BaseResponse<List<PblmRole>> seperatePblm(@ApiParam(name = "persId", value = "persId", required = true) @RequestParam String persId) {
  223. List<PblmRole> roleList = bisInspPblmService.findPblmByPersId(persId, getCurrentOrgId());
  224. List<PblmRole> roleListNew = new ArrayList<>();
  225. for (PblmRole pblmRole : roleList) {
  226. if ("1".equals(pblmRole.getPerType())) {
  227. pblmRole.setLength(6);
  228. } else {
  229. pblmRole.setLength(12);
  230. }
  231. //适配app端
  232. pblmRole.setId(pblmRole.getId() + "01");
  233. if (!roleListNew.contains(pblmRole)) {
  234. roleListNew.add(pblmRole);
  235. }
  236. }
  237. return buildSuccessResponse(roleListNew);
  238. }
  239. @ApiOperation(value = "统计小水库问题-问题详情图表-分页")
  240. @RequestMapping(value = "/countByReverPage", method = RequestMethod.POST)
  241. public BaseResponse<PageInfo<PblmRetCount>> countByReverPage(@ApiParam(name = "countParam", value = "countParam", required = true) @RequestBody CountParam countParam) {
  242. countParam.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  243. countParam.setOrgId(getCurrentOrgId());
  244. if (StringUtils.isBlank(countParam.getpType())) {
  245. countParam.setpType("1");
  246. }
  247. countParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId())));
  248. PageInfo<PblmRetCount> retCountPageInfo = bisInspPblmService.countByReverPage(countParam);
  249. return buildSuccessResponse(retCountPageInfo);
  250. }
  251. @ApiOperation(value = "统计小水闸问题-问题详情图表-分页")
  252. @RequestMapping(value = "/countByWagaPage", method = RequestMethod.POST)
  253. public BaseResponse<PageInfo<PblmRetCount>> countByWagaPage(@ApiParam(name = "countParam", value = "countParam", required = true) @RequestBody CountParam countParam) {
  254. countParam.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  255. countParam.setOrgId(getCurrentOrgId());
  256. countParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId())));
  257. PageInfo<PblmRetCount> retCountPageInfo = bisInspPblmService.countByWagaPage(countParam);
  258. return buildSuccessResponse(retCountPageInfo);
  259. }
  260. @ApiOperation(value = "(督查人员与流域机构共有)统计172重点工程(pType=4工程建设,pType=7工程运行)问题-问题详情图表-分页")
  261. @RequestMapping(value = "/countByKeyRegPage", method = RequestMethod.POST)
  262. public BaseResponse<PageInfo<PblmRetCount>> countByKeyRegPage(@ApiParam(name = "countParam", value = "countParam", required = true) @RequestBody CountParam countParam) {
  263. countParam.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  264. countParam.setOrgId(getCurrentOrgId());
  265. countParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId())));
  266. PageInfo<PblmRetCount> retCountPageInfo = bisInspPblmService.countByKeyRegPage(countParam);
  267. return buildSuccessResponse(retCountPageInfo);
  268. }
  269. @ApiOperation(value = "统计淤地坝问题-问题统计")
  270. @RequestMapping(value = "/countBySdPage", method = RequestMethod.POST)
  271. public BaseResponse<PageInfo<PblmRetCount>> countBySdPage(@ApiParam(name = "countParam", value = "countParam", required = true) @RequestBody CountParam countParam) {
  272. countParam.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  273. countParam.setOrgId(getCurrentOrgId());
  274. countParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId())));
  275. PageInfo<PblmRetCount> pageInfo = bisInspPblmService.countBySdPage(countParam);
  276. return buildSuccessResponse(pageInfo);
  277. }
  278. @ApiOperation(value = "统计水源地问题-问题统计")
  279. @RequestMapping(value = "/countBySwhsPage", method = RequestMethod.POST)
  280. public BaseResponse<PageInfo<PblmRetCount>> countBySwhsPage(@ApiParam(name = "countParam", value = "countParam", required = true) @RequestBody CountParam countParam) {
  281. countParam.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  282. countParam.setOrgId(getCurrentOrgId());
  283. countParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId())));
  284. PageInfo<PblmRetCount> pageInfo = bisInspPblmService.countBySwhsPage(countParam);
  285. return buildSuccessResponse(pageInfo);
  286. }
  287. @ApiOperation(value = "统计取用水户问题-问题统计")
  288. @RequestMapping(value = "/countByWiuPage", method = RequestMethod.POST)
  289. public BaseResponse<PageInfo<PblmRetCount>> countByWiuPage(@ApiParam(name = "countParam", value = "countParam", required = true) @RequestBody CountParam countParam) {
  290. countParam.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  291. countParam.setOrgId(getCurrentOrgId());
  292. countParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId())));
  293. PageInfo<PblmRetCount> pageInfo = bisInspPblmService.countByWiuPage(countParam);
  294. return buildSuccessResponse(pageInfo);
  295. }
  296. @ApiOperation(value = "统计取水保督查问题-问题统计")
  297. @RequestMapping(value = "/countByPrdPage", method = RequestMethod.POST)
  298. public BaseResponse<PageInfo<PblmRetCount>> countByPrdPage(@ApiParam(name = "countParam", value = "countParam", required = true) @RequestBody CountParam countParam) {
  299. countParam.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  300. countParam.setOrgId(getCurrentOrgId());
  301. countParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId())));
  302. PageInfo<PblmRetCount> pageInfo = bisInspPblmService.countByPrdPage(countParam);
  303. return buildSuccessResponse(pageInfo);
  304. }
  305. @ApiOperation(value = "统计河湖四乱核查问题-问题统计")
  306. @RequestMapping(value = "/countByJsflPage", method = RequestMethod.POST)
  307. public BaseResponse<PageInfo<PblmRetCount>> countByJsflPage(@ApiParam(name = "countParam", value = "countParam", required = true) @RequestBody CountParam countParam) {
  308. countParam.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  309. countParam.setOrgId(getCurrentOrgId());
  310. countParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId())));
  311. PageInfo<PblmRetCount> pageInfo = bisInspPblmService.countByJsflPage(countParam);
  312. return buildSuccessResponse(pageInfo);
  313. }
  314. @ApiOperation(value = "统计非法采砂核查问题-问题统计")
  315. @RequestMapping(value = "/countByJswaPage", method = RequestMethod.POST)
  316. public BaseResponse<PageInfo<PblmRetCount>> countByJswaPage(@ApiParam(name = "countParam", value = "countParam", required = true) @RequestBody CountParam countParam) {
  317. countParam.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  318. countParam.setOrgId(getCurrentOrgId());
  319. countParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId())));
  320. PageInfo<PblmRetCount> pageInfo = bisInspPblmService.countByJswaPage(countParam);
  321. return buildSuccessResponse(pageInfo);
  322. }
  323. @ApiOperation(value = "统计人饮工程问题-问题详情图表-分页")
  324. @RequestMapping(value = "/countByVillPage", method = RequestMethod.POST)
  325. public BaseResponse<PageInfo<VillCount>> countByVillPage(@ApiParam(name = "countParam", value = "countParam", required = true) @RequestBody CountParam countParam) {
  326. countParam.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  327. countParam.setOrgId(getCurrentOrgId());
  328. countParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId())));
  329. PageInfo<VillCount> retCountPageInfo = bisInspPblmService.countByVillPage(countParam);
  330. return buildSuccessResponse(retCountPageInfo);
  331. }
  332. @ApiOperation(value = "统计流域机构下人饮问题-问题详情图表")
  333. @RequestMapping(value = "/countVillByArea/{persId}", method = RequestMethod.GET)
  334. public BaseResponse<List<VillCount>> countVillByArea(@ApiParam(name = "persId", value = "persId", required = true) @PathVariable String persId) {
  335. List<VillCount> retCountPageInfo = bisInspPblmService.findVillPblmBYAreaId("002%", persId, getCurrentOrgId(), BisInspEnum.VILL.getValue());
  336. return buildSuccessResponse(retCountPageInfo);
  337. }
  338. @ApiOperation(value = "统计流域机构下小水闸问题-问题详情图表")
  339. @RequestMapping(value = "/countWagaByArea/{persId}", method = RequestMethod.GET)
  340. public BaseResponse<List<WagaTotal>> countWagaByArea(@ApiParam(name = "persId", value = "persId", required = true) @PathVariable String persId) {
  341. List<WagaTotal> retCountPageInfo = bisInspPblmService.findWagaPblmBYAreaId("006%", persId, getCurrentOrgId());
  342. return buildSuccessResponse(retCountPageInfo);
  343. }
  344. @ApiOperation(value = "统计流域机构下水毁问题-问题详情图表")
  345. @RequestMapping(value = "/countTrackByArea/{persId}", method = RequestMethod.GET)
  346. public BaseResponse<List<TrackCount>> countTrackByArea(@ApiParam(name = "persId", value = "persId", required = true) @PathVariable String persId) {
  347. List<TrackCount> retCountPageInfo = bisInspPblmService.findTrackPblmBYAreaId("003%", persId, getCurrentOrgId());
  348. return buildSuccessResponse(retCountPageInfo);
  349. }
  350. @ApiOperation(value = "统计水毁问题-问题详情图表-分页")
  351. @RequestMapping(value = "/countByTrackPage", method = RequestMethod.POST)
  352. public BaseResponse<PageInfo<TrackCount>> countByTrackPage(@ApiParam(name = "countParam", value = "countParam", required = true) @RequestBody CountParam countParam) {
  353. countParam.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  354. countParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId())));
  355. PageInfo<TrackCount> retCountPageInfo = bisInspPblmService.countByTrackPage(countParam);
  356. return buildSuccessResponse(retCountPageInfo);
  357. }
  358. @ApiOperation(value = "统计人饮问题-问题详情图表-分页-总计")
  359. @RequestMapping(value = "/totalVillCount/{persId}", method = RequestMethod.GET)
  360. public BaseResponse<VillCount> totalVillCount(@ApiParam(name = "persId", value = "persId", required = true) @PathVariable String persId) {
  361. List<VillTypeCount> typeCountList = bisInspPblmDao.totalCountVill(persId, getCurrentOrgId(), inspOrgService.getProvince(getCurrentOrgId()));
  362. VillCount villCount = new VillCount();
  363. villCount.setAdFullName("总计");
  364. int count = 0;
  365. for (VillTypeCount typeCount : typeCountList) {
  366. bisInspPblmService.setVillValue(villCount, typeCount, BisInspEnum.VILL.getValue());
  367. count += typeCount.getTotal();
  368. }
  369. villCount.setTotal(count);
  370. return buildSuccessResponse(villCount);
  371. }
  372. @ApiOperation(value = "统计水毁问题-问题详情图表-分页-总计")
  373. @RequestMapping(value = "/totalTrackCount/{persId}", method = RequestMethod.GET)
  374. public BaseResponse<TrackCount> totalTrackCount(@ApiParam(name = "persId", value = "persId", required = true) @PathVariable String persId) {
  375. List<TrackTypeCount> totalCountTrack = bisInspPblmDao.totalCountTrack(persId, getCurrentOrgId(), inspOrgService.getProvince(getCurrentOrgId()));
  376. TrackCount trackCount = new TrackCount();
  377. trackCount.setNm("总计");
  378. int count = 0;
  379. for (TrackTypeCount typeCount : totalCountTrack) {
  380. bisInspPblmService.setValue(trackCount, typeCount);
  381. count += typeCount.getTotal();
  382. }
  383. trackCount.setTotal(count);
  384. return buildSuccessResponse(trackCount);
  385. }
  386. @ApiOperation(value = "统计小水库问题-问题详情图表-分页-总计")
  387. @RequestMapping(value = "/totalCount/{persId}", method = RequestMethod.GET)
  388. public BaseResponse<PblmRetCount> countByReverPage(@ApiParam(name = "persId", value = "persId", required = true) @PathVariable String persId
  389. ) {
  390. List<CateTotal> cateTotals = bisInspPblmDao.totalCount(persId, "1", inspOrgService.getProvince(getCurrentOrgId()), getCurrentOrgId());
  391. return buildSuccessResponse(InspUtils.setPblmCount(cateTotals));
  392. }
  393. @ApiOperation(value = "统计小水闸问题-问题详情图表-分页-总计")
  394. @RequestMapping(value = "/totalWagaCount/{persId}", method = RequestMethod.GET)
  395. public BaseResponse<PblmRetCount> totalWagaCount(@ApiParam(name = "persId", value = "persId", required = true) @PathVariable String persId
  396. ) {
  397. List<CateTotal> cateTotals = bisInspPblmDao.totalCount(persId, "6", inspOrgService.getProvince(getCurrentOrgId()), getCurrentOrgId());
  398. return buildSuccessResponse(InspUtils.setPblmCount(cateTotals));
  399. }
  400. @ApiOperation(value = "统计72工程问题-问题详情图表-分页-总计,当流域机构统计时,不需要传入用户")
  401. @RequestMapping(value = "/totalKeyRegCount/{persId}/{pType}", method = RequestMethod.GET)
  402. public BaseResponse<PblmRetCount> totalKeyRegCount(@ApiParam(name = "persId", value = "persId", required = true) @PathVariable String persId,
  403. @ApiParam(name = "pType", value = "pType", required = true) @PathVariable String pType
  404. ) {
  405. if ("0".equals(persId)) {
  406. persId = "";
  407. }
  408. List<CateTotal> cateTotals = bisInspPblmDao.totalCount(persId, pType, inspOrgService.getProvince(getCurrentOrgId()), getCurrentOrgId());
  409. return buildSuccessResponse(InspUtils.setPblmCount(cateTotals));
  410. }
  411. @Autowired
  412. private AttAdXBaseService attAdXBaseService;
  413. @Autowired
  414. private BisInspRsvrRgstrService bisInspRsvrRgstrService;
  415. @Autowired
  416. private BisInspPblmRepeatDao pblmRepeatDao;
  417. @Autowired
  418. private BisInspRsvrRgstrRepeatDao rsvrRgstrRepeatDao;
  419. @ApiOperation(value = "根据ID获取督查问题管理(单表)")
  420. @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  421. public BaseResponse get(@ApiParam(name = "id", value = "id", required = true)
  422. @PathVariable String id,
  423. HttpServletRequest request) {
  424. String repeat = request.getParameter("repeat");
  425. BisInspPblm bisInspPblm = null;
  426. if (StringUtils.isBlank(repeat)) {
  427. bisInspPblm = bisInspPblmService.get(id);
  428. if (bisInspPblm == null) {
  429. return buildSuccessResponse();
  430. }
  431. } else {
  432. bisInspPblm = pblmRepeatDao.get(id);
  433. }
  434. if (StringUtils.isNotBlank(bisInspPblm.getNm())) {
  435. bisInspPblm.setSrcDesc(bisInspPblm.getNm());
  436. }
  437. if (StringUtils.isNotBlank(bisInspPblm.getVillageCode())) {
  438. AttAdXBase attAdXBase = attAdXBaseService.get(bisInspPblm.getVillageCode());
  439. if (attAdXBase != null) {
  440. bisInspPblm.setSrcDesc(attAdXBase.getAdName());
  441. }
  442. }
  443. if (StringUtils.isNotBlank(bisInspPblm.getRegid()) && BisInspEnum.REVER.getValue().equals(bisInspPblm.getObjType())) {
  444. BisInspRsvrRgstr bisInspRsvrRgstr = null;
  445. if (StringUtils.isBlank(repeat)) {
  446. bisInspRsvrRgstr = bisInspRsvrRgstrService.get(bisInspPblm.getRegid());
  447. } else {
  448. bisInspRsvrRgstr = rsvrRgstrRepeatDao.get(bisInspPblm.getRegid());
  449. }
  450. if (bisInspRsvrRgstr != null) {
  451. bisInspPblm.setSrcDesc(bisInspRsvrRgstr.getRsvrNm());
  452. }
  453. }
  454. changePblm(bisInspPblm);
  455. List<GwComFile> gwComFiles = gwComFileService.findFileByBiz(bisInspPblm.getPblmId());
  456. bisInspPblm.setGwComFiles(gwComFiles);
  457. return buildSuccessResponse(bisInspPblm);
  458. }
  459. @Autowired
  460. private BisInspVill2021UsrService bisInspVill2021UsrService;
  461. @Autowired
  462. private BisInspVill2021VillService bisInspVill2021VillService;
  463. @Autowired
  464. private BisInspVill2021PblmService bisInspVill2021PblmService;
  465. @Autowired
  466. private BisInspVill2021CwsService bisInspVill2021CwsService;
  467. void changePblm(BisInspPblm pblm) {
  468. if (StringUtils.isBlank(pblm.getRegid())) {
  469. return;
  470. }
  471. BisInspEnum bisInspEnum = BisInspEnum.getEnumByType(pblm.getObjType());
  472. if (bisInspEnum == null) {
  473. return;
  474. }
  475. switch (bisInspEnum) {
  476. case VILL2021:
  477. if (StringUtils.isNotBlank(pblm.getVillType())) {
  478. switch (pblm.getVillType()) {
  479. case "251":
  480. BisInspVill2021Usr vill2021Usr = bisInspVill2021UsrService.get(pblm.getRegid());
  481. Optional.ofNullable(vill2021Usr).ifPresent(usr -> {
  482. pblm.setNm(usr.getUsrNm());
  483. BisInspVill2021Vill vill = bisInspVill2021VillService.get(usr.getVillId());
  484. Optional.ofNullable(vill).map(BisInspVill2021Vill::getAdCode).ifPresent(adCode -> {
  485. AttAdXBase adXBase = attAdXBaseService.get(adCode);
  486. Optional.ofNullable(adXBase).ifPresent(base -> {
  487. pblm.setAdFullName(base.getAdFullName());
  488. });
  489. });
  490. });
  491. break;
  492. case "252":
  493. BisInspVill2021Cws cws = bisInspVill2021CwsService.get(pblm.getRegid());
  494. Optional.ofNullable(cws).ifPresent(c -> {
  495. pblm.setNm(c.getCwsNm());
  496. if (StringUtils.isNotBlank(c.getAdCode())) {
  497. AttAdXBase adXBase = attAdXBaseService.get(c.getAdCode());
  498. Optional.ofNullable(adXBase).ifPresent(base -> {
  499. pblm.setAdFullName(base.getAdFullName());
  500. });
  501. } else {
  502. pblm.setAdFullName(c.getCwsLoc());
  503. }
  504. });
  505. break;
  506. case "253":
  507. BisInspVill2021Pblm vill2021Pblm = bisInspVill2021PblmService.get(pblm.getRegid());
  508. Optional.ofNullable(vill2021Pblm).ifPresent(p -> {
  509. pblm.setNm(p.getPblmNm());
  510. pblm.setAdFullName(p.getLoc());
  511. });
  512. break;
  513. default:
  514. }
  515. }
  516. break;
  517. case CHMCLS:
  518. BisInspChmclsUseunitwk bisInspChmclsUseunitwk = bisInspChmclsUseunitwkService.get(pblm.getRegid());
  519. if (bisInspChmclsUseunitwk != null) {
  520. pblm.setNm(bisInspChmclsUseunitwk.getDepName());
  521. }
  522. break;
  523. case TRACK:
  524. BisInspWtdstTrack bisInspWtdstTrack = bisInspWtdstTrackService.get(pblm.getRegid());
  525. if (bisInspWtdstTrack != null) {
  526. pblm.setSrcDesc(bisInspWtdstTrack.getAdNm());
  527. }
  528. break;
  529. default:
  530. }
  531. }
  532. @ApiOperation(value = "审核及驳回审核")
  533. @RequestMapping(value = "/audit/{id}/{dataStat}", method = RequestMethod.GET)
  534. public Object audit(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id,
  535. @ApiParam(name = "dataStat", value = "dataStat", required = true) @PathVariable String dataStat) {
  536. Map<String, String> params = new HashMap<>();
  537. BisInspPblm bisInspPblm = bisInspPblmService.get(id);
  538. //审核
  539. if ("2".equals(dataStat) && "1".equals(bisInspPblm.getDataStat())) {
  540. bisInspPblm.setDataStat(dataStat);
  541. bisInspPblmService.update(bisInspPblm);
  542. params.put("data", "审核完成");
  543. return buildSuccessResponse(params);
  544. }
  545. //退回
  546. if ("3".equals(dataStat) && "1".equals(bisInspPblm.getDataStat())) {
  547. bisInspPblm.setDataStat(dataStat);
  548. bisInspPblmService.update(bisInspPblm);
  549. params.put("data", "驳回完成");
  550. return buildSuccessResponse(params);
  551. }
  552. return buildFailResponse("数据错误");
  553. }
  554. @ApiOperation(value = "问题栏目:问题列表根据当前登录用户id获取需要督查问题列表")
  555. @RequestMapping(value = "/list/{persId}", method = RequestMethod.POST)
  556. public BaseResponse<PageInfo<BisInspPblm>> list(@ApiParam(name = "persId", value = "persId", required = true)
  557. @PathVariable String persId
  558. , @RequestBody(required = false) PlbmParam pblmParam) {
  559. pblmParam.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  560. pblmParam.setPresId(persId);
  561. pblmParam.setOrgId(getCurrentOrgId());
  562. pblmParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId())));
  563. PageInfo<BisInspPblm> inspPblmList = bisInspPblmService.findPageList(pblmParam);
  564. if (inspPblmList.getList() != null) {
  565. inspPblmList.getList().forEach(bisInspPblm -> {
  566. if (StringUtils.isNotBlank(bisInspPblm.getRegid()) &&
  567. BisInspEnum.CHMCLS.getValue().equals(bisInspPblm.getObjType())) {
  568. BisInspChmclsUseunitwk bisInspChmclsUseunitwk = bisInspChmclsUseunitwkService.get(bisInspPblm.getRegid());
  569. if (bisInspChmclsUseunitwk != null) {
  570. bisInspPblm.setNm(bisInspChmclsUseunitwk.getDepName());
  571. }
  572. }
  573. });
  574. }
  575. return buildSuccessResponse(inspPblmList);
  576. }
  577. @ApiOperation(value = "小水库,行政村,水源地,饮水工程,水毁统计")
  578. @RequestMapping(value = "/count/{persId}/{adCode}", method = RequestMethod.GET)
  579. public BaseResponse<List<CountType>> list(@ApiParam(name = "persId", value = "persId", required = true) @PathVariable String persId,
  580. @ApiParam(name = "adCode", value = "adCode", required = false) @PathVariable(name = "adCode", required = false) String adCode
  581. ) {
  582. List<CountType> countTypes = bisInspPblmService.countByType(persId, adCode, getCurrentOrgId());
  583. return buildSuccessResponse(countTypes);
  584. }
  585. @ApiOperation(value = "根据督查组id获取需要督查问题列表,分页")
  586. @RequestMapping(value = "/page", method = RequestMethod.POST)
  587. public BaseResponse<PageInfo<BisInspPblm>> page(@ApiParam(name = "bisInspPblm", value = "BisInspPblm", required = true)
  588. @RequestBody PlbmParam pblmParam, HttpServletRequest request) {
  589. pblmParam.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  590. pblmParam.setOrgId(getCurrentOrgId());
  591. if (StringUtils.isBlank(pblmParam.getTabType())) {
  592. pblmParam.setTabType(CommonLabel.TAB_TYPE);
  593. String source = request.getHeader("source");
  594. if (StringUtils.isNotBlank(source)) {
  595. pblmParam.setTabType("0");
  596. }
  597. }
  598. String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
  599. String nowYear = new SimpleDateFormat("yyyy").format(new Date());
  600. String nowMonth = new SimpleDateFormat("yyyy-MM").format(new Date());
  601. pblmParam.setNowMonth(nowMonth);
  602. pblmParam.setNowYear(nowYear);
  603. pblmParam.setNowTime(nowTime);
  604. pblmParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId())));
  605. PageInfo<BisInspPblm> inspPblmList = new PageInfo<>();
  606. if (BisInspEnum.VILL2020.getValue().equals(pblmParam.getObjType())) {
  607. inspPblmList = bisNewVillRgstrService.findPageList(pblmParam);
  608. } else if (BisInspEnum.VILLZHEJIANG.getValue().equals(pblmParam.getObjType())) {
  609. inspPblmList = bisZhejiangVillRgstrService.findPageList(pblmParam);
  610. } else if (BisInspEnum.MFDP.getValue().equals(pblmParam.getObjType())) {
  611. inspPblmList = bisInspMfdpRgstrService.findPblmPage(pblmParam);
  612. } else {
  613. inspPblmList = bisInspPblmService.findPageList(pblmParam);
  614. }
  615. return buildSuccessResponse(inspPblmList);
  616. }
  617. @Authority
  618. @ApiOperation(value = "统计人饮问题-问题详情图表-分页-总计")
  619. @RequestMapping(value = "/totalVill2020Count/{persId}", method = RequestMethod.GET)
  620. public BaseResponse<VillCount> totalVill2020Count(@ApiParam(name = "persId", value = "persId", required = true) @PathVariable String persId) {
  621. List<VillTypeCount> typeCountList = bisInspPblmDao.totalCountVill(persId, BisInspEnum.VILL2020.getValue(), olBisInspOrgService.getProvince(getCurrentOrgId()));
  622. VillCount villCount = new VillCount();
  623. villCount.setAdFullName("总计");
  624. int count = 0;
  625. for (VillTypeCount typeCount : typeCountList) {
  626. bisInspPblmService.setVillValue(villCount, typeCount, "25");
  627. count += typeCount.getTotal();
  628. }
  629. villCount.setTotal(count);
  630. return buildSuccessResponse(villCount);
  631. }
  632. @ApiOperation(value = "获取新人饮问题列表-新,villType传1,2,3多个用逗号分隔")
  633. @RequestMapping(value = "/page/vill2020", method = RequestMethod.POST)
  634. public BaseResponse<PageInfo<BisInspPblm>> vill2020(@ApiParam(name = "pblmParam", value = "pblmParam", required = true) @RequestBody PlbmParam pblmParam) {
  635. pblmParam.setPresId(getCurrentPersId());
  636. pblmParam.setProvince(olBisInspOrgService.getProvince(getCurrentOrgId()));
  637. if (StringUtils.isBlank(pblmParam.getTabType())) {
  638. pblmParam.setTabType(CommonLabel.TAB_TYPE);
  639. }
  640. String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
  641. pblmParam.setNowTime(nowTime);
  642. pblmParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId())));
  643. PageInfo<BisInspPblm> inspPblmList = bisNewVillRgstrService.findPageList(pblmParam);
  644. InspUtils.addLocs(inspPblmList);
  645. return buildSuccessResponse(inspPblmList);
  646. }
  647. @ApiOperation(value = "根据规则id和类型获取对应的问题列表")
  648. @RequestMapping(value = "/getPblmList/{id}/{type}/{objId}", method = {RequestMethod.GET})
  649. public BaseResponse<List<BisInspPblm>> getPblmList(@ApiParam(name = "id", value = "规则id", required = true) @PathVariable String id,
  650. @ApiParam(name = "type", value = "类型", required = true) @PathVariable String type,
  651. @ApiParam(name = "objId", value = "项目id", required = true) @PathVariable String objId) {
  652. List<BisInspPblm> list = bisInspPblmService.getPblmList(id, type, objId, getCurrentOrgId());
  653. return buildSuccessResponse(list);
  654. }
  655. @ApiOperation(value = "根据规则id和类型获取对应的问题列表")
  656. @RequestMapping(value = "/getPblmList/{id}/{type}", method = {RequestMethod.GET})
  657. public BaseResponse<List<BisInspPblm>> getPblmListById(@ApiParam(name = "id", value = "规则id", required = true) @PathVariable String id,
  658. @ApiParam(name = "type", value = "类型", required = true) @PathVariable String type) {
  659. List<BisInspPblm> list = bisInspPblmService.getPblmList(id, type, "", getCurrentOrgId());
  660. return buildSuccessResponse(list);
  661. }
  662. @ApiOperation(value = "获取小水库问题列表-新")
  663. @RequestMapping(value = "/page/rever", method = RequestMethod.POST)
  664. public BaseResponse<PageInfo<BisInspPblm>> rever(@ApiParam(name = "reverParam", value = "reverParam", required = true)
  665. @RequestBody ReverParam reverParam) {
  666. if (StringUtils.isBlank(reverParam.getpType())) {
  667. reverParam.setpType("1");
  668. }
  669. if (StringUtils.isBlank(reverParam.getObjType())) {
  670. reverParam.setObjType("1");
  671. }
  672. reverParam.setPersId(getCurrentPersId());
  673. reverParam.setOrgId(getCurrentOrgId());
  674. reverParam.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  675. if (StringUtils.isBlank(reverParam.getTabType())) {
  676. reverParam.setTabType(CommonLabel.TAB_TYPE);
  677. }
  678. String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
  679. reverParam.setNowTime(nowTime);
  680. reverParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId())));
  681. PageInfo<BisInspPblm> inspPblmList = bisInspPblmService.findReverPlbmList(reverParam);
  682. InspUtils.addLocs(inspPblmList);
  683. return buildSuccessResponse(inspPblmList);
  684. }
  685. @Autowired
  686. private OlBisInspOrgService inspOrgService;
  687. @ApiOperation(value = "获取172工程问题列表-新")
  688. @RequestMapping(value = "/page/keyReg", method = RequestMethod.POST)
  689. public BaseResponse<PageInfo<KeyRegPblm>> rever(@ApiParam(name = "reverParam", value = "reverParam", required = true) @RequestBody KeyRegPatam keyRegPatam, HttpServletRequest request) {
  690. if (StringUtils.isNotBlank(keyRegPatam.getProblemType())) {
  691. keyRegPatam.setInspPblmName(InspUtils.setPlbmName(keyRegPatam.getProblemType()));
  692. keyRegPatam.setProblemType("");
  693. }
  694. if (StringUtils.isBlank(keyRegPatam.getOrderBy())) {
  695. keyRegPatam.setOrderBy("order by coll_time desc");
  696. }
  697. keyRegPatam.setPersId(getCurrentPersId());
  698. keyRegPatam.setOrgId(getCurrentOrgId());
  699. keyRegPatam.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  700. if (StringUtils.isBlank(keyRegPatam.getTabType())) {
  701. keyRegPatam.setTabType(CommonLabel.TAB_TYPE);
  702. String source = request.getHeader("source");
  703. if (StringUtils.isNotBlank(source)) {
  704. keyRegPatam.setTabType("0");
  705. }
  706. }
  707. String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
  708. keyRegPatam.setNowTime(nowTime);
  709. keyRegPatam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId())));
  710. PageInfo<KeyRegPblm> inspPblmList = bisInspPblmService.findKeyRegPlbmList(keyRegPatam);
  711. InspUtils.addLocsNew(inspPblmList);
  712. return buildSuccessResponse(inspPblmList);
  713. }
  714. @ApiOperation(value = "获取水闸问题列表-新")
  715. @RequestMapping(value = "/page/waga", method = RequestMethod.POST)
  716. public BaseResponse<PageInfo<BisInspPblm>> waga(@ApiParam(name = "wagaParam", value = "wagaParam", required = true) @RequestBody WagaParam wagaParam) {
  717. wagaParam.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  718. wagaParam.setPersId(getCurrentPersId());
  719. wagaParam.setOrgId(getCurrentOrgId());
  720. if (StringUtils.isBlank(wagaParam.getTabType())) {
  721. wagaParam.setTabType(CommonLabel.TAB_TYPE);
  722. }
  723. String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
  724. wagaParam.setNowTime(nowTime);
  725. wagaParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId())));
  726. PageInfo<BisInspPblm> inspPblmList = bisInspPblmService.findWagaPlbmList(wagaParam);
  727. InspUtils.addLocs(inspPblmList);
  728. return buildSuccessResponse(inspPblmList);
  729. }
  730. @ApiOperation(value = "通用问题导出xls")
  731. @RequestMapping(value = "/page/export", method = RequestMethod.POST)
  732. public void pblmExport(@ApiParam(name = "pblmParam", value = "pblmParam", required = true)
  733. @RequestBody PblmParam pblmParam, HttpServletResponse response) throws Exception {
  734. if (StringUtils.isBlank(pblmParam.getpType())) {
  735. throw new Exception("没有传类型");
  736. }
  737. pblmParam.setOrgId(getCurrentOrgId());
  738. pblmParam.setProvince(inspOrgService.getProvince(pblmParam.getOrgId()));
  739. bisInspPblmService.exportPblmForExcel(pblmParam, response);
  740. }
  741. @ApiOperation(value = "水闸导出问题列表-导出excel")
  742. @RequestMapping(value = "/page/waga/export", method = RequestMethod.POST)
  743. public void reverExport(@ApiParam(name = "wagaParam", value = "wagaParam", required = true) @RequestBody WagaParam wagaParam, HttpServletResponse response) {
  744. response.setContentType("application/binary;charset=UTF-8");
  745. String orgIds = InspUtils.setOrgIds(wagaParam.getOrgIds());
  746. wagaParam.setOrgIds(orgIds);
  747. wagaParam.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  748. wagaParam.setPersId(getCurrentPersId());
  749. wagaParam.setOrgId(getCurrentOrgId());
  750. wagaParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId())));
  751. List<BisInspPblm> pblmList = bisInspPblmDao.findWagaPlbmList(wagaParam);
  752. InspPblmUtils.Export(response, "waga", pblmList, "水闸名称");
  753. }
  754. @ApiOperation(value = "172工程导出问题列表-导出excel")
  755. @RequestMapping(value = "/page/keyReg/export", method = RequestMethod.POST)
  756. public void keyRegExport(@ApiParam(name = "wagaParam", value = "wagaParam", required = true) @RequestBody KeyRegPatam keyRegPatam, HttpServletResponse response) {
  757. response.setContentType("application/binary;charset=UTF-8");
  758. String orgIds = InspUtils.setOrgIds(keyRegPatam.getOrgIds());
  759. keyRegPatam.setOrgIds(orgIds);
  760. keyRegPatam.setPersId(getCurrentPersId());
  761. keyRegPatam.setOrgId(getCurrentOrgId());
  762. keyRegPatam.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  763. if (StringUtils.isBlank(keyRegPatam.getTabType())) {
  764. keyRegPatam.setTabType(CommonLabel.TAB_TYPE);
  765. }
  766. String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
  767. keyRegPatam.setNowTime(nowTime);
  768. keyRegPatam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId())));
  769. List<KeyRegPblm> pblmList = bisInspPblmDao.findKeyRegPlbmList(keyRegPatam);
  770. InspPblmUtils.ExportNew(response, "172", pblmList, "172重点工程");
  771. }
  772. @Autowired
  773. private BisInspPblmDao bisInspPblmDao;
  774. @ApiOperation(value = "问题清单导出xlsx")
  775. @RequestMapping(value = "/page/problemList/export", method = RequestMethod.POST)
  776. public void problemListExport(@ApiParam(name = "pblmParam", value = "pblmParam", required = true) @RequestBody PblmParam pblmParam, HttpServletResponse response) {
  777. response.setContentType("application/binary;charset=UTF-8");
  778. // 设置参数
  779. String orgIds = InspUtils.setOrgIds(pblmParam.getOrgIds());
  780. pblmParam.setOrgIds(orgIds);
  781. pblmParam.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  782. pblmParam.setPersId(getCurrentPersId());
  783. pblmParam.setOrgId(getCurrentOrgId());
  784. pblmParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId())));
  785. // 获取数据
  786. List<BisInspPblm> pblmList = bisInspPblmDao.findPblmList(pblmParam);
  787. // 导出问题清单
  788. InspPblmUtils.ExportProblemList(response, pblmList, "问题清单");
  789. }
  790. @ApiOperation(value = "人饮,水源地,行政村导出问题列表-导出excel")
  791. @RequestMapping(value = "/page/vill/export", method = RequestMethod.POST)
  792. public void villExport(@ApiParam(name = "reverParam", value = "reverParam", required = true) @RequestBody VillParam villParam, HttpServletResponse response) {
  793. response.setContentType("application/binary;charset=UTF-8");
  794. String orgIds = InspUtils.setOrgIds(villParam.getOrgIds());
  795. villParam.setOrgIds(orgIds);
  796. villParam.setOrgId(getCurrentOrgId());
  797. villParam.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  798. villParam.setPersId(getCurrentPersId());
  799. villParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId())));
  800. List<BisInspPblm> pblmList = bisInspPblmDao.findVillPlbmList(villParam);
  801. String name = "督查对象(区、县)";
  802. InspPblmUtils.Export(response, "vill", pblmList, name);
  803. }
  804. @ApiOperation(value = "小水库导出问题列表-导出excel")
  805. @RequestMapping(value = "/page/rever/export", method = RequestMethod.POST)
  806. public void reverExport(@ApiParam(name = "reverParam", value = "reverParam", required = true) @RequestBody ReverParam reverParam, HttpServletResponse response) {
  807. response.setContentType("application/binary;charset=UTF-8");
  808. String orgIds = InspUtils.setOrgIds(reverParam.getOrgIds());
  809. reverParam.setOrgIds(orgIds);
  810. reverParam.setOrgId(getCurrentOrgId());
  811. reverParam.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  812. reverParam.setPersId(getCurrentPersId());
  813. if (StringUtils.isBlank(reverParam.getTabType())) {
  814. reverParam.setTabType(CommonLabel.TAB_TYPE);
  815. }
  816. String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
  817. reverParam.setNowTime(nowTime);
  818. reverParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId())));
  819. List<BisInspPblm> pblmList = bisInspPblmDao.findReverPlbmList(reverParam);
  820. InspPblmUtils.Export(response, "rever", pblmList, "督查水库名称");
  821. }
  822. @ApiOperation(value = "水毁导出问题列表-导出excel")
  823. @RequestMapping(value = "/page/track/export", method = RequestMethod.POST)
  824. public void trackExport(@ApiParam(name = "reverParam", value = "reverParam", required = true) @RequestBody TrackParam trackParam, HttpServletResponse response) {
  825. response.setContentType("application/binary;charset=UTF-8");
  826. String orgIds = InspUtils.setOrgIds(trackParam.getOrgIds());
  827. trackParam.setOrgIds(orgIds);
  828. trackParam.setPersId(getCurrentPersId());
  829. trackParam.setOrgId(getCurrentOrgId());
  830. trackParam.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  831. if (StringUtils.isBlank(trackParam.getTabType())) {
  832. trackParam.setTabType(CommonLabel.TAB_TYPE);
  833. }
  834. String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
  835. trackParam.setNowTime(nowTime);
  836. trackParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId())));
  837. List<BisInspPblm> pblmList = bisInspPblmDao.findTrackPlbmList(trackParam);
  838. InspPblmUtils.Export(response, "track", pblmList, "督查水毁名称");
  839. }
  840. @ApiOperation(value = "获取人饮问题列表-新")
  841. @RequestMapping(value = "/page/vill", method = RequestMethod.POST)
  842. public BaseResponse<PageInfo<BisInspPblm>> rever(@ApiParam(name = "villParam", value = "villParam", required = true) @RequestBody VillParam villParam) {
  843. villParam.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  844. villParam.setPersId(getCurrentPersId());
  845. villParam.setOrgId(getCurrentOrgId());
  846. villParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId())));
  847. PageInfo<BisInspPblm> inspPblmList = bisInspPblmService.findVillPlbmList(villParam);
  848. InspUtils.addLocs(inspPblmList);
  849. return buildSuccessResponse(inspPblmList);
  850. }
  851. @ApiOperation(value = "获取水毁问题列表-新")
  852. @RequestMapping(value = "/page/track", method = RequestMethod.POST)
  853. public BaseResponse<PageInfo<BisInspPblm>> track(@ApiParam(name = "trackParam", value = "trackParam", required = true) @RequestBody TrackParam trackParam) {
  854. trackParam.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  855. trackParam.setPersId(getCurrentPersId());
  856. trackParam.setOrgId(getCurrentOrgId());
  857. if (StringUtils.isBlank(trackParam.getTabType())) {
  858. trackParam.setTabType(CommonLabel.TAB_TYPE);
  859. }
  860. String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
  861. trackParam.setNowTime(nowTime);
  862. trackParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId())));
  863. PageInfo<BisInspPblm> inspPblmList = bisInspPblmService.findTrackPlbmList(trackParam);
  864. InspUtils.addLocs(inspPblmList);
  865. return buildSuccessResponse(inspPblmList);
  866. }
  867. @ApiOperation(value = "地下水问题列表-新")
  868. @RequestMapping(value = "/page/grw", method = RequestMethod.POST)
  869. public BaseResponse<PageInfo<BisInspPblm>> underWater(@ApiParam(name = "waterParam", value = "waterParam", required = true) @RequestBody UnderWaterParam waterParam) {
  870. waterParam.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  871. waterParam.setPersId(getCurrentPersId());
  872. waterParam.setOrgId(getCurrentOrgId());
  873. if (StringUtils.isBlank(waterParam.getTabType())) {
  874. waterParam.setTabType(CommonLabel.TAB_TYPE);
  875. }
  876. String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
  877. waterParam.setNowTime(nowTime);
  878. waterParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId())));
  879. PageInfo<BisInspPblm> inspPblmList = bisInspPblmService.findWaterPlbmList(waterParam);
  880. InspUtils.addLocs(inspPblmList);
  881. return buildSuccessResponse(inspPblmList);
  882. }
  883. @ApiOperation(value = "地下水导出问题列表-导出excel")
  884. @RequestMapping(value = "/page/grw/export", method = RequestMethod.POST)
  885. public void grwExport(@ApiParam(name = "waterParam", value = "waterParam", required = true) @RequestBody UnderWaterParam waterParam, HttpServletResponse response) {
  886. response.setContentType("application/binary;charset=UTF-8");
  887. String orgIds = InspUtils.setOrgIds(waterParam.getOrgIds());
  888. waterParam.setOrgIds(orgIds);
  889. waterParam.setOrgId(getCurrentOrgId());
  890. waterParam.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  891. waterParam.setPersId(getCurrentPersId());
  892. if (StringUtils.isBlank(waterParam.getTabType())) {
  893. waterParam.setTabType(CommonLabel.TAB_TYPE);
  894. }
  895. String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
  896. waterParam.setNowTime(nowTime);
  897. waterParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId())));
  898. List<BisInspPblm> pblmList = bisInspPblmDao.findWaterPlbmList(waterParam);
  899. InspPblmUtils.Export(response, "grw", pblmList, "测站名称");
  900. }
  901. @ApiOperation(value = "获取列表(分页)")
  902. @RequestMapping(value = "/queryListByPage", method = {RequestMethod.GET, RequestMethod.POST})
  903. public BaseResponse<PageInfo<BisInspPblm>> queryListByPage(@RequestBody BisInspPblmParam param) {
  904. PageInfo<BisInspPblm> list = new PageInfo<>();
  905. try {
  906. param.setOrgId(getCurrentOrgId());
  907. param.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  908. param.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId())));
  909. list = bisInspPblmService.queryListByPage(param);
  910. } catch (Exception e) {
  911. e.printStackTrace();
  912. logger.error(e.getMessage());
  913. return buildFailResponse(e.getMessage());
  914. }
  915. return buildSuccessResponse(list);
  916. }
  917. @ApiOperation(value = "获取列表")
  918. @RequestMapping(value = "/queryList", method = {RequestMethod.GET, RequestMethod.POST})
  919. public BaseResponse<List<BisInspPblm>> queryList(@RequestBody BisInspPblmParam param) {
  920. List<BisInspPblm> list = new ArrayList<>();
  921. try {
  922. param.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  923. param.setOrgId(getCurrentOrgId());
  924. param.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId())));
  925. list = bisInspPblmService.queryList(param);
  926. } catch (Exception e) {
  927. e.printStackTrace();
  928. logger.error(e.getMessage());
  929. return buildFailResponse(e.getMessage());
  930. }
  931. return buildSuccessResponse(list);
  932. }
  933. @ApiOperation(value = "新增问题删除原因")
  934. @RequestMapping(value = "/insertPblmLog", method = RequestMethod.POST)
  935. public BaseResponse<BisInspPblmDelLog> insertPblmLog(@RequestBody BisInspPblmDelLogDto bisInspPblmDelLogDto) {
  936. bisInspPblmDelLogDto.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  937. try {
  938. BisInspPblmDelLog bisInspPblmDelLog = bisInspPblmService.insertPblmLog(bisInspPblmDelLogDto);
  939. return buildSuccessResponse(bisInspPblmDelLog);
  940. } catch (Exception e) {
  941. e.printStackTrace();
  942. logger.error(e.getMessage());
  943. }
  944. return buildFailResponse();
  945. }
  946. @ApiOperation(value = "获取淤地坝问题列表")
  947. @RequestMapping(value = "/page/sdPblm", method = RequestMethod.POST)
  948. public BaseResponse<PageInfo<BisInspPblm>> sdPblm(@ApiParam(name = "reverParam", value = "reverParam", required = true) @RequestBody SdPblmParam param) {
  949. param.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  950. param.setOrgId(getCurrentOrgId());
  951. if (StringUtils.isBlank(param.getTabType())) {
  952. param.setTabType(CommonLabel.TAB_TYPE);
  953. }
  954. String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
  955. param.setNowTime(nowTime);
  956. param.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId())));
  957. PageInfo<BisInspPblm> inspPblmList = bisInspPblmService.findSdPblmList(param);
  958. InspUtils.addLocs(inspPblmList);
  959. return buildSuccessResponse(inspPblmList);
  960. }
  961. @ApiOperation(value = "获取水源地问题列表")
  962. @RequestMapping(value = "/page/swhsPblm", method = RequestMethod.POST)
  963. public BaseResponse<PageInfo<BisInspPblm>> swhsPblm(@RequestBody PblmParam param) {
  964. param.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  965. param.setOrgId(getCurrentOrgId());
  966. if (StringUtils.isBlank(param.getTabType())) {
  967. param.setTabType(CommonLabel.TAB_TYPE);
  968. }
  969. String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
  970. param.setNowTime(nowTime);
  971. param.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId())));
  972. PageInfo<BisInspPblm> inspPblmList = bisInspPblmService.findPblmList(param);
  973. InspUtils.addLocs(inspPblmList);
  974. return buildSuccessResponse(inspPblmList);
  975. }
  976. @ApiOperation(value = "获取取用水户问题列表")
  977. @RequestMapping(value = "/page/wiuPblm", method = RequestMethod.POST)
  978. public BaseResponse<PageInfo<BisInspPblm>> wiuPblm(@RequestBody PblmParam param) {
  979. param.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  980. param.setOrgId(getCurrentOrgId());
  981. if (StringUtils.isBlank(param.getTabType())) {
  982. param.setTabType(CommonLabel.TAB_TYPE);
  983. }
  984. String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
  985. param.setNowTime(nowTime);
  986. param.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId())));
  987. PageInfo<BisInspPblm> inspPblmList = bisInspPblmService.findPblmList(param);
  988. InspUtils.addLocs(inspPblmList);
  989. return buildSuccessResponse(inspPblmList);
  990. }
  991. @ApiOperation(value = "获取取小水库标准化问题列表")
  992. @RequestMapping(value = "/page/stnd", method = RequestMethod.POST)
  993. public BaseResponse<PageInfo<BisInspPblm>> stndPblm(@RequestBody PblmParam param) {
  994. param.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  995. param.setOrgId(getCurrentOrgId());
  996. if (StringUtils.isBlank(param.getTabType())) {
  997. param.setTabType(CommonLabel.TAB_TYPE);
  998. }
  999. String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
  1000. param.setNowTime(nowTime);
  1001. param.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId())));
  1002. PageInfo<BisInspPblm> inspPblmList = bisInspPblmService.findPblmList(param);
  1003. InspUtils.addLocs(inspPblmList);
  1004. return buildSuccessResponse(inspPblmList);
  1005. }
  1006. @ApiOperation(value = "获取行政区划取水量问题列表")
  1007. @RequestMapping(value = "/page/cityPblm", method = RequestMethod.POST)
  1008. public BaseResponse<PageInfo<BisInspPblm>> cityPblm(@RequestBody PblmParam param) {
  1009. param.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  1010. param.setPersId(getCurrentPersId());
  1011. param.setOrgId(getCurrentOrgId());
  1012. if (StringUtils.isBlank(param.getTabType())) {
  1013. param.setTabType(CommonLabel.TAB_TYPE);
  1014. }
  1015. String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
  1016. param.setNowTime(nowTime);
  1017. param.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId())));
  1018. PageInfo<BisInspPblm> inspPblmList = bisInspPblmService.findPblmList(param);
  1019. InspUtils.addLocs(inspPblmList);
  1020. return buildSuccessResponse(inspPblmList);
  1021. }
  1022. @ApiOperation(value = "获取节水管理与评价督查问题列表")
  1023. @RequestMapping(value = "/page/svwtPblm", method = RequestMethod.POST)
  1024. public BaseResponse<PageInfo<BisInspPblm>> svwtPblm(@RequestBody PblmParam param) {
  1025. param.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  1026. param.setPersId(getCurrentPersId());
  1027. param.setOrgId(getCurrentOrgId());
  1028. if (StringUtils.isBlank(param.getTabType())) {
  1029. param.setTabType(CommonLabel.TAB_TYPE);
  1030. }
  1031. String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
  1032. param.setNowTime(nowTime);
  1033. param.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId())));
  1034. PageInfo<BisInspPblm> inspPblmList = bisInspPblmService.findPblmList(param);
  1035. InspUtils.addLocs(inspPblmList);
  1036. return buildSuccessResponse(inspPblmList);
  1037. }
  1038. @ApiOperation(value = "问题处理通用接口")
  1039. @RequestMapping(value = "/page/pblm", method = RequestMethod.POST)
  1040. public BaseResponse<PageInfo<BisInspPblm>> pblm(@RequestBody PblmParam param) {
  1041. if (StringUtils.isBlank(param.getpType())) {
  1042. throw new CheckException("pType为必传参数");
  1043. }
  1044. param.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  1045. param.setPersId(getCurrentPersId());
  1046. param.setOrgId(getCurrentOrgId());
  1047. if (StringUtils.isBlank(param.getTabType())) {
  1048. param.setTabType(CommonLabel.TAB_TYPE);
  1049. }
  1050. String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
  1051. param.setNowTime(nowTime);
  1052. param.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId())));
  1053. PageInfo<BisInspPblm> inspPblmList = bisInspPblmService.findPblmList(param);
  1054. InspUtils.addLocs(inspPblmList);
  1055. return buildSuccessResponse(inspPblmList);
  1056. }
  1057. @ApiOperation(value = "水保问题")
  1058. @RequestMapping(value = "/page/prdPblm", method = RequestMethod.POST)
  1059. public BaseResponse<PageInfo<BisInspPblm>> prdPblm(@RequestBody PblmParam param) {
  1060. param.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  1061. param.setpType("17");
  1062. param.setPersId(getCurrentPersId());
  1063. param.setOrgId(getCurrentOrgId());
  1064. if (StringUtils.isBlank(param.getTabType())) {
  1065. param.setTabType(CommonLabel.TAB_TYPE);
  1066. }
  1067. String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
  1068. param.setNowTime(nowTime);
  1069. param.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId())));
  1070. PageInfo<BisInspPblm> inspPblmList = bisInspPblmService.findPblmList(param);
  1071. InspUtils.addLocs(inspPblmList);
  1072. return buildSuccessResponse(inspPblmList);
  1073. }
  1074. @ApiOperation(value = "河湖四乱问题")
  1075. @RequestMapping(value = "/page/jsflPblm", method = RequestMethod.POST)
  1076. public BaseResponse<PageInfo<BisInspPblm>> jsflPblm(@RequestBody PblmParam param) {
  1077. param.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  1078. param.setpType("18");
  1079. param.setPersId(getCurrentPersId());
  1080. param.setOrgId(getCurrentOrgId());
  1081. if (StringUtils.isBlank(param.getTabType())) {
  1082. param.setTabType(CommonLabel.TAB_TYPE);
  1083. }
  1084. String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
  1085. param.setNowTime(nowTime);
  1086. param.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId())));
  1087. PageInfo<BisInspPblm> inspPblmList = bisInspPblmService.findPblmList(param);
  1088. InspUtils.addLocs(inspPblmList);
  1089. return buildSuccessResponse(inspPblmList);
  1090. }
  1091. @ApiOperation(value = "非法采砂问题")
  1092. @RequestMapping(value = "/page/jswaPblm", method = RequestMethod.POST)
  1093. public BaseResponse<PageInfo<BisInspPblm>> jswaPblm(@RequestBody PblmParam param) {
  1094. param.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  1095. param.setOrgId(getCurrentOrgId());
  1096. param.setpType("19");
  1097. param.setPersId(getCurrentPersId());
  1098. if (StringUtils.isBlank(param.getTabType())) {
  1099. param.setTabType(CommonLabel.TAB_TYPE);
  1100. }
  1101. String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
  1102. param.setNowTime(nowTime);
  1103. param.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId())));
  1104. PageInfo<BisInspPblm> inspPblmList = bisInspPblmService.findPblmList(param);
  1105. InspUtils.addLocs(inspPblmList);
  1106. return buildSuccessResponse(inspPblmList);
  1107. }
  1108. @ApiOperation(value = "节水载体复核")
  1109. @RequestMapping(value = "/page/jsztfh/export", method = RequestMethod.POST)
  1110. public void jsztfh(@RequestBody PblmParam param, HttpServletResponse response) {
  1111. response.setContentType("application/binary;charset=UTF-8");
  1112. String orgIds = InspUtils.setOrgIds(param.getOrgIds());
  1113. param.setOrgIds(orgIds);
  1114. param.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  1115. param.setPersId(getCurrentPersId());
  1116. param.setOrgId(getCurrentOrgId());
  1117. if (StringUtils.isBlank(param.getTabType())) {
  1118. param.setTabType(CommonLabel.TAB_TYPE);
  1119. }
  1120. String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
  1121. param.setNowTime(nowTime);
  1122. param.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId())));
  1123. List<BisInspPblm> pblmList = bisInspPblmDao.findPblmList(param);
  1124. String name = "对象名称";
  1125. InspPblmUtils.Export(response, "wtcrr", pblmList, name);
  1126. }
  1127. @ApiOperation(value = "取水许可管理复核")
  1128. @RequestMapping(value = "/page/qsxkglfh/export", method = RequestMethod.POST)
  1129. public void qsxkglfh(@RequestBody PblmParam param, HttpServletResponse response) {
  1130. response.setContentType("application/binary;charset=UTF-8");
  1131. String orgIds = InspUtils.setOrgIds(param.getOrgIds());
  1132. param.setOrgIds(orgIds);
  1133. param.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  1134. param.setPersId(getCurrentPersId());
  1135. param.setOrgId(getCurrentOrgId());
  1136. if (StringUtils.isBlank(param.getTabType())) {
  1137. param.setTabType(CommonLabel.TAB_TYPE);
  1138. }
  1139. String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
  1140. param.setNowTime(nowTime);
  1141. param.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId())));
  1142. List<BisInspPblm> pblmList = bisInspPblmDao.findPblmList(param);
  1143. String name = "对象名称";
  1144. InspPblmUtils.Export(response, "wtgt", pblmList, name);
  1145. }
  1146. @ApiOperation(value = "水资源管理及节水管理复核")
  1147. @RequestMapping(value = "/page/szygljsgl/export", method = RequestMethod.POST)
  1148. public void szygljsgl(@RequestBody PblmParam param, HttpServletResponse response) {
  1149. response.setContentType("application/binary;charset=UTF-8");
  1150. String orgIds = InspUtils.setOrgIds(param.getOrgIds());
  1151. param.setOrgIds(orgIds);
  1152. param.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  1153. param.setPersId(getCurrentPersId());
  1154. param.setOrgId(getCurrentOrgId());
  1155. if (StringUtils.isBlank(param.getTabType())) {
  1156. param.setTabType(CommonLabel.TAB_TYPE);
  1157. }
  1158. String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
  1159. param.setNowTime(nowTime);
  1160. param.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId())));
  1161. List<BisInspPblm> pblmList = bisInspPblmDao.findPblmList(param);
  1162. String name = "对象名称";
  1163. InspPblmUtils.Export(response, "wrws", pblmList, name);
  1164. }
  1165. @ApiOperation(value = "河湖四乱问题导出问题列表-导出excel")
  1166. @RequestMapping(value = "/page/jsflPblm/export", method = RequestMethod.POST)
  1167. public void jsflPblmExport(@ApiParam(name = "prdParam", value = "prdParam", required = true) @RequestBody PrdParam prdParam, HttpServletResponse response) {
  1168. response.setContentType("application/binary;charset=UTF-8");
  1169. String orgIds = InspUtils.setOrgIds(prdParam.getOrgIds());
  1170. prdParam.setOrgIds(orgIds);
  1171. prdParam.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  1172. prdParam.setPersId(getCurrentPersId());
  1173. prdParam.setOrgId(getCurrentOrgId());
  1174. if (StringUtils.isBlank(prdParam.getTabType())) {
  1175. prdParam.setTabType(CommonLabel.TAB_TYPE);
  1176. }
  1177. String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
  1178. prdParam.setNowTime(nowTime);
  1179. prdParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId())));
  1180. List<BisInspPblm> pblmList = bisInspPblmDao.findJsflPlbmList(prdParam);
  1181. String name = "河湖四乱";
  1182. InspPblmUtils.Export(response, "jsfl", pblmList, name);
  1183. }
  1184. @ApiOperation(value = "非法采砂导出问题列表-导出excel")
  1185. @RequestMapping(value = "/page/jswaPblm/export", method = RequestMethod.POST)
  1186. public void jswaPblmExport(@ApiParam(name = "prdParam", value = "prdParam", required = true) @RequestBody PrdParam prdParam, HttpServletResponse response) {
  1187. response.setContentType("application/binary;charset=UTF-8");
  1188. String orgIds = InspUtils.setOrgIds(prdParam.getOrgIds());
  1189. prdParam.setOrgIds(orgIds);
  1190. prdParam.setOrgId(getCurrentOrgId());
  1191. prdParam.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  1192. prdParam.setPersId(getCurrentPersId());
  1193. if (StringUtils.isBlank(prdParam.getTabType())) {
  1194. prdParam.setTabType(CommonLabel.TAB_TYPE);
  1195. }
  1196. String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
  1197. prdParam.setNowTime(nowTime);
  1198. prdParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId())));
  1199. List<BisInspPblm> pblmList = bisInspPblmDao.findJswaPlbmList(prdParam);
  1200. String name = "非法采砂";
  1201. InspPblmUtils.Export(response, "jswa", pblmList, name);
  1202. }
  1203. @ApiOperation(value = "水保督查导出问题列表-导出excel")
  1204. @RequestMapping(value = "/page/prdPblm/export", method = RequestMethod.POST)
  1205. public void prdPblmExport(@ApiParam(name = "prdParam", value = "prdParam", required = true) @RequestBody PrdParam prdParam, HttpServletResponse response) {
  1206. response.setContentType("application/binary;charset=UTF-8");
  1207. String orgIds = InspUtils.setOrgIds(prdParam.getOrgIds());
  1208. prdParam.setOrgIds(orgIds);
  1209. prdParam.setOrgId(getCurrentOrgId());
  1210. prdParam.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  1211. prdParam.setPersId(getCurrentPersId());
  1212. if (StringUtils.isBlank(prdParam.getTabType())) {
  1213. prdParam.setTabType(CommonLabel.TAB_TYPE);
  1214. }
  1215. String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
  1216. prdParam.setNowTime(nowTime);
  1217. prdParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId())));
  1218. List<BisInspPblm> pblmList = bisInspPblmDao.findPrdPlbmList(prdParam);
  1219. String name = "水保工作核实";
  1220. InspPblmUtils.Export(response, "prd", pblmList, name);
  1221. }
  1222. @ApiOperation(value = "百日攻坚(中央环保督查)问题")
  1223. @RequestMapping(value = "/page/ecofrdPblm", method = RequestMethod.POST)
  1224. public BaseResponse<PageInfo<BisInspPblm>> ecofrdPblm(@RequestBody PblmParam param) {
  1225. param.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  1226. param.setpType("20");
  1227. param.setOrgId(getCurrentOrgId());
  1228. param.setPersId(getCurrentPersId());
  1229. if (StringUtils.isBlank(param.getTabType())) {
  1230. param.setTabType(CommonLabel.TAB_TYPE);
  1231. }
  1232. String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
  1233. param.setNowTime(nowTime);
  1234. param.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId())));
  1235. PageInfo<BisInspPblm> inspPblmList = bisInspPblmService.findPblmList(param);
  1236. InspUtils.addLocs(inspPblmList);
  1237. return buildSuccessResponse(inspPblmList);
  1238. }
  1239. @ApiOperation(value = "百日攻坚(中央环保督查)导出问题列表-导出excel")
  1240. @RequestMapping(value = "/page/ecofrdPblm/export", method = RequestMethod.POST)
  1241. public void ecofrdPblm(@ApiParam(name = "prdParam", value = "prdParam", required = true) @RequestBody PrdParam prdParam, HttpServletResponse response) {
  1242. response.setContentType("application/binary;charset=UTF-8");
  1243. String orgIds = InspUtils.setOrgIds(prdParam.getOrgIds());
  1244. prdParam.setOrgIds(orgIds);
  1245. prdParam.setOrgId(getCurrentOrgId());
  1246. prdParam.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  1247. prdParam.setPersId(getCurrentPersId());
  1248. if (StringUtils.isBlank(prdParam.getTabType())) {
  1249. prdParam.setTabType(CommonLabel.TAB_TYPE);
  1250. }
  1251. String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
  1252. prdParam.setNowTime(nowTime);
  1253. prdParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId())));
  1254. List<BisInspPblm> pblmList = bisInspPblmDao.findEcofrdPlbmList(prdParam);
  1255. String name = "中央环保督查问题";
  1256. InspPblmUtils.Export(response, "ecofrd", pblmList, name);
  1257. }
  1258. @Autowired
  1259. private BisBisRdwspRgstrFeeService bisBisRdwspRgstrFeeService;
  1260. @ApiOperation(value = "获取回头看,villType传1,2,3多个用逗号分隔")
  1261. @RequestMapping(value = "/page/rdwsp", method = RequestMethod.POST)
  1262. public BaseResponse<PageInfo<BisInspPblm>> rdwsp(@ApiParam(name = "pblmParam", value = "pblmParam", required = true) @RequestBody PlbmParam pblmParam) {
  1263. pblmParam.setPresId(getCurrentPersId());
  1264. PageInfo<BisInspPblm> inspPblmList = bisBisRdwspRgstrFeeService.findPageList(pblmParam);
  1265. InspUtils.addLocs(inspPblmList);
  1266. return buildSuccessResponse(inspPblmList);
  1267. }
  1268. @ApiOperation(value = "根据督查组id获取需要督查问题列表,分页")
  1269. @RequestMapping(value = "/pageHaveFilePath", method = RequestMethod.POST)
  1270. public BaseResponse<PageInfo<BisInspPblm>> pageHaveFilePath(@ApiParam(name = "bisInspPblm", value = "BisInspPblm", required = true)
  1271. @RequestBody PlbmParam pblmParam, HttpServletRequest request) {
  1272. pblmParam.setProvince(inspOrgService.getProvince(getCurrentOrgId()));
  1273. pblmParam.setOrgId(getCurrentOrgId());
  1274. if (StringUtils.isBlank(pblmParam.getTabType())) {
  1275. pblmParam.setTabType(CommonLabel.TAB_TYPE);
  1276. String source = request.getHeader("source");
  1277. if (StringUtils.isNotBlank(source)) {
  1278. pblmParam.setTabType("0");
  1279. }
  1280. }
  1281. String nowTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
  1282. String nowYear = new SimpleDateFormat("yyyy").format(new Date());
  1283. String nowMonth = new SimpleDateFormat("yyyy-MM").format(new Date());
  1284. pblmParam.setNowMonth(nowMonth);
  1285. pblmParam.setNowYear(nowYear);
  1286. pblmParam.setNowTime(nowTime);
  1287. pblmParam.setInIdsSql(SqlUtils.getinIdsSql(getCurrentPersId(), olBisInspOrgService.getProvince(getCurrentOrgId())));
  1288. PageInfo<BisInspPblm> inspPblmList = new PageInfo<>();
  1289. if (BisInspEnum.VILL2020.getValue().equals(pblmParam.getObjType())) {
  1290. inspPblmList = bisNewVillRgstrService.findPageList(pblmParam);
  1291. } else if (BisInspEnum.VILLZHEJIANG.getValue().equals(pblmParam.getObjType())) {
  1292. inspPblmList = bisZhejiangVillRgstrService.findPageList(pblmParam);
  1293. } else if (BisInspEnum.MFDP.getValue().equals(pblmParam.getObjType())) {
  1294. inspPblmList = bisInspMfdpRgstrService.findPblmPage(pblmParam);
  1295. } else {
  1296. inspPblmList = bisInspPblmService.findPageList(pblmParam);
  1297. }
  1298. List<BisInspPblm> list = inspPblmList.getList();
  1299. for (BisInspPblm bisInspPblm : list) {
  1300. List<String> pathList = bisInspPblmService.getPblmPath(bisInspPblm.getPblmId());
  1301. bisInspPblm.setFilePath(pathList);
  1302. }
  1303. PageInfo<BisInspPblm> bisInspPblmList = new PageInfo<>(list);
  1304. return buildSuccessResponse(bisInspPblmList);
  1305. }
  1306. @ApiOperation(value = "问题汇总功能增加外部问题导入 ")
  1307. @PostMapping("/page/import")
  1308. public BaseResponse<String> pblmImport(@RequestParam("file") MultipartFile f) {
  1309. try {
  1310. bisInspPblmService.excelImport(f, getCurrentPersId());
  1311. } catch (Exception e) {
  1312. logger.error(e.getMessage());
  1313. }
  1314. return buildSuccessResponse();
  1315. }
  1316. @ApiOperation(value = "excel导入问题查询")
  1317. @PostMapping("/page/getImport")
  1318. public BaseResponse<PageInfo<BisInspPblm>> getPblmListFromImport(@ApiParam(name = "PblmParam", value = "PblmParam", required = true) @RequestBody PblmParam param) {
  1319. param.setProvince(AdLevelUtil.getAddvcd(olBisInspOrgService.getRlProvince(getCurrentOrgId())));
  1320. param.setOrgId(getCurrentOrgId());
  1321. List<BisInspPblm> pblmListFromImport = bisInspPblmService.getPblmListFromImport(param);
  1322. PageInfo<BisInspPblm> bisInspPblmList = new PageInfo<>(pblmListFromImport);
  1323. return buildSuccessResponse(bisInspPblmList);
  1324. }
  1325. @ApiOperation(value = "批量逻辑删除导入问题查询")
  1326. @PostMapping("/batch/delete")
  1327. public void batchDelete(@ApiParam(name = "PblmParam", value = "PblmParam", required = true) @RequestBody List<PblmParam> param) {
  1328. bisInspPblmService.batchDelete(param);
  1329. }
  1330. @Value("${export.templatePath}")
  1331. String excelFilePath;
  1332. @ApiOperation(value = "下载Excel导入模板")
  1333. @GetMapping("/page/downloadExcel")
  1334. public void downExcelModel(HttpServletResponse response) throws Exception {
  1335. InputStream inStream = new FileInputStream(excelFilePath + "/importPblm.xlsx");
  1336. response.reset();
  1337. response.setContentType("application/octet-stream; charset=UTF-8");
  1338. response.setCharacterEncoding("utf-8");
  1339. response.addHeader("Content-Disposition", "attachment; filename=" + URLEncoder.encode("问题导入模板.xlsx", "UTF-8"));
  1340. byte[] b = new byte[4096];
  1341. int len;
  1342. try {
  1343. while ((len = inStream.read(b)) > 0)
  1344. response.getOutputStream().write(b, 0, len);
  1345. inStream.close();
  1346. } catch (IOException e) {
  1347. e.printStackTrace();
  1348. }
  1349. }
  1350. @ApiOperation(value = "128导出问题列表-导出excel")
  1351. @RequestMapping(value = "/genrl/export", method = RequestMethod.POST)
  1352. public void genrlExport(@ApiParam(name = "reverParam", value = "reverParam", required = true) @RequestBody ReverParam reverParam, HttpServletResponse response) {
  1353. reverParam.setPageNum(1);
  1354. reverParam.setPageSize(1000000);
  1355. BaseResponse<PageInfo<BisInspPblm>> response1 = rever(reverParam);
  1356. List<BisInspPblm> pblmList = response1.getData().getList();
  1357. response.setContentType("application/binary;charset=UTF-8");
  1358. InspPblmUtils.ExportProblemList(response, pblmList, "问题列表");
  1359. }
  1360. }