package com.steerinfo.dil.controller; import com.steerinfo.dil.service.ITmstruckWeightResultService; 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.util.HashMap; import java.util.List; import java.util.Map; /** * TmstruckWeightResult RESTful接口: * @author generator * @version 1.0-SNAPSHORT 2021-09-09 02:21 * 类描述 * 修订历史: * 日期:2021-09-09 * 作者:generator * 参考: * 描述:TmstruckWeightResult RESTful接口 * @see null * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved. */ @RestController @RequestMapping("/${api.version}/tmstruckweightresults") public class TmstruckWeightResultController extends BaseRESTfulController { @Autowired ITmstruckWeightResultService tmstruckWeightResultService; @Autowired ColumnDataUtil columnDataUtil; @ApiOperation(value="新增计量实绩 ") @ApiImplicitParams({ @ApiImplicitParam(name = "mapValue", value = "总实绩ID、计皮点、计毛点", required = false, dataType = "Map"), }) @PostMapping("/addWeightResult") public RESTfulResult addWeightResult(@RequestBody Map mapValue){ int i = tmstruckWeightResultService.addWeightResult(mapValue); return success(i); } @ApiOperation(value="查询计毛实绩") @ApiImplicitParams({ @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"), @ApiImplicitParam(name = "apiId(102)", value = "动态表头", required = false, dataType = "Integer"), @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"), @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"), @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"), }) @PostMapping("/getAllJiMaoResult") public RESTfulResult getAllJiMaoResult(@RequestBody(required=false) Map mapValue, Integer apiId, Integer pageNum, Integer pageSize, Integer orderType ){ if (mapValue == null){ mapValue = new HashMap<>(); } if(orderType != null){ mapValue.put("orderTypee", orderType); } //不分页筛选数据 List> allJiMaoResult = tmstruckWeightResultService.getAllJiMaoResult(mapValue); PageHelper.startPage(pageNum,pageSize); //分页数据 List> jiMaoResult = tmstruckWeightResultService.getAllJiMaoResult(mapValue); PageListAdd pageList = columnDataUtil.tableColumnData(apiId, allJiMaoResult,jiMaoResult); return success(pageList); } @ApiOperation(value="查询计皮实绩") @ApiImplicitParams({ @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"), @ApiImplicitParam(name = "apiId(104)", value = "动态表头", required = false, dataType = "Integer"), @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"), @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"), @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"), }) @PostMapping("/getAllJiPiResult") public RESTfulResult getAllJiPiResult(@RequestBody(required=false) Map mapValue, Integer apiId, Integer pageNum, Integer pageSize, Integer orderType ){ if (mapValue == null){ mapValue = new HashMap<>(); } if(orderType != null){ mapValue.put("orderTypee", orderType); } //不分页筛选数据 List> allJiMaoResult = tmstruckWeightResultService.getAllJiPiResult(mapValue); PageHelper.startPage(pageNum,pageSize); //分页数据 List> jiMaoResult = tmstruckWeightResultService.getAllJiPiResult(mapValue); PageListAdd pageList = columnDataUtil.tableColumnData(apiId, allJiMaoResult,jiMaoResult); return success(pageList); } @ApiOperation(value="采集新增计毛实绩 ") @ApiImplicitParams({ @ApiImplicitParam(name = "mapValue", value = "采集的数据", required = false, dataType = "Map"), }) @PostMapping("/addJiMaoResult") public RESTfulResult addJiMaoResult(@RequestBody Map mapValue){ int i = tmstruckWeightResultService.addJiMaoResult(mapValue); return success(i); } @ApiOperation(value="采集新增计皮实绩 ") @ApiImplicitParams({ @ApiImplicitParam(name = "mapValue", value = "采集的数据", required = false, dataType = "Map"), }) @PostMapping("/addJiPiResult") public RESTfulResult addJiPiResult(@RequestBody Map mapValue){ int i = tmstruckWeightResultService.addJiPiResult(mapValue); return success(i); } }