添加选择商品名称功能

This commit is contained in:
qiankunpingtai
2019-03-18 17:51:30 +08:00
parent 2e26e41a8d
commit d17ad852a5
10 changed files with 434 additions and 19 deletions

View File

@@ -3,6 +3,10 @@ package com.jsh.erp.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.jsh.erp.constants.BusinessConstants;
import com.jsh.erp.datasource.entities.DepotEx;
import com.jsh.erp.datasource.entities.Material;
import com.jsh.erp.datasource.entities.MaterialVo4Unit;
import com.jsh.erp.service.material.MaterialService;
@@ -19,10 +23,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
@@ -307,4 +308,37 @@ public class MaterialController {
return null;
}
}
@RequestMapping(value = "/getMaterialEnableSerialNumberList")
public String getMaterialEnableSerialNumberList(@RequestParam(value = Constants.PAGE_SIZE, required = false) Integer pageSize,
@RequestParam(value = Constants.CURRENT_PAGE, required = false) Integer currentPage,
@RequestParam(value = Constants.SEARCH, required = false) String search) {
Map<String, Object> parameterMap = new HashMap<String, Object>();
//查询参数
JSONObject obj=JSON.parseObject(search);
Set<String> key= obj.keySet();
for(String keyEach: key){
parameterMap.put(keyEach,obj.getString(keyEach));
}
PageQueryInfo queryInfo = new PageQueryInfo();
Map<String, Object> objectMap = new HashMap<String, Object>();
if (pageSize == null || pageSize <= 0) {
pageSize = BusinessConstants.DEFAULT_PAGINATION_PAGE_SIZE;
}
if (currentPage == null || currentPage <= 0) {
currentPage = BusinessConstants.DEFAULT_PAGINATION_PAGE_NUMBER;
}
PageHelper.startPage(currentPage,pageSize,true);
List<Material> list = materialService.getMaterialEnableSerialNumberList(parameterMap);
//获取分页查询后的数据
PageInfo<Material> pageInfo = new PageInfo<>(list);
objectMap.put("page", queryInfo);
if (list == null) {
queryInfo.setRows(new ArrayList<Object>());
queryInfo.setTotal(BusinessConstants.DEFAULT_LIST_NULL_NUMBER);
return returnJson(objectMap, "查找不到数据", ErpInfo.OK.code);
}
queryInfo.setRows(list);
queryInfo.setTotal(pageInfo.getTotal());
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
}
}