package com.steerinfo.dil.controller; import com.steerinfo.dil.service.impl.RmsDirectlySentCityServiceImpl; import com.steerinfo.dil.util.BaseRESTfulController; import com.steerinfo.dil.util.ColumnDataUtil; import com.steerinfo.dil.util.PageListAdd; import com.steerinfo.framework.controller.RESTfulResult; import com.steerinfo.framework.service.pagehelper.PageHelper; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import java.util.HashMap; import java.util.List; import java.util.Map; @RestController @RequestMapping("/${api.version}/RmsDirectlySentCity") public class RmsDirectlySentCityController extends BaseRESTfulController { @Resource RmsDirectlySentCityServiceImpl rmsDirectlySentCityService; @Resource ColumnDataUtil columnDataUtil; @ApiOperation("查询直发城市维护表") @PostMapping(value = "/getDirectlySentCity") public RESTfulResult getDirectlySentCity(@RequestBody(required = false) Map mapValue, Integer apiId, Integer pageNum, Integer pageSize, String con) { if (mapValue==null){ mapValue=new HashMap<>(); } if (con != null && !"null".equals(con)){ mapValue.put("con",con); } PageHelper.startPage(pageNum, pageSize); //分页查询数据 List> columnList = rmsDirectlySentCityService.getDirectlySentCity(mapValue); if (apiId == null) { return success(columnList); } PageListAdd data = columnDataUtil.tableColumnData(apiId, null, columnList); return success(data); } @ApiOperation("新增直发城市维护") @PostMapping("insertDirectlySentCityInfo") public RESTfulResult insertDirectlySentCityInfo(@RequestBody Map map) { int i = rmsDirectlySentCityService.insertDirectlySentCityInfo(map); return success(); } @ApiOperation("删除直发城市维护") @PostMapping("deleteInfo") public RESTfulResult deleteInfo(@RequestBody Map map) { if(map.get("primaryKeyId") != null) { int i = rmsDirectlySentCityService.deleteInfo(map); return success(i); }else{ return failed("删除失败"); } } }