| | |
| | | |
| | | /** |
| | | * 客户端请求得到所有片区数据 |
| | | * |
| | | * @return 所有片区数据 |
| | | */ |
| | | @Operation(summary = "获得全部片区", description = "返回全部片区数据") |
| | |
| | | |
| | | /** |
| | | * 客户端请求得到所有片区数据 2024-08-14废弃 |
| | | * |
| | | * @return 所有片区数据 |
| | | */ |
| | | @PostMapping(path = "some2", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | |
| | | |
| | | /** |
| | | * 根据指定条件获取片区,2024-08-14新增,替换原来的片区分页查询 |
| | | * |
| | | * @param qo |
| | | * @param bindingResult |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 得到一个片区数据 |
| | | * |
| | | * @return 一个片区数据 |
| | | */ |
| | | @Operation(summary = "一个片区", description = "得到一个片区数据") |
| | |
| | | |
| | | /** |
| | | * 保存片区 |
| | | * |
| | | * @param po 保存片区form表单对象 |
| | | * @return 是否成功 |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * 编辑修改片区 |
| | | * 编辑修改片区 2024-08-15 作废 |
| | | * |
| | | * @param po 保存片区form表单对象 |
| | | * @return 是否成功 |
| | | */ |
| | | @Operation(summary = "编辑修改片区", description = "提交片区数据(form表单),进行修改") |
| | | @ApiResponses(value = { |
| | | @ApiResponse( |
| | | responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, |
| | | description = "操作结果:true:成功,false:失败(BaseResponse.content)", |
| | | content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, |
| | | schema = @Schema(implementation = Boolean.class))} |
| | | ) |
| | | }) |
| | | @PostMapping(path = "update", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @PostMapping(path = "update2", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> update(@RequestBody @Valid BaBlock po, BindingResult bindingResult){ |
| | | public BaseResponse<Boolean> update2(@RequestBody @Valid BaBlock po, BindingResult bindingResult) { |
| | | if(bindingResult != null && bindingResult.hasErrors()){ |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 修改片区信息,2024-08-15新增,替换原来的片区修改接口 |
| | | * |
| | | * @param po |
| | | * @param bindingResult |
| | | * @return |
| | | */ |
| | | @PostMapping(path = "update", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @SsoAop() |
| | | public BaseResponse<Boolean> update(@RequestBody @Valid Block po, BindingResult bindingResult) { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | |
| | | Long blockId = po.getId(); |
| | | if (blockId == null) { |
| | | return BaseResponseUtils.buildErrorMsg(SystemResultCode.THE_BLOCK_NOT_EXIST.getMessage()); |
| | | } |
| | | |
| | | // 修改片区信息 |
| | | BaBlock baBlock = new BaBlock(); |
| | | baBlock.setId(po.getId()); |
| | | baBlock.setName(po.getName()); |
| | | baBlock.setHeader(po.getHeader()); |
| | | baBlock.setPhone(po.getPhone()); |
| | | baBlock.setArea(po.getArea()); |
| | | baBlock.setColor(po.getColor()); |
| | | baBlock.setRemark(po.getRemark()); |
| | | baBlock.setDeleted(po.getDeleted()); |
| | | int count; |
| | | try { |
| | | count = this.sv.update(baBlock); |
| | | } catch (Exception e) { |
| | | log.error("保存片区异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | if (count <= 0) { |
| | | return BaseResponseUtils.buildFail("数据库存储失败"); |
| | | } |
| | | |
| | | // 删除片区关联的地图图形 |
| | | this.sv.deleteMapGraph(blockId); |
| | | // 删除地图图形坐标 |
| | | this.sv.deleteMapCoordinates(blockId); |
| | | |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除片区 |
| | | * |
| | | * @param id 片区ID |
| | | * @return 是否成功 |
| | | */ |
| | |
| | | schema = @Schema(implementation = Boolean.class))} |
| | | ) |
| | | }) |
| | | |
| | | //@GetMapping(path = "delete", consumes = MediaType.TEXT_PLAIN_VALUE) |
| | | @GetMapping(path = "delete") |
| | | @SsoAop() |
| | |
| | | } |
| | | if(count <= 0){ |
| | | return BaseResponseUtils.buildFail("数据库存储失败") ; |
| | | }else{ |
| | | return BaseResponseUtils.buildSuccess(true) ; |
| | | } |
| | | |
| | | // 删除片区关联的地图图形 |
| | | this.sv.deleteMapGraph(id); |
| | | // 删除地图图形坐标 |
| | | this.sv.deleteMapCoordinates(id); |
| | | |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | } |