Commit 93d8dffcc4fd8396faae7b16c9b8d9d0d14f824b
1 parent
661fb412
pda
Showing
1 changed file
with
44 additions
and
53 deletions
src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/devicemanagement/PdaController.java
| @@ -27,6 +27,7 @@ import com.zteits.clouds.api.apibase.constants.ErrorType; | @@ -27,6 +27,7 @@ import com.zteits.clouds.api.apibase.constants.ErrorType; | ||
| 27 | import com.zteits.clouds.api.apibase.exception.BizException; | 27 | import com.zteits.clouds.api.apibase.exception.BizException; |
| 28 | import com.zteits.clouds.api.dto.park.dto.TpPPdaDTO; | 28 | import com.zteits.clouds.api.dto.park.dto.TpPPdaDTO; |
| 29 | import com.zteits.clouds.api.dto.park.dto.TpPTgsPassedcarDTO; | 29 | import com.zteits.clouds.api.dto.park.dto.TpPTgsPassedcarDTO; |
| 30 | +import com.zteits.clouds.api.dto.park.param.TpPPdaDeleteRequest; | ||
| 30 | import com.zteits.clouds.api.dto.park.param.TpPPdaPageQueryRequest; | 31 | import com.zteits.clouds.api.dto.park.param.TpPPdaPageQueryRequest; |
| 31 | import com.zteits.clouds.api.dto.park.param.TpPPdaRequest; | 32 | import com.zteits.clouds.api.dto.park.param.TpPPdaRequest; |
| 32 | import com.zteits.clouds.api.dto.park.param.TpPPdaSRequest; | 33 | import com.zteits.clouds.api.dto.park.param.TpPPdaSRequest; |
| @@ -164,18 +165,13 @@ public class PdaController extends BizController { | @@ -164,18 +165,13 @@ public class PdaController extends BizController { | ||
| 164 | @ApiOperation("PDA分页查询信息") | 165 | @ApiOperation("PDA分页查询信息") |
| 165 | @PostMapping("/queryPdaInfo4pabe") | 166 | @PostMapping("/queryPdaInfo4pabe") |
| 166 | public BizResultVO<EasyUIDataGridVO<TpPPdaDTO>> queryPdaInfo4pabe(@RequestBody TpPPdaPageQueryRequest tpPPdaRequest, HttpServletRequest request, | 167 | public BizResultVO<EasyUIDataGridVO<TpPPdaDTO>> queryPdaInfo4pabe(@RequestBody TpPPdaPageQueryRequest tpPPdaRequest, HttpServletRequest request, |
| 167 | - HttpServletResponse response){ | ||
| 168 | - BizResult<PageBean<TpPPdaDTO>> bizResult = new BizResult<PageBean<TpPPdaDTO>>(); | ||
| 169 | - try { | ||
| 170 | - tpPPdaRequest.setSysCode(sysCode); | ||
| 171 | - bizResult = tpPPdaService.queryPdaInfo4pabe(tpPPdaRequest); | ||
| 172 | - if(bizResult.isSuccess()){ | ||
| 173 | - return returnJqGridData(bizResult, TpPPdaDTO.class); | ||
| 174 | - } | ||
| 175 | - } catch (Exception e) { | ||
| 176 | - logger.debug("分页查询pda信息异常:{}",bizResult.getErrMsg()); | 168 | + HttpServletResponse response) throws Exception { |
| 169 | + if (null == tpPPdaRequest) { | ||
| 170 | + logger.debug("请求参数为空!"); | ||
| 171 | + throw new BizException(ErrorType.PARAMM_NULL, "请求参数为空"); | ||
| 177 | } | 172 | } |
| 178 | - return new BizResultVO<EasyUIDataGridVO<TpPPdaDTO>>(); | 173 | + BizResult<PageBean<TpPPdaDTO>> bizResult = tpPPdaService.queryPdaInfo4pabe(tpPPdaRequest); |
| 174 | + return returnJqGridData(bizResult, TpPPdaDTO.class); | ||
| 179 | } | 175 | } |
| 180 | 176 | ||
| 181 | @ApiOperation("新增PDA信息信息") | 177 | @ApiOperation("新增PDA信息信息") |
| @@ -194,16 +190,10 @@ public class PdaController extends BizController { | @@ -194,16 +190,10 @@ public class PdaController extends BizController { | ||
| 194 | 190 | ||
| 195 | @ApiOperation("删除PDA信息信息") | 191 | @ApiOperation("删除PDA信息信息") |
| 196 | @PostMapping("/deletePda") | 192 | @PostMapping("/deletePda") |
| 197 | - public BizResultVO<Integer> deletePda(@RequestBody TpPPdaRequest tpPPdaRequest, HttpServletRequest request, | 193 | + public BizResultVO<Integer> deletePda(@RequestBody TpPPdaDeleteRequest tpPPdaRequest, HttpServletRequest request, |
| 198 | HttpServletResponse response){ | 194 | HttpServletResponse response){ |
| 199 | - tpPPdaRequest.setSysCode(sysCode); | ||
| 200 | BizResult<Integer> bizResult = tpPPdaService.deletetPda(tpPPdaRequest); | 195 | BizResult<Integer> bizResult = tpPPdaService.deletetPda(tpPPdaRequest); |
| 201 | - if(bizResult.isSuccess()){ | ||
| 202 | - return new BizResultVO<Integer>(bizResult); | ||
| 203 | - }else{ | ||
| 204 | - logger.debug("删除PDA信息信息异常 :{}",bizResult.getErrMsg()); | ||
| 205 | - } | ||
| 206 | - return new BizResultVO<Integer>(); | 196 | + return new BizResultVO<Integer>(bizResult); |
| 207 | } | 197 | } |
| 208 | 198 | ||
| 209 | @ApiOperation("删除PDA信息信息") | 199 | @ApiOperation("删除PDA信息信息") |
| @@ -248,40 +238,41 @@ public class PdaController extends BizController { | @@ -248,40 +238,41 @@ public class PdaController extends BizController { | ||
| 248 | return new BizResultVO<Integer>(); | 238 | return new BizResultVO<Integer>(); |
| 249 | } | 239 | } |
| 250 | 240 | ||
| 251 | -// @ApiOperation("pda信息导出excel") | ||
| 252 | -// @GetMapping("exportBerthInfoExcel") | ||
| 253 | -// public void exportBerthInfoExcel(@RequestBody TpPPdaRequest tpPPdaRequest, HttpServletRequest requests, HttpServletResponse response) { | ||
| 254 | -// tpPPdaRequest.setSysCode(sysCode); | ||
| 255 | -// BizResult<PageBean<TpPPdaDTO>> list = tpPPdaService.queryPdaInfo4pabe(tpPPdaRequest); | ||
| 256 | -// String[] title = new String[] { "序号","设备编号", "设备名称", "设备类型", "状态","资源描述" }; | ||
| 257 | -// String sheetName = "PDA信息"; | ||
| 258 | -// String fileName = sheetName+DateUtil.getDate(); | ||
| 259 | -// // 1.创建excel信息 | ||
| 260 | -// XSSFSheet workSheet = ExcelUtil.createExcel(fileName); | ||
| 261 | -// // 2.设置excel表头和表体 | ||
| 262 | -// Layouter.buildReport(workSheet, title, 0, 0); | ||
| 263 | -// // 3.填充数据 | ||
| 264 | -// List<Object[]> contentList = new ArrayList<Object[]>(); | ||
| 265 | -// int number = 1; | ||
| 266 | -// if(list.isSuccess() && CollectionUtil.isNotEmpty(list.getData())){ | ||
| 267 | -// for (TpPPdaDTO b : list.getData()) { | ||
| 268 | -// Object[] obj = new Object[title.length]; | ||
| 269 | -// int index = 0; | ||
| 270 | -// obj[index++] = number++; | ||
| 271 | -// obj[index++] = b.getId(); | ||
| 272 | -// obj[index++] = b.getPdaNo(); | ||
| 273 | -// obj[index++] = b.getPdaName(); | ||
| 274 | -// obj[index++] = b.getPdaType(); | ||
| 275 | -// obj[index++] = b.getPdaStatus(); | ||
| 276 | -// obj[index++] = b.getRemark(); | ||
| 277 | -// contentList.add(obj); | ||
| 278 | -// } | ||
| 279 | -// } | ||
| 280 | -// ExcleFillDateManager fillUserManager = new ExcleFillDateManager(); | ||
| 281 | -// fillUserManager.fillSalesOrga(workSheet, title, contentList, 2); | ||
| 282 | -// // 4.excel输出配置 | ||
| 283 | -// ExcelUtil.write(response, workSheet, fileName); | ||
| 284 | -// } | 241 | + @ApiOperation("pda信息导出excel") |
| 242 | + @GetMapping("exportBerthInfoExcel") | ||
| 243 | + public void exportBerthInfoExcel(@RequestBody TpPPdaPageQueryRequest tpPPdaRequest, HttpServletRequest requests, HttpServletResponse response) | ||
| 244 | + throws Exception{ | ||
| 245 | + BizResult<PageBean<TpPPdaDTO>> list = tpPPdaService.queryPdaInfo4pabe(tpPPdaRequest); | ||
| 246 | + String[] title = new String[] { "停车场名称","设备编号", "设备名称", "设备类型", "状态","资源描述" }; | ||
| 247 | + String sheetName = "PDA信息"; | ||
| 248 | + String fileName = sheetName+DateUtil.getDate(); | ||
| 249 | + // 1.创建excel信息 | ||
| 250 | + XSSFSheet workSheet = ExcelUtil.createExcel(fileName); | ||
| 251 | + // 2.设置excel表头和表体 | ||
| 252 | + Layouter.buildReport(workSheet, title, 0, 0); | ||
| 253 | + // 3.填充数据 | ||
| 254 | + List<Object[]> contentList = new ArrayList<Object[]>(); | ||
| 255 | + int number = 1; | ||
| 256 | + List<TpPPdaDTO> tpPPdaDTOList = new ArrayList<>(); | ||
| 257 | + if(list.isSuccess() && CollectionUtil.isNotEmpty(tpPPdaDTOList)){ | ||
| 258 | + for (TpPPdaDTO b : tpPPdaDTOList) { | ||
| 259 | + Object[] obj = new Object[title.length]; | ||
| 260 | + int index = 0; | ||
| 261 | + obj[index++] = number++; | ||
| 262 | + obj[index++] = b.getPlName(); | ||
| 263 | + obj[index++] = b.getPdaNo(); | ||
| 264 | + obj[index++] = b.getPdaName(); | ||
| 265 | + obj[index++] = b.getPdaType(); | ||
| 266 | + obj[index++] = b.getPdaStatus(); | ||
| 267 | + obj[index++] = b.getRemark(); | ||
| 268 | + contentList.add(obj); | ||
| 269 | + } | ||
| 270 | + } | ||
| 271 | + ExcleFillDateManager fillUserManager = new ExcleFillDateManager(); | ||
| 272 | + fillUserManager.fillSalesOrga(workSheet, title, contentList, 2); | ||
| 273 | + // 4.excel输出配置 | ||
| 274 | + ExcelUtil.write(response, workSheet, fileName); | ||
| 275 | + } | ||
| 285 | 276 | ||
| 286 | 277 | ||
| 287 | @ApiOperation("pda信息 导入模板下载") | 278 | @ApiOperation("pda信息 导入模板下载") |