package com.steerinfo.dil.controller; import com.steerinfo.dil.service.IBmsshipContractPriceService; import com.steerinfo.dil.util.BaseRESTfulController; import com.steerinfo.dil.util.ColumnDataUtil; import com.steerinfo.dil.util.DataChange; import com.steerinfo.dil.util.PageListAdd; import com.steerinfo.framework.controller.RESTfulResult; import com.steerinfo.framework.service.pagehelper.PageHelper; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.math.BigDecimal; import java.text.SimpleDateFormat; import java.util.HashMap; import java.util.List; import java.util.Map; /** * BmsshipContractPrice RESTful接口: * @author generator * @version 1.0-SNAPSHORT 2022-07-07 09:38 * 类描述 * 修订历史: * 日期:2022-07-07 * 作者:generator * 参考: * 描述:BmsshipContractPrice RESTful接口 * @see null * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved. */ @RestController @RequestMapping("/${api.version}/bmsshipcontractprices") public class BmsshipContractPriceController extends BaseRESTfulController { @Autowired IBmsshipContractPriceService bmsshipContractPriceService; @Autowired ColumnDataUtil columnDataUtil; private final SimpleDateFormat sdfDateTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); //新增船运合同 @ApiOperation(value="创建", notes="根据RmsCapacity对象创建") @ApiImplicitParam(name = "rmsCapacity", value = "详细实体rmsCapacity", required = true, dataType = "RmsCapacity") @PostMapping(value = "/insertBmsshipContractPrice") public RESTfulResult insertBmsshipContractPrice(@RequestBody(required = false) Map mapValue) { int result= bmsshipContractPriceService.insertBmsshipContractPrice(mapValue); if (result==-1){ return failed("合同号已存在!!"); } return success(result); } //新增船运合同 @ApiOperation(value="修改船运合同单价", notes="根据bmsshipContractPrice对象创建") @ApiImplicitParam(name = "bmsshipContractPrice", value = "详细实体bmsshipContractPrice", required = true, dataType = "bmsshipContractPrice") @PostMapping(value = "/updateBmsshipContractPrice") public RESTfulResult updateBmsshipContractPrice(@RequestBody(required = false) Map mapValue) { int result= bmsshipContractPriceService.updateBmsshipContractPrice(mapValue); if (result==-1){ return failed("合同号已存在!!"); } return success(result); } //新增船运合同 @ApiOperation(value="删除船运合同单价", notes="根据bmsshipContractPrice对象创建") @ApiImplicitParam(name = "bmsshipContractPrice", value = "详细实体bmsshipContractPrice", required = true, dataType = "bmsshipContractPrice") @PostMapping(value = "/deleteBmsshipContractPrice") public RESTfulResult deleteBmsshipContractPrice(@RequestBody(required = false) Map mapValue) { int result= bmsshipContractPriceService.deleteBmsshipContractPrice(mapValue); return success(result); } //新增船运合同 @ApiOperation(value="渲染船运合同单价", notes="根据bmsshipContractPrice对象创建") @ApiImplicitParam(name = "bmsshipContractPrice", value = "详细实体bmsshipContractPrice", required = true, dataType = "bmsshipContractPrice") @PostMapping(value = "/selectBmsshipPriceList/{id}") public RESTfulResult selectBmsshipPriceList(@PathVariable("id") BigDecimal id) { List> list = bmsshipContractPriceService.selectBmsshipPriceList(id); return success(list); } @ApiImplicitParams({ @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"), @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"), @ApiImplicitParam(name = "apiId", value = "500", required = false, dataType = "BigDecimal"), }) @PostMapping(value = "/selectbmsshipContractPriceList") public RESTfulResult selectbmsshipContractPriceList(@RequestBody(required = false) Map mapValue, Integer apiId, Integer pageNum, Integer pageSize, String con, String startTime, String endTime) { if (mapValue == null) { mapValue = new HashMap<>(); } DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据 if (con != null && con.length() != 0) { mapValue.put("con","%" + con + "%"); } if(pageNum!=null && pageSize!=null){ PageHelper.startPage(pageNum, pageSize); } //初始化过滤 List> columnList = bmsshipContractPriceService.bmsshipContractPriceList(mapValue); PageListAdd data = columnDataUtil.tableColumnData(apiId, null, columnList); return success(data); } }