08948ac1b5ab72c6debab073885ce08bd0058d68.svn-base 79 KB

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