UniversalController.java 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. package com.steerinfo.dil.controller;
  2. import com.steerinfo.dil.mapper.UniversalMapper;
  3. import com.steerinfo.dil.service.impl.UniversalServiceImpl;
  4. import com.steerinfo.dil.util.BaseRESTfulController;
  5. import com.steerinfo.dil.util.ColumnDataUtil;
  6. import com.steerinfo.dil.util.PageListAdd;
  7. import com.steerinfo.framework.controller.RESTfulResult;
  8. import com.steerinfo.framework.service.pagehelper.PageHelper;
  9. import io.swagger.annotations.ApiImplicitParam;
  10. import io.swagger.annotations.ApiImplicitParams;
  11. import io.swagger.annotations.ApiModelProperty;
  12. import io.swagger.annotations.ApiOperation;
  13. import org.springframework.beans.factory.annotation.Autowired;
  14. import org.springframework.web.bind.annotation.PostMapping;
  15. import org.springframework.web.bind.annotation.RequestBody;
  16. import org.springframework.web.bind.annotation.RequestMapping;
  17. import org.springframework.web.bind.annotation.RestController;
  18. import java.util.List;
  19. import java.util.Map;
  20. /**
  21. * @ author :TXF
  22. * @ time :2021/10/19 18:06
  23. * 通用接口
  24. */
  25. @RequestMapping("${api.version}/uc")
  26. @RestController
  27. public class UniversalController extends BaseRESTfulController {
  28. @Autowired
  29. UniversalServiceImpl selfServiceMachineService;
  30. @Autowired
  31. UniversalMapper universalMapper;
  32. @Autowired
  33. ColumnDataUtil columnDataUtil;
  34. @ApiOperation(value="查询数据打印提货单接口")
  35. @ApiImplicitParams({
  36. @ApiImplicitParam(name = "mapValue", value = "运输订单号", required = false, dataType = "Map"),
  37. })
  38. @PostMapping("/printTHD")
  39. public RESTfulResult printTiHuoDan(@RequestBody(required=false) Map<String, Object> mapValue){
  40. Map<String, Object> tiHuoDan = selfServiceMachineService.printTiHuoDan((String) mapValue.get("orderNumber"));
  41. return success(tiHuoDan);
  42. }
  43. @ApiModelProperty(value = "模糊查询物资")
  44. @ApiImplicitParams({
  45. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  46. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  47. @ApiImplicitParam(name = "apiId", value = "244", required = false, dataType = "BigDecimal")
  48. })
  49. @PostMapping("/queryMaterialByLike")
  50. public RESTfulResult queryMaterialByLike(@RequestBody(required = false) Map<String,Object> mapValue,
  51. Integer pageNum,
  52. Integer pageSize,
  53. Integer apiId,
  54. String index) {
  55. index = index + "%";
  56. List<Map<String, Object>> list = universalMapper.queryMaterialByLike(index);
  57. PageHelper.startPage(pageNum, pageSize);
  58. //分页查询数据
  59. List<Map<String, Object>> columnList = universalMapper.queryMaterialByLike(index);
  60. PageListAdd data = columnDataUtil.tableColumnData(apiId, list, columnList);
  61. return success(data);
  62. }
  63. }