完善商品查询参数,增加助记码等查询条件
This commit is contained in:
@@ -211,8 +211,12 @@ public class MaterialController {
|
||||
@ApiOperation(value = "查找商品信息")
|
||||
public JSONObject findBySelect(@RequestParam(value = "categoryId", required = false) Long categoryId,
|
||||
@RequestParam(value = "q", required = false) String q,
|
||||
@RequestParam(value = "standardOrModel", required = false) String standardOrModel,
|
||||
@RequestParam(value = "mpList", required = false) String mpList,
|
||||
@RequestParam(value = "depotId", required = false) Long depotId,
|
||||
@RequestParam(value = "color", required = false) String color,
|
||||
@RequestParam(value = "brand", required = false) String brand,
|
||||
@RequestParam(value = "mfrs", required = false) String mfrs,
|
||||
@RequestParam(value = "enableSerialNumber", required = false) String enableSerialNumber,
|
||||
@RequestParam(value = "enableBatchNumber", required = false) String enableBatchNumber,
|
||||
@RequestParam("page") Integer currentPage,
|
||||
@@ -224,10 +228,10 @@ public class MaterialController {
|
||||
if(StringUtil.isNotEmpty(mpList)){
|
||||
mpArr= mpList.split(",");
|
||||
}
|
||||
List<MaterialVo4Unit> dataList = materialService.findBySelectWithBarCode(categoryId, q, enableSerialNumber,
|
||||
enableBatchNumber, (currentPage-1)*pageSize, pageSize);
|
||||
int total = materialService.findBySelectWithBarCodeCount(categoryId, q, enableSerialNumber,
|
||||
enableBatchNumber);
|
||||
List<MaterialVo4Unit> dataList = materialService.findBySelectWithBarCode(categoryId, q, standardOrModel,
|
||||
color, brand, mfrs, enableSerialNumber, enableBatchNumber, (currentPage-1)*pageSize, pageSize);
|
||||
int total = materialService.findBySelectWithBarCodeCount(categoryId, q, standardOrModel,
|
||||
color, brand, mfrs, enableSerialNumber, enableBatchNumber);
|
||||
object.put("total", total);
|
||||
JSONArray dataArray = new JSONArray();
|
||||
//存放数据json数组
|
||||
@@ -258,10 +262,13 @@ public class MaterialController {
|
||||
}
|
||||
item.put("mBarCode", material.getmBarCode());
|
||||
item.put("name", material.getName());
|
||||
item.put("mnemonic", material.getMnemonic());
|
||||
item.put("categoryName", material.getCategoryName());
|
||||
item.put("standard", material.getStandard());
|
||||
item.put("model", material.getModel());
|
||||
item.put("color", material.getColor());
|
||||
item.put("brand", material.getBrand());
|
||||
item.put("mfrs", material.getMfrs());
|
||||
item.put("unit", material.getCommodityUnit() + ratioStr);
|
||||
item.put("sku", material.getSku());
|
||||
item.put("enableSerialNumber", material.getEnableSerialNumber());
|
||||
|
||||
@@ -67,6 +67,10 @@ public interface MaterialMapperEx {
|
||||
|
||||
List<MaterialVo4Unit> findBySelectWithBarCode(@Param("idList") List<Long> idList,
|
||||
@Param("q") String q,
|
||||
@Param("standardOrModel") String standardOrModel,
|
||||
@Param("color") String color,
|
||||
@Param("brand") String brand,
|
||||
@Param("mfrs") String mfrs,
|
||||
@Param("enableSerialNumber") String enableSerialNumber,
|
||||
@Param("enableBatchNumber") String enableBatchNumber,
|
||||
@Param("offset") Integer offset,
|
||||
@@ -74,6 +78,10 @@ public interface MaterialMapperEx {
|
||||
|
||||
int findBySelectWithBarCodeCount(@Param("idList") List<Long> idList,
|
||||
@Param("q") String q,
|
||||
@Param("standardOrModel") String standardOrModel,
|
||||
@Param("color") String color,
|
||||
@Param("brand") String brand,
|
||||
@Param("mfrs") String mfrs,
|
||||
@Param("enableSerialNumber") String enableSerialNumber,
|
||||
@Param("enableBatchNumber") String enableBatchNumber);
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@ public class MaterialVoSearch {
|
||||
|
||||
private String name;
|
||||
|
||||
private String mnemonic;
|
||||
|
||||
private String standard;
|
||||
|
||||
private String model;
|
||||
@@ -30,6 +32,14 @@ public class MaterialVoSearch {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getMnemonic() {
|
||||
return mnemonic;
|
||||
}
|
||||
|
||||
public void setMnemonic(String mnemonic) {
|
||||
this.mnemonic = mnemonic;
|
||||
}
|
||||
|
||||
public String getStandard() {
|
||||
return standard;
|
||||
}
|
||||
|
||||
@@ -409,6 +409,9 @@ public class MaterialService {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(item.getBarCode());
|
||||
sb.append("_").append(item.getName());
|
||||
if(StringUtil.isNotEmpty(item.getMnemonic())) {
|
||||
sb.append("(").append(item.getMnemonic()).append(")");
|
||||
}
|
||||
if(StringUtil.isNotEmpty(item.getStandard())) {
|
||||
sb.append("(").append(item.getStandard()).append(")");
|
||||
}
|
||||
@@ -428,8 +431,9 @@ public class MaterialService {
|
||||
return arr;
|
||||
}
|
||||
|
||||
public List<MaterialVo4Unit> findBySelectWithBarCode(Long categoryId, String q, String enableSerialNumber,
|
||||
String enableBatchNumber, Integer offset, Integer rows)throws Exception{
|
||||
public List<MaterialVo4Unit> findBySelectWithBarCode(Long categoryId, String q, String standardOrModel, String color,
|
||||
String brand, String mfrs, String enableSerialNumber, String enableBatchNumber,
|
||||
Integer offset, Integer rows) throws Exception{
|
||||
List<MaterialVo4Unit> list =null;
|
||||
try{
|
||||
List<Long> idList = new ArrayList<>();
|
||||
@@ -441,15 +445,16 @@ public class MaterialService {
|
||||
q = q.replace("'", "");
|
||||
q = q.trim();
|
||||
}
|
||||
list= materialMapperEx.findBySelectWithBarCode(idList, q, enableSerialNumber, enableBatchNumber, offset, rows);
|
||||
list= materialMapperEx.findBySelectWithBarCode(idList, q, standardOrModel, color, brand, mfrs,
|
||||
enableSerialNumber, enableBatchNumber, offset, rows);
|
||||
}catch(Exception e){
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public int findBySelectWithBarCodeCount(Long categoryId, String q, String enableSerialNumber,
|
||||
String enableBatchNumber)throws Exception{
|
||||
public int findBySelectWithBarCodeCount(Long categoryId, String q, String standardOrModel, String color,
|
||||
String brand, String mfrs, String enableSerialNumber, String enableBatchNumber) throws Exception{
|
||||
int result=0;
|
||||
try{
|
||||
List<Long> idList = new ArrayList<>();
|
||||
@@ -460,7 +465,8 @@ public class MaterialService {
|
||||
if(StringUtil.isNotEmpty(q)) {
|
||||
q = q.replace("'", "");
|
||||
}
|
||||
result = materialMapperEx.findBySelectWithBarCodeCount(idList, q, enableSerialNumber, enableBatchNumber);
|
||||
result = materialMapperEx.findBySelectWithBarCodeCount(idList, q, standardOrModel, color, brand, mfrs,
|
||||
enableSerialNumber, enableBatchNumber);
|
||||
}catch(Exception e){
|
||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||
|
||||
Reference in New Issue
Block a user