|  |  |  | 
|---|
|  |  |  | schema = @Schema(implementation = Boolean.class))} | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | @GetMapping(path = "delete") | 
|---|
|  |  |  | @PostMapping(path = "delete") | 
|---|
|  |  |  | @Transactional(rollbackFor = Exception.class) | 
|---|
|  |  |  | @SsoAop() | 
|---|
|  |  |  | public BaseResponse<Boolean> delete( Long id) { | 
|---|
|  |  |  | if (id == null ) { | 
|---|
|  |  |  | public BaseResponse<Boolean> delete(@RequestBody Map map) { | 
|---|
|  |  |  | if (map == null || map.size() <= 0) { | 
|---|
|  |  |  | BaseResponseUtils.buildFail(IrrigateResultCode.PLEASE_INPUT_PROJECT_ID.getMessage()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //        Long groupId = Long.parseLong(map.get("id").toString()); | 
|---|
|  |  |  | Long groupId = Long.parseLong(map.get("id").toString()); | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | Integer rows = irrigateGroupSv.deleteIrrigateGroup(id); | 
|---|
|  |  |  | Integer rows = irrigateGroupSv.deleteIrrigateGroup(groupId); | 
|---|
|  |  |  | if (rows == 0) { | 
|---|
|  |  |  | return BaseResponseUtils.buildFail(IrrigateResultCode.DELETE_PROJECT_FAIL.getMessage()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return BaseResponseUtils.buildSuccess(true); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @GetMapping(path = "bind_units") | 
|---|
|  |  |  | @SsoAop() | 
|---|
|  |  |  | public BaseResponse<List<Long>> getGroupBindUnits(Long id) { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | List<Long> res = irrigateGroupSv.getGroupBindUnits(id); | 
|---|
|  |  |  | return BaseResponseUtils.buildSuccess(res); | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | log.error("获取一个轮灌组绑定灌溉单元记录异常", e); | 
|---|
|  |  |  | return BaseResponseUtils.buildException(e.getMessage()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|