123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133 |
- package com.steerinfo.dil.controller;
- import com.steerinfo.dil.feign.ESFeign;
- import com.steerinfo.dil.service.ITmstruckLeaveFactoryResultService;
- 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.List;
- import java.util.Map;
- /**
- * TmstruckLeaveFactoryResult RESTful接口:
- * @author generator
- * @version 1.0-SNAPSHORT 2021-09-11 10:32
- * 类描述
- * 修订历史:
- * 日期:2021-09-11
- * 作者:TXF
- * 参考:
- * 描述:TmstruckLeaveFactoryResult RESTful接口
- * @see null
- * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
- */
- @RestController
- @RequestMapping("/${api.version}/tmstruckleavefactoryresults")
- public class TmstruckLeaveFactoryResultController extends BaseRESTfulController {
- @Autowired
- ITmstruckLeaveFactoryResultService tmstruckLeaveFactoryResultService;
- @Autowired
- ESFeign esFeign;
- @Autowired
- ColumnDataUtil columnDataUtil;
- private final SimpleDateFormat sdfDateTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
- @ApiOperation(value="新增汽车出厂实绩:oms远程调用")
- @ApiImplicitParams({
- @ApiImplicitParam(name = "mapValue", value = "总实绩ID、线路终点", required = false, dataType = "Map"),
- })
- @PostMapping("/addLeaveFactory")
- public RESTfulResult addLeaveFactory(@RequestBody(required=false) Map<String,Object> mapValue){
- int i = tmstruckLeaveFactoryResultService.addLeaveFactory(mapValue);
- return success(i);
- }
- @ApiOperation(value="查询出厂实绩")
- @ApiImplicitParams({
- @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
- @ApiImplicitParam(name = "apiId(110)", 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("/getLeaveFactoryResult")
- public RESTfulResult getLeaveFactoryResult(@RequestBody(required=false) Map<String,Object> mapValue,
- Integer apiId,
- Integer pageNum,
- Integer pageSize,
- Integer orderType,
- String con,
- String carrierSsoId,
- String userId,
- String userIds,
- String startTime,
- String endTime){
- if (userId!=null){
- mapValue.put("userId",userId);
- }
- if (userIds!=null){
- mapValue.put("userIds",userIds);
- }
- if (orderType!=null) {
- mapValue.put("orderTypee", orderType);
- }
- if(carrierSsoId != null){
- if(!"null".equals(carrierSsoId)){
- mapValue.put("carrierSsoId", carrierSsoId);
- }
- }
- if(con!=null&&con.equals("undefined")){
- mapValue.put("con","%"+con+"%");
- }
- DataChange.queryDataByDateTime(startTime,endTime,mapValue,sdfDateTime);
- PageHelper.startPage(pageNum,pageSize);
- //分页数据
- List<Map<String, Object>> leaveFactoryResult = tmstruckLeaveFactoryResultService.getLeaveFactoryResult(mapValue);
- PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null,leaveFactoryResult);
- return success(pageList);
- }
- @ApiOperation(value="PAD扫描汽车出厂实绩")
- @ApiImplicitParams({
- @ApiImplicitParam(name = "mapValue", value = "", required = false, dataType = "Map"),
- @ApiImplicitParam(name = "orderNumber", value = "", required = false, dataType = "String"),
- })
- @PostMapping("/addLeaveFactoryResult")
- public RESTfulResult addLeaveFactoryResult(@RequestBody(required=false) Map<String,Object> mapValue){
- //中交新路接口
- // Map<String, Object> parem=tmstruckLeaveFactoryResultService.getTruckFactoryResult("WYSDD2021091000000002");
- // parem.put("turnOf","0");
- // routeService.saveRoute(parem);
- int leaveFactory = 0;
- try {
- leaveFactory = tmstruckLeaveFactoryResultService.leaveFactoryByPDA(mapValue);
- }catch (Exception e){
- return failed(e.getMessage());
- }
- return success(leaveFactory);
- }
- @ApiOperation(value="APP查询汽车出厂实绩")
- @PostMapping("/getLeaveFactoryList")
- public RESTfulResult getLeaveFactoryList(@RequestParam String orderNumber) {
- List<Map<String,Object>> mapList = tmstruckLeaveFactoryResultService.getLeaveFactoryList(orderNumber);
- return success(mapList);
- }
- }
|