123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- package com.steerinfo.dil.controller;
- import com.steerinfo.dil.feign.ESFeign;
- import com.steerinfo.dil.model.RmsPier;
- import com.steerinfo.dil.service.impl.RmsPierServiceImpl;
- 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.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.util.HashMap;
- import java.util.List;
- import java.util.Map;
- /**
- * @author luobang
- * @create 2021-11-15 15:13
- */
- @RestController
- @RequestMapping("/${api.version}/rmsPier")
- public class RmsPierController extends BaseRESTfulController {
- @Autowired
- RmsPierServiceImpl rmsPierService;
- @Autowired
- ColumnDataUtil columnDataUtil;
- @Autowired
- ESFeign esFeign;
- /**
- * 新增码头
- * @param rmsPier
- * @return
- */
- @PostMapping("/insertPier")
- public RESTfulResult insertPier(@RequestBody(required = true) RmsPier rmsPier){
- Integer integer = rmsPierService.insertPier(rmsPier);
- if (
- integer!=1
- ){
- return failed();
- }
- else{
- return success();
- }
- }
- /**
- * 修改码头
- * @param rmsPier
- * @return
- */
- @PostMapping("/editPier")
- public RESTfulResult editPier(@RequestBody(required = true)RmsPier rmsPier){
- Integer integer = rmsPierService.updatePier(rmsPier);
- if (
- integer!=1
- ){
- return failed();
- }
- else{
- return success();
- }
- }
- /**
- * 删除码头
- * @param
- * @return
- */
- @PostMapping("/deletePier/{pierId}")
- public RESTfulResult deletePort(@PathVariable("pierId") BigDecimal pierId){
- Integer integer = rmsPierService.deletePier(pierId);
- if (
- integer!=1
- ){
- return failed();
- }
- else{
- return success();
- }
- }
- @ApiOperation(value="展示码头信息", notes="分页查询")
- @ApiImplicitParams({
- @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
- @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
- @ApiImplicitParam(name = "apiId", value = "196", required = false, dataType = "BigDecimal"),
- })
- @PostMapping(value = "/getPier")
- public RESTfulResult getPier(@RequestBody(required = false) Map<String,Object> mapVal,
- Integer pageNum,
- Integer pageSize,
- Integer apiId,
- String con){
- mapVal.put("con",con);
- List<Map<String,Object>> pierList = rmsPierService.getPier(mapVal);
- PageHelper.startPage(pageNum, pageSize);
- //分页查询数据
- List<Map<String, Object>> columnList = rmsPierService.getPier(mapVal);
- PageListAdd data = columnDataUtil.tableColumnData(apiId, pierList, columnList);
- return success(data);
- }
- /**
- * 港口ID
- * @return
- */
- @GetMapping("/getPortId")
- public RESTfulResult getPortId(){
- return success(rmsPierService.getPortId());
- }
- }
|