| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.moral.api.entity.GovMonitorPoint; |
| | | import com.moral.api.entity.Organization; |
| | | import com.moral.api.mapper.GovMonitorPointMapper; |
| | | import com.moral.api.mapper.OrganizationMapper; |
| | | import com.moral.api.service.GovMonitorPointService; |
| | | import com.moral.constant.Constants; |
| | | import com.moral.constant.ResponseCodeEnum; |
| | | import com.moral.constant.ResultMessage; |
| | | import com.moral.util.WebUtils; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | |
| | | @Resource |
| | | private GovMonitorPointMapper govMonitorPointMapper; |
| | | |
| | | @Resource |
| | | private OrganizationMapper organizationMapper; |
| | | |
| | | @RequestMapping(value = "getGovMonitorPointByCondition", method = RequestMethod.GET) |
| | | @ResponseBody |
| | |
| | | return ResultMessage.ok(); |
| | | } |
| | | |
| | | @GetMapping("updateGuid") |
| | | @ApiOperation(value = "更新站点编号", notes = "更新站点编号") |
| | | public ResultMessage updateGuid(@RequestParam @ApiParam(value = "id",name = "主键id") Integer id, |
| | | @RequestParam @ApiParam(value = "guid",name = "站点编号") String guid) { |
| | | |
| | | govMonitorPointService.updateList(id,guid); |
| | | return ResultMessage.ok(); |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "delete", method = RequestMethod.POST) |
| | | @ResponseBody |
| | | public ResultMessage delete(@RequestBody Map map) { |
| | |
| | | List<Map<String, Object>> response = govMonitorPointService.selectGovMonitorPoints(regionCode); |
| | | return ResultMessage.ok(response); |
| | | } |
| | | |
| | | @RequestMapping(value = "getGovMonitorPointsByOrgId", method = RequestMethod.GET) |
| | | @ResponseBody |
| | | public ResultMessage getGovMonitorPointsByOrgId(HttpServletRequest request){ |
| | | Map<String, Object> parameters = WebUtils.getParametersStartingWith(request, null); |
| | | Object orgid = parameters.get("organization_id"); |
| | | if (ObjectUtils.isEmpty(orgid)){ |
| | | return ResultMessage.fail(ResponseCodeEnum.PARAMETERS_IS_MISSING.getCode(), ResponseCodeEnum.PARAMETERS_IS_MISSING.getMsg()); |
| | | } |
| | | Organization organization = organizationMapper.selectById(Integer.parseInt(orgid.toString())); |
| | | if (ObjectUtils.isEmpty(organization)){ |
| | | return ResultMessage.fail(ResponseCodeEnum.ORGANIZATION_NOT_EXIST.getCode(), ResponseCodeEnum.ORGANIZATION_NOT_EXIST.getMsg()); |
| | | } |
| | | List<GovMonitorPoint> govMonitorPoints = govMonitorPointService.selectGovMonitorPointsByOrgid(parameters); |
| | | return ResultMessage.ok(govMonitorPoints); |
| | | } |
| | | } |