123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- 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.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;
- /**
- * 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;
- @ApiOperation(value="查询所有的进厂实绩")
- @ApiImplicitParams({
- @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
- @ApiImplicitParam(name = "apiId(210)", 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<String,Object> mapValue,
- Integer apiId,
- Integer pageNum,
- Integer pageSize,
- Integer orderType,
- String con
- ){
- mapValue.put("orderTypee", orderType);
- //框计算
- if(con != null){
- if(!"undefined".equals(con)){
- //设置要查询的索引名称
- String index="get_enfactory_list";
- //获取查询结果
- return success(esFeign.getConResult(mapValue,index,apiId,pageNum,pageSize,con));
- }
- }
- List<Map<String, Object>> allEnFactoryResult = null;
- //如果有条件查询则跳过初始化,和创建索引
- if(mapValue.size() == 1){
- //将查询结果存入索引中
- allEnFactoryResult = tmstruckEnfactoryResultService.getAllEnFactoryResult(mapValue);
- Map<String, Object> map = new HashMap<>();
- //添加索引
- map.put("index","get_enfactory_list");
- //添加id
- map.put("indexId","enFactoryId");
- allEnFactoryResult.add(map);
- //新建索引
- esFeign.insertIndex(allEnFactoryResult);
- //删除
- allEnFactoryResult.remove(allEnFactoryResult.size()-1);
- }
- if(allEnFactoryResult == null)
- allEnFactoryResult = tmstruckEnfactoryResultService.getAllEnFactoryResult(mapValue);
- PageHelper.startPage(pageNum,pageSize);
- //分页数据
- List<Map<String, Object>> enFactoryResult = tmstruckEnfactoryResultService.getAllEnFactoryResult(mapValue);
- PageListAdd pageList = columnDataUtil.tableColumnData(apiId, allEnFactoryResult,enFactoryResult);
- return success(pageList);
- }
- @ApiOperation(value="通过PDA添加进厂实绩")
- @ApiImplicitParams({
- @ApiImplicitParam(name = "mapValue", value = "门岗名称 运输订单号", required = false, dataType = "Map"),
- })
- @PostMapping("/enFactoryResultByPDA")
- public RESTfulResult enFactoryResultByPDA(@RequestBody(required=false) Map<String,Object> mapValue){
- int i = tmstruckEnfactoryResultService.enFactoryResultByPDA(mapValue);
- return success(i);
- }
- @ApiOperation(value="通过门禁进厂")
- @ApiImplicitParams({
- @ApiImplicitParam(name = "mapValue", value = "门岗名称 运输订单号 车牌号 进厂时间", required = false, dataType = "Map"),
- })
- @PostMapping("/enFactoryResultByMJ")
- public RESTfulResult enFactoryResultByMJ(@RequestBody(required=false) Map<String,Object> 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<String,Object> 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<Map<String, Object>> material = tmstruckEnfactoryResultService.getMaterial(orderId);
- return success(material);
- }
- }
|