|
@@ -0,0 +1,149 @@
|
|
|
+package com.welampiot.controller;
|
|
|
+
|
|
|
+import com.welampiot.common.BaseResult;
|
|
|
+import com.welampiot.common.InterfaceResultEnum;
|
|
|
+import com.welampiot.dto.CityAdminAreaDTO;
|
|
|
+import com.welampiot.dto.CityAdminCaseInfoDTO;
|
|
|
+import com.welampiot.dto.CityAdminCaseItemDTO;
|
|
|
+import com.welampiot.service.CityAdminAreaService;
|
|
|
+import com.welampiot.service.CityAdminCaseInfoService;
|
|
|
+import com.welampiot.service.CityAdminCaseItemService;
|
|
|
+import com.welampiot.utils.ToolUtils;
|
|
|
+import com.welampiot.vo.CityAdminAreaVO;
|
|
|
+import com.welampiot.vo.CityAdminCaseInfoVO;
|
|
|
+import com.welampiot.vo.CityAdminCaseItemVO;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.CrossOrigin;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * ClassName: CityAdminCaseController
|
|
|
+ * Package: com.welampiot.controller
|
|
|
+ * Description:
|
|
|
+ *
|
|
|
+ * @Author: zhj_Start
|
|
|
+ * @Create: 2023/9/14 - 16:15
|
|
|
+ * @Version: v1.0
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@CrossOrigin
|
|
|
+@RequestMapping("/cityAdminCase")
|
|
|
+public class CityAdminCaseController {
|
|
|
+ @Autowired
|
|
|
+ private ToolUtils toolUtils;
|
|
|
+ @Autowired
|
|
|
+ private CityAdminCaseInfoService cityAdminCaseInfoService;
|
|
|
+ @Autowired
|
|
|
+ private CityAdminCaseItemService cityAdminCaseItemService;
|
|
|
+ @Autowired
|
|
|
+ private CityAdminAreaService cityAdminAreaService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 城管系统添加编辑案件
|
|
|
+ * @param vo 案件信息
|
|
|
+ * @return 添加编辑案件
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/saveCase", method = RequestMethod.POST)
|
|
|
+ public BaseResult<?> saveCase(CityAdminCaseInfoVO vo) {
|
|
|
+ if (vo.getVersion() == null) vo.setVersion(0);
|
|
|
+ Integer version = vo.getVersion();
|
|
|
+ if (vo.getRemark() == null || vo.getRemark().isEmpty())
|
|
|
+ return toolUtils.response(InterfaceResultEnum.LACK_REMARK_PROBLEM_ERROR,version);
|
|
|
+ if (vo.getProblemSource() == null)
|
|
|
+ return toolUtils.response(InterfaceResultEnum.LACK_PROBLEM_SOURCE_ERROR,version);
|
|
|
+ if (vo.getProblemLevel() == null)
|
|
|
+ return toolUtils.response(InterfaceResultEnum.LACK_PROBLEM_LEVEL_ERROR,version);
|
|
|
+ if (vo.getCaseBigId() == null || vo.getCaseBigId() == 0)
|
|
|
+ return toolUtils.response(InterfaceResultEnum.LACK_BIG_CASE_ERROR,version);
|
|
|
+ if (vo.getCaseSmallId() == null || vo.getCaseSmallId() == 0)
|
|
|
+ return toolUtils.response(InterfaceResultEnum.LACK_SMALL_CASE_ERROR,version);
|
|
|
+ if (vo.getAreaId() == null || vo.getAreaId() == 0)
|
|
|
+ return toolUtils.response(InterfaceResultEnum.LACK_AREA_ERROR,version);
|
|
|
+ if (vo.getStreetId() == null || vo.getStreetId() == 0)
|
|
|
+ return toolUtils.response(InterfaceResultEnum.LACK_STREET_ERROR,version);
|
|
|
+ if (vo.getLocation() == null || vo.getLocation().trim().isEmpty())
|
|
|
+ return toolUtils.response(InterfaceResultEnum.LACK_LOCATION_INFO_ERROR,version);
|
|
|
+
|
|
|
+ CityAdminCaseInfoDTO cityAdminCaseInfoDTO = new CityAdminCaseInfoDTO();
|
|
|
+ BeanUtils.copyProperties(vo,cityAdminCaseInfoDTO);
|
|
|
+ CityAdminCaseInfoVO cityAdminCaseInfoVO = new CityAdminCaseInfoVO();
|
|
|
+ if (vo.getId() == 0 || vo.getId() == null) { // 添加
|
|
|
+ cityAdminCaseInfoService.addCityAdminCaseInfoData(cityAdminCaseInfoDTO);
|
|
|
+ Integer id = cityAdminCaseInfoDTO.getId();
|
|
|
+ cityAdminCaseInfoVO.setId(id);
|
|
|
+ } else { // 编辑
|
|
|
+ cityAdminCaseInfoService.updateCityAdminCaseInfoData(cityAdminCaseInfoDTO);
|
|
|
+ cityAdminCaseInfoVO.setId(vo.getId());
|
|
|
+ }
|
|
|
+ return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,cityAdminCaseInfoVO);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 城管系统案件大类下拉
|
|
|
+ * @param vo version
|
|
|
+ * @return 案件大类下拉
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/caseBigNav", method = RequestMethod.POST)
|
|
|
+ public BaseResult<?> caseBigNav(CityAdminCaseItemVO vo) {
|
|
|
+ if (vo.getVersion() == null) vo.setVersion(0);
|
|
|
+ Integer version = vo.getVersion();
|
|
|
+ List<CityAdminCaseItemDTO> bigCaseNavList = cityAdminCaseItemService.getBigCaseNavList();
|
|
|
+ CityAdminCaseItemVO cityAdminCaseItemVO = new CityAdminCaseItemVO();
|
|
|
+ cityAdminCaseItemVO.setList(bigCaseNavList);
|
|
|
+ return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,cityAdminCaseItemVO);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 城管系统案件小类下拉
|
|
|
+ * @param vo 案件大类id
|
|
|
+ * @return 案件小类下拉
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/caseSmallNav", method = RequestMethod.POST)
|
|
|
+ public BaseResult<?> caseSmallNav(CityAdminCaseItemVO vo) {
|
|
|
+ if (vo.getVersion() == null) vo.setVersion(0);
|
|
|
+ Integer version = vo.getVersion();
|
|
|
+ if (vo.getBigId() == null || vo.getBigId() == 0)
|
|
|
+ return toolUtils.response(InterfaceResultEnum.LACK_PARAM_ERROR, version);
|
|
|
+ List<CityAdminCaseItemDTO> list = cityAdminCaseItemService.getSmallCaseNavListByBigId(vo.getBigId());
|
|
|
+ CityAdminCaseItemVO cityAdminCaseItemVO = new CityAdminCaseItemVO();
|
|
|
+ cityAdminCaseItemVO.setList(list);
|
|
|
+ return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,cityAdminCaseItemVO);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 城管系统区域下拉
|
|
|
+ * @param vo version
|
|
|
+ * @return 区域下拉
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/areaNav", method = RequestMethod.POST)
|
|
|
+ public BaseResult<?> areaNav(CityAdminAreaVO vo) {
|
|
|
+ if (vo.getVersion() == null) vo.setVersion(0);
|
|
|
+ Integer version = vo.getVersion();
|
|
|
+ List<CityAdminAreaDTO> bigCaseNavList = cityAdminAreaService.getCityAdminAreaNavList();
|
|
|
+ CityAdminAreaVO cityAdminAreaVO = new CityAdminAreaVO();
|
|
|
+ cityAdminAreaVO.setList(bigCaseNavList);
|
|
|
+ return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,cityAdminAreaVO);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 城管系统街道下拉
|
|
|
+ * @param vo 区域id
|
|
|
+ * @return 街道下拉
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/streetNav", method = RequestMethod.POST)
|
|
|
+ public BaseResult<?> streetNav(CityAdminAreaVO vo) {
|
|
|
+ if (vo.getVersion() == null) vo.setVersion(0);
|
|
|
+ Integer version = vo.getVersion();
|
|
|
+ if (vo.getAreaId() == null || vo.getAreaId() == 0)
|
|
|
+ return toolUtils.response(InterfaceResultEnum.LACK_PARAM_ERROR, vo.getVersion());
|
|
|
+ List<CityAdminAreaDTO> list = cityAdminAreaService.getCityAdminStreetNavList(vo.getAreaId());
|
|
|
+ CityAdminAreaVO cityAdminAreaVO = new CityAdminAreaVO();
|
|
|
+ cityAdminAreaVO.setList(list);
|
|
|
+ return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,cityAdminAreaVO);
|
|
|
+ }
|
|
|
+}
|