package com.steerinfo.dil.controller; import com.steerinfo.dil.feign.ESFeign; import com.steerinfo.dil.service.ITmstruckTimeTaskResultService; 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.text.SimpleDateFormat; import java.util.HashMap; import java.util.List; import java.util.Map; /** * TmstruckTimeTskResult RESTful接口: * @author generator * @version 1.0-SNAPSHORT 2021-10-22 07:28 * 类描述 * 修订历史: * 日期:2021-10-22 * 作者:generator * 参考: * 描述:TmstruckTimeTskResult RESTful接口 * @see null * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved. */ @RestController @RequestMapping("/${api.version}/tmstrucktimetaskresults") public class TmstruckTimeTaskResultController extends BaseRESTfulController { @Autowired ITmstruckTimeTaskResultService tmstruckTimeTaskResultService; @Autowired ESFeign esFeign; @Autowired ColumnDataUtil columnDataUtil; private final SimpleDateFormat sdfDateTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); @ApiOperation(value="司机申请开始") @ApiImplicitParams({ @ApiImplicitParam(name = "mapValue", value = "运输订单号", required = false, dataType = "Map"), }) @PostMapping("/applyStartTime") public RESTfulResult applyStartTime(@RequestBody(required=false) Map<String,Object> mapValue){ int i = tmstruckTimeTaskResultService.applyStartTime(mapValue); return success(i); } @ApiOperation(value="用于计时新增") @ApiImplicitParams({ @ApiImplicitParam(name = "mapValue", value = "运输订单号", required = false, dataType = "Map"), }) @PostMapping("/addTimeTaskResult") public RESTfulResult addTimeTaskResult(@RequestBody(required=false) Map<String,Object> mapValue) throws Exception { int i=0; if (i==-1){ return failed("生成账单失败"); } try { i=tmstruckTimeTaskResultService.addTimeTaskResult(mapValue); } catch (Exception e) { return failed(e.getMessage()); } return success(i); } @ApiOperation(value="用于计时判断") @ApiImplicitParams({ @ApiImplicitParam(name = "mapValue", value = "运输订单号", required = false, dataType = "Map"), }) @PostMapping("/JudgeTimeTask") public RESTfulResult JudgeTimeTask(@RequestBody(required=false) Map<String,Object> mapValue) throws Exception { int i=0; try { i=tmstruckTimeTaskResultService.JudgeTimeTask(mapValue); } catch (Exception e) { return failed(e.getMessage()); } return success(i); } @ApiOperation(value="用于计时暂停判断") @ApiImplicitParams({ @ApiImplicitParam(name = "mapValue", value = "运输订单号", required = false, dataType = "Map"), }) @PostMapping("/JudgeTimeTaskPause") public RESTfulResult JudgeTimeTaskPause(@RequestBody(required=false) Map<String,Object> mapValue) throws Exception { int i=0; try { i=tmstruckTimeTaskResultService.JudgeTimeTaskPause(mapValue); } catch (Exception e) { return failed(e.getMessage()); } return success(i); } @ApiOperation(value="用车单位确认开始") @ApiImplicitParams({ @ApiImplicitParam(name = "mapValue", value = "运输订单号", required = false, dataType = "Map"), }) @PostMapping("/unitSureStartTime") public RESTfulResult unitSureStartTime(@RequestBody(required=false) Map<String,Object> mapValue){ int i = tmstruckTimeTaskResultService.unitSureStartTime(mapValue); return success(i); } @ApiOperation(value="司机申请暂停开始") @ApiImplicitParams({ @ApiImplicitParam(name = "mapValue", value = "运输订单号", required = false, dataType = "Map"), }) @PostMapping("/applyStartTimeout") public RESTfulResult applyStartTimeout(@RequestBody(required=false) Map<String,Object> mapValue){ int i = tmstruckTimeTaskResultService.applyStartTimeout(mapValue); return success(i); } @ApiOperation(value="暂停计时") @ApiImplicitParams({ @ApiImplicitParam(name = "mapValue", value = "运输订单号", required = false, dataType = "Map"), }) @PostMapping("/unitSureStartTimeout") public RESTfulResult unitSureStartTimeout(@RequestBody(required=false) Map<String,Object> mapValue){ int i = tmstruckTimeTaskResultService.unitSureStartTimeout(mapValue); return success(i); } @ApiOperation(value="司机申请暂停结束") @ApiImplicitParams({ @ApiImplicitParam(name = "mapValue", value = "运输订单号", required = false, dataType = "Map"), }) @PostMapping("/applyEndTimeout") public RESTfulResult applyEndTimeout(@RequestBody(required=false) Map<String,Object> mapValue){ int i = tmstruckTimeTaskResultService.applyEndTimeout(mapValue); return success(i); } @ApiOperation(value="用车单位确认暂停结束") @ApiImplicitParams({ @ApiImplicitParam(name = "mapValue", value = "运输订单号", required = false, dataType = "Map"), }) @PostMapping("/unitSureEndTimeout") public RESTfulResult unitSureEndTimeout(@RequestBody(required=false) Map<String,Object> mapValue){ int i = tmstruckTimeTaskResultService.unitSureEndTimeout(mapValue); return success(i); } @ApiOperation(value="司机申请结束") @ApiImplicitParams({ @ApiImplicitParam(name = "mapValue", value = "运输订单号", required = false, dataType = "Map"), }) @PostMapping("/applyEndTime") public RESTfulResult applyEndTime(@RequestBody(required=false) Map<String,Object> mapValue){ int i = tmstruckTimeTaskResultService.applyEndTime(mapValue); return success(i); } // // @ApiOperation(value="计时修改") // @ApiImplicitParams({ // @ApiImplicitParam(name = "mapValue", value = "运输订单号", required = false, dataType = "Map"), // }) // @PostMapping("/updateTimeTaskResult") // public RESTfulResult updateTimeTaskResult(@RequestBody(required=false) Map<String,Object> mapValue){ // int i = tmstruckTimeTaskResultService.updateTimeTaskResult(mapValue); // return success(i); // } @ApiOperation(value="用车单位确认结束") @ApiImplicitParams({ @ApiImplicitParam(name = "mapValue", value = "运输订单号", required = false, dataType = "Map"), }) @PostMapping("/unitSureEndTime") public RESTfulResult unitSureEndTime(@RequestBody(required=false) Map<String,Object> mapValue){ int i = tmstruckTimeTaskResultService.unitSureEndTime(mapValue); return success(i); } @ApiOperation(value="查询计时作业") @ApiImplicitParams({ @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"), @ApiImplicitParam(name = "apiId(458)", 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("/getAllTimeTaskResult") public RESTfulResult getAllTimeTaskResult(@RequestBody(required=false) Map<String,Object> mapValue, Integer apiId, Integer pageNum, Integer pageSize, String con, String userId, String startTime, String endTime ){ DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据 if (con!=null&&!con.equals("undifined")&&!con.equals("")){ mapValue.put("con","%" + con + "%"); } if (userId!=null&&!userId.equals("undifined")&&!con.equals("")){ mapValue.put("userId",userId); } PageHelper.startPage(pageNum,pageSize); //分页数据 List<Map<String, Object>> result = tmstruckTimeTaskResultService.getAllTimeTaskResult(mapValue); PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null,result); return success(pageList); } }