|
@@ -2,16 +2,10 @@ 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.dto.*;
|
|
|
+import com.welampiot.service.*;
|
|
|
import com.welampiot.utils.ToolUtils;
|
|
|
-import com.welampiot.vo.CityAdminAreaVO;
|
|
|
-import com.welampiot.vo.CityAdminCaseInfoVO;
|
|
|
-import com.welampiot.vo.CityAdminCaseItemVO;
|
|
|
+import com.welampiot.vo.*;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.CrossOrigin;
|
|
@@ -19,6 +13,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
@@ -42,6 +37,12 @@ public class CityAdminCaseController {
|
|
|
private CityAdminCaseItemService cityAdminCaseItemService;
|
|
|
@Autowired
|
|
|
private CityAdminAreaService cityAdminAreaService;
|
|
|
+ @Autowired
|
|
|
+ private UserService userService;
|
|
|
+ @Autowired
|
|
|
+ private CityAdminCaseLogService cityAdminCaseLogService;
|
|
|
+ @Autowired
|
|
|
+ private CityAdminCaseImageService cityAdminCaseImageService;
|
|
|
|
|
|
/**
|
|
|
* 城管系统添加编辑案件
|
|
@@ -140,10 +141,159 @@ public class CityAdminCaseController {
|
|
|
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());
|
|
|
+ return toolUtils.response(InterfaceResultEnum.LACK_PARAM_ERROR, version);
|
|
|
List<CityAdminAreaDTO> list = cityAdminAreaService.getCityAdminStreetNavList(vo.getAreaId());
|
|
|
CityAdminAreaVO cityAdminAreaVO = new CityAdminAreaVO();
|
|
|
cityAdminAreaVO.setList(list);
|
|
|
return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,cityAdminAreaVO);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 城管系统案件详情
|
|
|
+ * @param vo id
|
|
|
+ * @return 案件详情
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/caseInfo", method = RequestMethod.POST)
|
|
|
+ public BaseResult<?> caseInfo(CityAdminCaseInfoVO vo) {
|
|
|
+ if (vo.getVersion() == null) vo.setVersion(0);
|
|
|
+ Integer version = vo.getVersion();
|
|
|
+ Integer id = vo.getId();
|
|
|
+ if (id == null || id == 0) return toolUtils.response(InterfaceResultEnum.LACK_PARAM_ERROR, version);
|
|
|
+ CityAdminCaseInfoDTO dto = cityAdminCaseInfoService.getCityAdminCaseInfoDetailsById(id);
|
|
|
+ if (dto == null) return toolUtils.response(InterfaceResultEnum.PARAM_FAIL,version);
|
|
|
+ CityAdminCaseInfoVO cityAdminCaseInfoVO = new CityAdminCaseInfoVO();
|
|
|
+ BeanUtils.copyProperties(dto,cityAdminCaseInfoVO);
|
|
|
+ return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,cityAdminCaseInfoVO);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 城管系统案件信息列表
|
|
|
+ * @param vo 案件状态(0 新建,1 立案,2 处置中,3 处置结束,4 待复核,5 已复核,6 结案)
|
|
|
+ * @return 案件信息列表
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/caseList", method = RequestMethod.POST)
|
|
|
+ public BaseResult<?> caseList(CityAdminCaseInfoVO vo) {
|
|
|
+ if (vo.getVersion() == null) vo.setVersion(0);
|
|
|
+ Integer version = vo.getVersion();
|
|
|
+ Integer status = vo.getStatus();
|
|
|
+ List<CityAdminCaseInfoDTO> list = cityAdminCaseInfoService.getCityAdminCaseInfoList(status);
|
|
|
+ CityAdminCaseInfoVO cityAdminCaseInfoVO = new CityAdminCaseInfoVO();
|
|
|
+ cityAdminCaseInfoVO.setList(list);
|
|
|
+ return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,cityAdminCaseInfoVO);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 城管系统设置案件状态
|
|
|
+ * @param vo status
|
|
|
+ * @return 设置案件状态
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/setStatus", method = RequestMethod.POST)
|
|
|
+ public BaseResult<?> setStatus(CityAdminCaseInfoVO vo) {
|
|
|
+ if (vo.getVersion() == null) vo.setVersion(0);
|
|
|
+ Integer version = vo.getVersion();
|
|
|
+ String username = vo.getUsername();
|
|
|
+ if (username == null || username.isEmpty()) return toolUtils.response(InterfaceResultEnum.LACK_PARAM_ERROR, version);
|
|
|
+ Integer status = vo.getStatus();
|
|
|
+ String caseId = vo.getCaseId();
|
|
|
+ if (status == null || caseId == null || caseId.isEmpty()) return toolUtils.response(InterfaceResultEnum.LACK_PARAM_ERROR,version);
|
|
|
+
|
|
|
+ Integer cityAdminId = vo.getCityAdminId();
|
|
|
+ Integer seatsId1 = vo.getSeatsId1();
|
|
|
+ Integer inspectorId = vo.getInspectorId();
|
|
|
+ Integer seatsId2 = vo.getSeatsId2();
|
|
|
+ if (status == 2 && (cityAdminId == null || cityAdminId == 0)) return toolUtils.response(InterfaceResultEnum.LACK_PARAM_ERROR,version);
|
|
|
+ if (status == 3 && (seatsId1 == null || seatsId1 == 0)) return toolUtils.response(InterfaceResultEnum.LACK_PARAM_ERROR,version);
|
|
|
+ if (status == 4 && (inspectorId == null || inspectorId == 0)) return toolUtils.response(InterfaceResultEnum.LACK_PARAM_ERROR,version);
|
|
|
+ if (status == 5 && (seatsId2 == null || seatsId2 == 0)) return toolUtils.response(InterfaceResultEnum.LACK_PARAM_ERROR,version);
|
|
|
+
|
|
|
+ CityAdminCaseInfoDTO dto = new CityAdminCaseInfoDTO();
|
|
|
+ BeanUtils.copyProperties(vo,dto);
|
|
|
+ String[] ids = caseId.split(",");
|
|
|
+ UserDTO userDTO = userService.queryUserIdByUsername(username);
|
|
|
+ if (userDTO == null) return toolUtils.response(InterfaceResultEnum.PARAM_FAIL,version);
|
|
|
+ SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
+ CityAdminCaseLogDTO logDTO = new CityAdminCaseLogDTO();
|
|
|
+ BeanUtils.copyProperties(vo,logDTO);
|
|
|
+ logDTO.setUserid(userDTO.getId());
|
|
|
+ for (String s : ids) {
|
|
|
+ Integer id = Integer.valueOf(s);
|
|
|
+ dto.setId(id);
|
|
|
+ cityAdminCaseInfoService.updateCityAdminCaseStatus(dto);
|
|
|
+ long timeMillis = System.currentTimeMillis();
|
|
|
+ String createTime = format.format(timeMillis);
|
|
|
+ logDTO.setCaseId(id);
|
|
|
+ logDTO.setCreateTime(createTime);
|
|
|
+ cityAdminCaseLogService.addCityAdminCaseLogData(logDTO);
|
|
|
+ }
|
|
|
+ return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 城管系统取消案件受理
|
|
|
+ * @param vo id
|
|
|
+ * @return 取消案件受理
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/cancelCase", method = RequestMethod.POST)
|
|
|
+ public BaseResult<?> cancelCase(CityAdminCaseInfoVO vo) {
|
|
|
+ if (vo.getVersion() == null) vo.setVersion(0);
|
|
|
+ Integer version = vo.getVersion();
|
|
|
+ Integer id = vo.getId();
|
|
|
+ if (id == null || id == 0) return toolUtils.response(InterfaceResultEnum.LACK_PARAM_ERROR,version);
|
|
|
+ CityAdminCaseInfoDTO dto = new CityAdminCaseInfoDTO();
|
|
|
+ dto.setId(id);
|
|
|
+ dto.setVoild(1);
|
|
|
+ cityAdminCaseInfoService.updateCaseIsCancel(dto);
|
|
|
+ return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 城管系统账户下拉
|
|
|
+ * @param vo 账户类型(1 巡查员,2 坐席,3 城管或相关单位,4 网络巡查员)
|
|
|
+ * @return 账户下拉
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/userNav", method = RequestMethod.POST)
|
|
|
+ public BaseResult<?> userNav(CityAdminCaseInfoVO vo) {
|
|
|
+ if (vo.getVersion() == null) vo.setVersion(0);
|
|
|
+ Integer version = vo.getVersion();
|
|
|
+ Integer type = vo.getType();
|
|
|
+ if (type == null) return toolUtils.response(InterfaceResultEnum.LACK_PARAM_ERROR,version);
|
|
|
+ List<UserDTO> cityAdminUserNavList = userService.getCityAdminUserNavList(type);
|
|
|
+ UserVO userVO = new UserVO();
|
|
|
+ userVO.setList(cityAdminUserNavList);
|
|
|
+ return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,userVO);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 城管系统案件处理日志
|
|
|
+ * @param vo 账户类型(1 巡查员,2 坐席,3 城管或相关单位,4 网络巡查员)
|
|
|
+ * @return 案件处理日志
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/caseLog", method = RequestMethod.POST)
|
|
|
+ public BaseResult<?> caseLog(CityAdminCaseInfoVO vo) {
|
|
|
+ if (vo.getVersion() == null) vo.setVersion(0);
|
|
|
+ Integer version = vo.getVersion();
|
|
|
+ Integer id = vo.getId();
|
|
|
+ if (id == null || id == 0) return toolUtils.response(InterfaceResultEnum.LACK_PARAM_ERROR,version);
|
|
|
+ List<CityAdminCaseLogDTO> list = cityAdminCaseLogService.getCaseLogListByCaseId(id);
|
|
|
+ CityAdminCaseLogVO cityAdminCaseLogVO = new CityAdminCaseLogVO();
|
|
|
+ cityAdminCaseLogVO.setList(list);
|
|
|
+ return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,cityAdminCaseLogVO);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 城管系统图片信息列表
|
|
|
+ * @param vo 案件id
|
|
|
+ * @return 图片信息列表
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/caseImageList", method = RequestMethod.POST)
|
|
|
+ public BaseResult<?> caseImageList(CityAdminCaseInfoVO vo) {
|
|
|
+ if (vo.getVersion() == null) vo.setVersion(0);
|
|
|
+ Integer version = vo.getVersion();
|
|
|
+ Integer id = vo.getId();
|
|
|
+ if (id == null || id == 0) return toolUtils.response(InterfaceResultEnum.LACK_PARAM_ERROR,version);
|
|
|
+ List<CityAdminCaseImageDTO> list = cityAdminCaseImageService.getCityAdminCaseImageByCaseId(id);
|
|
|
+ CityAdminCaseImageVO cityAdminCaseImageVO = new CityAdminCaseImageVO();
|
|
|
+ cityAdminCaseImageVO.setList(list);
|
|
|
+ return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,cityAdminCaseImageVO);
|
|
|
+ }
|
|
|
}
|