| | |
| | | import com.moral.api.entity.Organization; |
| | | import com.moral.api.entity.ServicesScope; |
| | | import com.moral.api.mapper.OrganizationMapper; |
| | | import com.moral.api.pojo.form.ServiceScope.AddBoundaryBindDevice; |
| | | import com.moral.api.service.OrganizationService; |
| | | import com.moral.api.service.ServicesScopeService; |
| | | import com.moral.constant.Constants; |
| | |
| | | return ResultMessage.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "addBoundaryBindDevice",method = RequestMethod.POST) |
| | | @ResponseBody |
| | | public ResultMessage addBoundaryBindDevice(@RequestBody AddBoundaryBindDevice addBoundaryBindDevice){ |
| | | if (ObjectUtils.isEmpty(addBoundaryBindDevice)){ |
| | | return ResultMessage.fail(ResponseCodeEnum.PARAMETERS_IS_MISSING.getCode(), ResponseCodeEnum.PARAMETERS_IS_MISSING.getMsg()); |
| | | } |
| | | QueryWrapper<ServicesScope> servicesScopeQueryWrapper = new QueryWrapper<>(); |
| | | servicesScopeQueryWrapper.eq("id",addBoundaryBindDevice.getServicesScope().getId()).eq("is_delete",Constants.NOT_DELETE); |
| | | ServicesScope servicesScopeRes = servicesScopeService.getOne(servicesScopeQueryWrapper); |
| | | if (ObjectUtils.isEmpty(servicesScopeRes)){ |
| | | return ResultMessage.fail(ResponseCodeEnum.SERVICES_SCOPE_IS_NOT_EXIST.getCode(), ResponseCodeEnum.SERVICES_SCOPE_IS_NOT_EXIST.getMsg()); |
| | | } |
| | | /*if (!ObjectUtils.isEmpty(addBoundaryBindDevice.getServicesScope().getOrganizationId())){ |
| | | QueryWrapper<Organization> organizationQueryWrapper = new QueryWrapper<>(); |
| | | organizationQueryWrapper.eq("id",addBoundaryBindDevice.getServicesScope().getOrganizationId()).eq("is_delete",Constants.NOT_DELETE); |
| | | Organization organization = organizationService.getOne(organizationQueryWrapper); |
| | | if (ObjectUtils.isEmpty(organization)){ |
| | | return ResultMessage.fail(ResponseCodeEnum.ORGANIZATION_NOT_EXIST.getCode(), ResponseCodeEnum.ORGANIZATION_NOT_EXIST.getMsg()); |
| | | } |
| | | }*/ |
| | | servicesScopeService.addBoundaryBindDevice(addBoundaryBindDevice); |
| | | return ResultMessage.ok(); |
| | | } |
| | | |
| | | } |