12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- 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<String,Object> 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<Map<String, Object>> 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<String,Object> map) {
- int i = rmsDirectlySentCityService.insertDirectlySentCityInfo(map);
- return success();
- }
- @ApiOperation("删除直发城市维护")
- @PostMapping("deleteInfo")
- public RESTfulResult deleteInfo(@RequestBody Map<String,Object> map) {
- if(map.get("primaryKeyId") != null) {
- int i = rmsDirectlySentCityService.deleteInfo(map);
- return success(i);
- }else{
- return failed("删除失败");
- }
- }
- }
|