package com.steerinfo.dil.controller; import com.steerinfo.dil.feign.ColumnDataFeign; import com.steerinfo.dil.feign.ESFeign; import com.steerinfo.dil.service.impl.TmsshipTotalResultServiceImpl; 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.*; /** * TmsshipTotalResult RESTful接口: * @author generator * @version 1.0-SNAPSHORT 2021-08-19 08:55 * 类描述 * 修订历史: * 日期:2021-08-19 * 作者:generator * 参考: * 描述:TmsshipTotalResult RESTful接口 * @see null * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved. */ @RestController @RequestMapping("/${api.version}/tmsshiptotalresults") public class TmsshipTotalResultController extends BaseRESTfulController { @Autowired TmsshipTotalResultServiceImpl tmsshipTotalResultService; @Autowired ColumnDataFeign columnDataFeign; @Autowired ColumnDataUtil columnDataUtil; @Autowired ESFeign esFeign; private final SimpleDateFormat sdfDateTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); /** * 展示水路货物运单列表 * @param mapVal * @param pageNum * @param pageSize * @param apiId * @return */ @ApiOperation(value="展示水路货物运单", notes="分页查询") @ApiImplicitParams({ @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"), @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"), @ApiImplicitParam(name = "apiId", value = "56", required = false, dataType = "BigDecimal"), }) @PostMapping(value = "/listAllOrders") public RESTfulResult listAllOrders(@RequestBody(required = false) Map mapVal, Integer pageNum, Integer pageSize, Integer apiId){ List> detailListTotal = tmsshipTotalResultService.getOrderList(mapVal); PageHelper.startPage(pageNum, pageSize); //分页查询数据 List> columnList = tmsshipTotalResultService.getOrderList(mapVal); PageListAdd data = columnDataUtil.tableColumnData(apiId, detailListTotal, columnList); return success(data); } /** * 展示船只信息 * @param mapVal * @param pageNum * @param pageSize * @param apiId * @return */ @ApiOperation(value="展示船只信息", notes="分页查询") @ApiImplicitParams({ @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"), @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"), @ApiImplicitParam(name = "apiId", value = "138", required = false, dataType = "BigDecimal"), }) @PostMapping(value = "/getCapacityList") public RESTfulResult getCapacityList(@RequestBody(required = false) Map mapVal, Integer pageNum, Integer pageSize, Integer apiId, String con){ if (mapVal == null) { mapVal = new HashMap<>(); } mapVal.put("con",con); List> detailListTotal = tmsshipTotalResultService.getCapacity(mapVal); PageHelper.startPage(pageNum, pageSize); //分页查询数据 List> columnList = tmsshipTotalResultService.getCapacity(mapVal); PageListAdd data = columnDataUtil.tableColumnData(apiId, detailListTotal, columnList); return success(data); } //批复车皮 @PostMapping("/addPleaseResult") public RESTfulResult addPleaseResult(@RequestBody(required = false) Map mapVal){ if (mapVal == null) { mapVal = new HashMap<>(); } return success(tmsshipTotalResultService.addPleaseResult(mapVal)); } @PostMapping("/editPleaseResult") public RESTfulResult editPleaseResult(@RequestBody(required = false) Map mapVal){ if (mapVal == null) { mapVal = new HashMap<>(); } return success(tmsshipTotalResultService.editPleaseResult(mapVal)); } @PostMapping("/getAllPleaseResult") public RESTfulResult getAllPleaseResult(@RequestBody(required = false) Map mapVal, Integer pageNum, Integer pageSize, Integer apiId, String con, String startTime, String endTime){ if (mapVal == null) { mapVal = new HashMap<>(); } mapVal.put("con",con); if(startTime!=null && endTime!=null){ DataChange.queryDataByDateTime(startTime,endTime,mapVal,sdfDateTime); } List> detailListTotal = tmsshipTotalResultService.getCapacity(mapVal); PageHelper.startPage(pageNum, pageSize); //分页查询数据 List> columnList = tmsshipTotalResultService.getAllPleaseResult(mapVal); PageListAdd data = columnDataUtil.tableColumnData(apiId, detailListTotal, columnList); return success(data); } @PostMapping("/getPleaseResult/{resultId}") public RESTfulResult getPleaseResult(@PathVariable("resultId") BigDecimal resultId){ return success(tmsshipTotalResultService.getPleaseResult(resultId)); } @PostMapping("/getRealNumber") public RESTfulResult getRealNumber(@RequestBody(required = false) Map map){ DataChange.queryDataByDateTime(map.get("resultDate")+"",null,map,sdfDateTime); return success(tmsshipTotalResultService.getRealNumber(map)); } }