|
@@ -1,20 +1,24 @@
|
|
package com.steerinfo.dil.controller;
|
|
package com.steerinfo.dil.controller;
|
|
|
|
|
|
import com.steerinfo.dil.feign.ColumnDataFeign;
|
|
import com.steerinfo.dil.feign.ColumnDataFeign;
|
|
|
|
+import com.steerinfo.dil.feign.ESFeign;
|
|
import com.steerinfo.dil.model.AmsSalePlan;
|
|
import com.steerinfo.dil.model.AmsSalePlan;
|
|
import com.steerinfo.dil.service.IAmsSalePlanService;
|
|
import com.steerinfo.dil.service.IAmsSalePlanService;
|
|
import com.steerinfo.dil.util.BaseRESTfulController;
|
|
import com.steerinfo.dil.util.BaseRESTfulController;
|
|
import com.steerinfo.dil.util.ColumnDataUtil;
|
|
import com.steerinfo.dil.util.ColumnDataUtil;
|
|
|
|
+import com.steerinfo.dil.util.DataChange;
|
|
import com.steerinfo.dil.util.PageListAdd;
|
|
import com.steerinfo.dil.util.PageListAdd;
|
|
import com.steerinfo.framework.controller.RESTfulResult;
|
|
import com.steerinfo.framework.controller.RESTfulResult;
|
|
import com.steerinfo.framework.service.pagehelper.PageHelper;
|
|
import com.steerinfo.framework.service.pagehelper.PageHelper;
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
|
|
+import io.swagger.annotations.ApiModelProperty;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
|
+import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
@@ -41,6 +45,9 @@ public class AmsSalePlanController extends BaseRESTfulController {
|
|
@Autowired
|
|
@Autowired
|
|
ColumnDataFeign columnDataFeign;
|
|
ColumnDataFeign columnDataFeign;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ ESFeign esFeign;
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
ColumnDataUtil columnDataUtil;
|
|
ColumnDataUtil columnDataUtil;
|
|
|
|
|
|
@@ -147,4 +154,53 @@ public class AmsSalePlanController extends BaseRESTfulController {
|
|
public RESTfulResult getAreaName(){
|
|
public RESTfulResult getAreaName(){
|
|
return success(amsSalePlanService.getAreaName());
|
|
return success(amsSalePlanService.getAreaName());
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @ApiModelProperty(value = "查询所有的钢材物资")
|
|
|
|
+ @ApiImplicitParams({
|
|
|
|
+ @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
|
|
|
|
+ @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
|
|
|
|
+ @ApiImplicitParam(name = "apiId", value = "232", required = false, dataType = "BigDecimal")
|
|
|
|
+ })
|
|
|
|
+ @PostMapping("/getAllSteelMaterialMes")
|
|
|
|
+ public RESTfulResult getAllSteelMaterialMes(@RequestBody(required = false) Map<String,Object> mapValue,
|
|
|
|
+ Integer pageNum,
|
|
|
|
+ Integer pageSize,
|
|
|
|
+ Integer apiId,
|
|
|
|
+ String con) {
|
|
|
|
+
|
|
|
|
+ //框计算
|
|
|
|
+ if(con != null){
|
|
|
|
+ if(!"undefined".equals(con)){
|
|
|
|
+ //设置要查询的索引名称
|
|
|
|
+ String index="get_steel_material_list";
|
|
|
|
+ //获取查询结果
|
|
|
|
+ return success(esFeign.getConResult(mapValue,index,apiId,pageNum,pageSize,con));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ List<Map<String, Object>> list = null;
|
|
|
|
+ //如果有条件查询则跳过初始化,和创建索引
|
|
|
|
+ if(mapValue.size() == 1){
|
|
|
|
+ //将查询结果存入索引中
|
|
|
|
+ list = amsSalePlanService.getAllSteelMaterialMes(mapValue);
|
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
|
+ //添加索引
|
|
|
|
+ map.put("index","get_steel_material_list");
|
|
|
|
+ //添加id
|
|
|
|
+ map.put("indexId","steelMaterialId");
|
|
|
|
+ list.add(map);
|
|
|
|
+ //新建索引
|
|
|
|
+ esFeign.insertIndex(list);
|
|
|
|
+ //删除
|
|
|
|
+ list.remove(list.size()-1);
|
|
|
|
+ }
|
|
|
|
+ if(list == null)
|
|
|
|
+ list = amsSalePlanService.getAllSteelMaterialMes(mapValue);
|
|
|
|
+ PageHelper.startPage(pageNum,pageSize);
|
|
|
|
+ //分页查询数据
|
|
|
|
+ List<Map<String, Object>> columnList = amsSalePlanService.getAllSteelMaterialMes(mapValue);
|
|
|
|
+ PageListAdd data = columnDataUtil.tableColumnData(apiId, list, columnList);
|
|
|
|
+ return success(data);
|
|
|
|
+ }
|
|
}
|
|
}
|