BmsshipContractPriceController.java 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. package com.steerinfo.dil.controller;
  2. import com.steerinfo.dil.service.IBmsshipContractPriceService;
  3. import com.steerinfo.dil.util.BaseRESTfulController;
  4. import com.steerinfo.dil.util.ColumnDataUtil;
  5. import com.steerinfo.dil.util.DataChange;
  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.ApiOperation;
  12. import org.springframework.beans.factory.annotation.Autowired;
  13. import org.springframework.web.bind.annotation.*;
  14. import java.math.BigDecimal;
  15. import java.text.SimpleDateFormat;
  16. import java.util.HashMap;
  17. import java.util.List;
  18. import java.util.Map;
  19. /**
  20. * BmsshipContractPrice RESTful接口:
  21. * @author generator
  22. * @version 1.0-SNAPSHORT 2022-07-07 09:38
  23. * 类描述
  24. * 修订历史:
  25. * 日期:2022-07-07
  26. * 作者:generator
  27. * 参考:
  28. * 描述:BmsshipContractPrice RESTful接口
  29. * @see null
  30. * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
  31. */
  32. @RestController
  33. @RequestMapping("/${api.version}/bmsshipcontractprices")
  34. public class BmsshipContractPriceController extends BaseRESTfulController {
  35. @Autowired
  36. IBmsshipContractPriceService bmsshipContractPriceService;
  37. @Autowired
  38. ColumnDataUtil columnDataUtil;
  39. private final SimpleDateFormat sdfDateTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  40. //新增船运合同
  41. @ApiOperation(value="创建", notes="根据RmsCapacity对象创建")
  42. @ApiImplicitParam(name = "rmsCapacity", value = "详细实体rmsCapacity", required = true, dataType = "RmsCapacity")
  43. @PostMapping(value = "/insertBmsshipContractPrice")
  44. public RESTfulResult insertBmsshipContractPrice(@RequestBody(required = false) Map<String,Object> mapValue) {
  45. int result= bmsshipContractPriceService.insertBmsshipContractPrice(mapValue);
  46. if (result==-1){
  47. return failed("合同号已存在!!");
  48. }
  49. return success(result);
  50. }
  51. //新增船运合同
  52. @ApiOperation(value="修改船运合同单价", notes="根据bmsshipContractPrice对象创建")
  53. @ApiImplicitParam(name = "bmsshipContractPrice", value = "详细实体bmsshipContractPrice", required = true, dataType = "bmsshipContractPrice")
  54. @PostMapping(value = "/updateBmsshipContractPrice")
  55. public RESTfulResult updateBmsshipContractPrice(@RequestBody(required = false) Map<String,Object> mapValue) {
  56. int result= bmsshipContractPriceService.updateBmsshipContractPrice(mapValue);
  57. if (result==-1){
  58. return failed("合同号已存在!!");
  59. }
  60. return success(result);
  61. }
  62. //新增船运合同
  63. @ApiOperation(value="删除船运合同单价", notes="根据bmsshipContractPrice对象创建")
  64. @ApiImplicitParam(name = "bmsshipContractPrice", value = "详细实体bmsshipContractPrice", required = true, dataType = "bmsshipContractPrice")
  65. @PostMapping(value = "/deleteBmsshipContractPrice")
  66. public RESTfulResult deleteBmsshipContractPrice(@RequestBody(required = false) Map<String,Object> mapValue) {
  67. int result= bmsshipContractPriceService.deleteBmsshipContractPrice(mapValue);
  68. return success(result);
  69. }
  70. //新增船运合同
  71. @ApiOperation(value="渲染船运合同单价", notes="根据bmsshipContractPrice对象创建")
  72. @ApiImplicitParam(name = "bmsshipContractPrice", value = "详细实体bmsshipContractPrice", required = true, dataType = "bmsshipContractPrice")
  73. @PostMapping(value = "/selectBmsshipPriceList/{id}")
  74. public RESTfulResult selectBmsshipPriceList(@PathVariable("id") BigDecimal id) {
  75. List<Map<String,Object>> list = bmsshipContractPriceService.selectBmsshipPriceList(id);
  76. return success(list);
  77. }
  78. @ApiImplicitParams({
  79. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  80. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  81. @ApiImplicitParam(name = "apiId", value = "500", required = false, dataType = "BigDecimal"),
  82. })
  83. @PostMapping(value = "/selectbmsshipContractPriceList")
  84. public RESTfulResult selectbmsshipContractPriceList(@RequestBody(required = false) Map<String, Object> mapValue,
  85. Integer apiId,
  86. Integer pageNum,
  87. Integer pageSize,
  88. String con,
  89. String startTime,
  90. String endTime) {
  91. if (mapValue == null) {
  92. mapValue = new HashMap<>();
  93. }
  94. DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
  95. if (con != null && con.length() != 0) {
  96. mapValue.put("con","%" + con + "%");
  97. }
  98. if(pageNum!=null && pageSize!=null){
  99. PageHelper.startPage(pageNum, pageSize);
  100. }
  101. //初始化过滤
  102. List<Map<String, Object>> columnList = bmsshipContractPriceService.bmsshipContractPriceList(mapValue);
  103. PageListAdd data = columnDataUtil.tableColumnData(apiId, null, columnList);
  104. return success(data);
  105. }
  106. }