package com.steerinfo.dil.controller; import com.steerinfo.dil.feign.ESFeign; import com.steerinfo.dil.service.impl.WmsInboundResultServiceImpl; import com.steerinfo.dil.service.impl.WmsInboundScanResultServiceImpl; import com.steerinfo.dil.service.impl.WmspReboundResultServiceImpl; 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.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.HashMap; import java.util.List; import java.util.Map; //退库 @RestController @RequestMapping("${api.version}/reboundResult") public class WmsReboundResultController extends BaseRESTfulController { @Autowired private WmspReboundResultServiceImpl wmsReboundResultService; @Autowired private WmsInboundResultServiceImpl wmsInboundResultService; @Autowired private WmsInboundScanResultServiceImpl wmsInboundScanResultService; @Autowired ColumnDataUtil columnDataUtil; @Autowired ESFeign esFeign; /** * 展示退库实绩信息 * @param mapValue * @param apiId * @param pageNum * @param pageSize * @return */ @PostMapping("/getWmsReboundResult") @ApiOperation(value = "展示退库实绩信息") @ApiImplicitParams({ @ApiImplicitParam(name = "apiId", value = "161", required = false, dataType = "BigDecimal"), }) public RESTfulResult getWmsReboundResult(@RequestBody(required = false) Map mapValue, Integer apiId, Integer pageNum, Integer pageSize, String con) { if(con != null){ if(!"undefined".equals(con)){ String index = "get_wms_reboundResult"; return success(esFeign.getConResult(mapValue,index,apiId,pageNum,pageSize,con)); } } List>reboundResultList = null; if(mapValue.size() == 0){ //将查询结果存入索引中 reboundResultList = wmsInboundResultService.getReboundResult(mapValue); Map inboundResultMap = new HashMap<>(); //添加索引 inboundResultMap.put("index","get_wms_reboundResult"); //添加ID inboundResultMap.put("indexId","reboundResultId"); reboundResultList.add(inboundResultMap); //新建索引 esFeign.insertIndex(reboundResultList); //删除 reboundResultList.remove(reboundResultList.size() -1); } if(reboundResultList == null) { reboundResultList = wmsInboundResultService.getReboundResult(mapValue); } /*分页*/ PageHelper.startPage(pageNum, pageSize); List> columnList = wmsInboundResultService.getReboundResult(mapValue); PageListAdd pageList = columnDataUtil.tableColumnData(apiId,reboundResultList,columnList); return success(pageList); } //新增退库实绩 @PostMapping("/insertReboundResult") public RESTfulResult insertReboundResult(@RequestBody List> map){ int a= wmsReboundResultService.addReboundResult(map); //新增退库扫描实绩 return success(a); } //新增退库实绩 @PostMapping("/getReIssuedResult") public RESTfulResult getReIssuedResult(@RequestBody Map map){ //新增退库扫描实绩 return success(map); } }