优化单据中商品查询接口

This commit is contained in:
季圣华
2023-02-07 23:30:33 +08:00
parent 13d5b722e4
commit fa97cc8faa

View File

@@ -175,7 +175,7 @@ public class MaterialController {
@ApiOperation(value = "查找商品信息") @ApiOperation(value = "查找商品信息")
public JSONObject findBySelect(@RequestParam(value = "categoryId", required = false) Long categoryId, public JSONObject findBySelect(@RequestParam(value = "categoryId", required = false) Long categoryId,
@RequestParam(value = "q", required = false) String q, @RequestParam(value = "q", required = false) String q,
@RequestParam("mpList") String mpList, @RequestParam(value = "mpList", required = false) String mpList,
@RequestParam(value = "depotId", required = false) Long depotId, @RequestParam(value = "depotId", required = false) Long depotId,
@RequestParam(value = "enableSerialNumber", required = false) String enableSerialNumber, @RequestParam(value = "enableSerialNumber", required = false) String enableSerialNumber,
@RequestParam(value = "enableBatchNumber", required = false) String enableBatchNumber, @RequestParam(value = "enableBatchNumber", required = false) String enableBatchNumber,
@@ -184,9 +184,12 @@ public class MaterialController {
HttpServletRequest request) throws Exception{ HttpServletRequest request) throws Exception{
JSONObject object = new JSONObject(); JSONObject object = new JSONObject();
try { try {
String[] mpArr = new String[]{};
if(StringUtil.isNotEmpty(mpList)){
mpArr= mpList.split(",");
}
List<MaterialVo4Unit> dataList = materialService.findBySelectWithBarCode(categoryId, q, enableSerialNumber, List<MaterialVo4Unit> dataList = materialService.findBySelectWithBarCode(categoryId, q, enableSerialNumber,
enableBatchNumber, (currentPage-1)*pageSize, pageSize); enableBatchNumber, (currentPage-1)*pageSize, pageSize);
String[] mpArr = mpList.split(",");
int total = materialService.findBySelectWithBarCodeCount(categoryId, q, enableSerialNumber, int total = materialService.findBySelectWithBarCodeCount(categoryId, q, enableSerialNumber,
enableBatchNumber); enableBatchNumber);
object.put("total", total); object.put("total", total);