package com.steerinfo.dil.controller; import com.steerinfo.dil.feign.ESFeign; import com.steerinfo.dil.service.ITmstruckEnfactoryResultService; 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; import java.util.concurrent.Callable; /** * TmstruckEnfactoryResult RESTful接口: * @author generator * @version 1.0-SNAPSHORT 2021-09-08 06:23 * 类描述 * 修订历史: * 日期:2021-09-08 * 作者:TXF * 参考: * 描述:TmstruckEnfactoryResult RESTful接口 * @see null * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved. */ @RestController @RequestMapping("/${api.version}/tmstruckenfactoryresults") public class TmstruckEnfactoryResultController extends BaseRESTfulController { @Autowired ITmstruckEnfactoryResultService tmstruckEnfactoryResultService; @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"), @ApiImplicitParam(name = "apiId(220)", 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("/getAllEnFactoryResult") public RESTfulResult getAllEnFactoryResult(@RequestBody(required=false) Map mapValue, Integer apiId, Integer pageNum, Integer pageSize, Integer orderType, String startTime, String endTime, String userId, String userIds ){ DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据 if (userId!=null){ mapValue.put("userId",userId); } if (userIds!=null){ mapValue.put("userIds",userIds); } if (orderType!=null){ mapValue.put("orderTypee", orderType); } PageHelper.startPage(pageNum,pageSize); //分页数据 List> enFactoryResult = tmstruckEnfactoryResultService.getAllEnFactoryResult(mapValue); PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null,enFactoryResult); return success(pageList); } @ApiOperation(value="通过PDA添加进厂实绩") @ApiImplicitParams({ @ApiImplicitParam(name = "mapValue", value = "门岗名称 运输订单号", required = false, dataType = "Map"), }) @PostMapping("/enFactoryResultByPDA") public Callable enFactoryResultByPDA(@RequestBody(required=false) Map mapValue){ return ()->{ try { int i = tmstruckEnfactoryResultService.enFactoryResultByPDA(mapValue); return success(i); } catch (Exception e) { return failed(e.getMessage()); } }; } @ApiOperation(value="通过门禁进厂") @ApiImplicitParams({ @ApiImplicitParam(name = "mapValue", value = "门岗名称 运输订单号 车牌号 进厂时间", required = false, dataType = "Map"), }) @PostMapping("/enFactoryResultByMJ") public RESTfulResult enFactoryResultByMJ(@RequestBody(required=false) Map mapValue){ int i = tmstruckEnfactoryResultService.enFactoryResultByMJ(mapValue); return success(i); } @ApiOperation(value="新增进厂作业实绩:oms远程调用") @ApiImplicitParams({ @ApiImplicitParam(name = "mapValue", value = "总实绩Id、线路起点", required = false, dataType = "Map"), }) @PostMapping("/addEnFactoryResult") public RESTfulResult addEnFactoryResult(@RequestBody(required=false) Map mapValue){ int i = tmstruckEnfactoryResultService.addEnFactoryResult(mapValue); return success(i); } @ApiOperation(value="通过运输订单id查询物资信息") @ApiImplicitParams({ @ApiImplicitParam(name = "orderId", value = "运输订单id", required = false, dataType = "Integer"), }) @GetMapping("/getMaterial") public RESTfulResult getMaterial(Integer orderId){ List> material = tmstruckEnfactoryResultService.getMaterial(orderId); return success(material); } @ApiOperation(value="APP查询进厂实绩") @PostMapping("/getEnfactoryResultList") public RESTfulResult getEnfactoryResultList() { List> mapList = tmstruckEnfactoryResultService.getEnfactoryResultList(); return success(mapList); } @ApiOperation(value="APP通过运输订单id查询进厂实绩") @PostMapping("/getEnfactoryMessageByOrderId") public RESTfulResult getEnfactoryMessageByOrderId(@RequestParam String orderNumber) { List> mapList = tmstruckEnfactoryResultService.getEnfactoryMessageByOrderId(orderNumber); return success(mapList); } @ApiOperation(value="更新进厂实绩") @PostMapping("/updateEnSge") public int updateEnSge() { int i = tmstruckEnfactoryResultService.updateEnSge(); return i; } }