RmsDirectlySentCityController.java 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. package com.steerinfo.dil.controller;
  2. import com.steerinfo.dil.service.impl.RmsDirectlySentCityServiceImpl;
  3. import com.steerinfo.dil.util.BaseRESTfulController;
  4. import com.steerinfo.dil.util.ColumnDataUtil;
  5. import com.steerinfo.dil.util.PageListAdd;
  6. import com.steerinfo.framework.controller.RESTfulResult;
  7. import com.steerinfo.framework.service.pagehelper.PageHelper;
  8. import io.swagger.annotations.Api;
  9. import io.swagger.annotations.ApiOperation;
  10. import org.springframework.web.bind.annotation.PostMapping;
  11. import org.springframework.web.bind.annotation.RequestBody;
  12. import org.springframework.web.bind.annotation.RequestMapping;
  13. import org.springframework.web.bind.annotation.RestController;
  14. import javax.annotation.Resource;
  15. import java.util.HashMap;
  16. import java.util.List;
  17. import java.util.Map;
  18. @RestController
  19. @RequestMapping("/${api.version}/RmsDirectlySentCity")
  20. public class RmsDirectlySentCityController extends BaseRESTfulController {
  21. @Resource
  22. RmsDirectlySentCityServiceImpl rmsDirectlySentCityService;
  23. @Resource
  24. ColumnDataUtil columnDataUtil;
  25. @ApiOperation("查询直发城市维护表")
  26. @PostMapping(value = "/getDirectlySentCity")
  27. public RESTfulResult getDirectlySentCity(@RequestBody(required = false) Map<String,Object> mapValue,
  28. Integer apiId,
  29. Integer pageNum,
  30. Integer pageSize,
  31. String con) {
  32. if (mapValue==null){
  33. mapValue=new HashMap<>();
  34. }
  35. if (con != null && !"null".equals(con)){
  36. mapValue.put("con",con);
  37. }
  38. PageHelper.startPage(pageNum, pageSize);
  39. //分页查询数据
  40. List<Map<String, Object>> columnList = rmsDirectlySentCityService.getDirectlySentCity(mapValue);
  41. if (apiId == null) {
  42. return success(columnList);
  43. }
  44. PageListAdd data = columnDataUtil.tableColumnData(apiId, null, columnList);
  45. return success(data);
  46. }
  47. @ApiOperation("新增直发城市维护")
  48. @PostMapping("insertDirectlySentCityInfo")
  49. public RESTfulResult insertDirectlySentCityInfo(@RequestBody Map<String,Object> map) {
  50. int i = rmsDirectlySentCityService.insertDirectlySentCityInfo(map);
  51. return success();
  52. }
  53. @ApiOperation("删除直发城市维护")
  54. @PostMapping("deleteInfo")
  55. public RESTfulResult deleteInfo(@RequestBody Map<String,Object> map) {
  56. if(map.get("primaryKeyId") != null) {
  57. int i = rmsDirectlySentCityService.deleteInfo(map);
  58. return success(i);
  59. }else{
  60. return failed("删除失败");
  61. }
  62. }
  63. }