给单据中商品的选择增加批次和序列号过滤的接口字段
This commit is contained in:
@@ -176,14 +176,18 @@ public class MaterialController {
|
||||
@RequestParam(value = "q", required = false) String q,
|
||||
@RequestParam("mpList") String mpList,
|
||||
@RequestParam(value = "depotId", required = false) Long depotId,
|
||||
@RequestParam(value = "enableSerialNumber", required = false) String enableSerialNumber,
|
||||
@RequestParam(value = "enableBatchNumber", required = false) String enableBatchNumber,
|
||||
@RequestParam("page") Integer currentPage,
|
||||
@RequestParam("rows") Integer pageSize,
|
||||
HttpServletRequest request) throws Exception{
|
||||
JSONObject object = new JSONObject();
|
||||
try {
|
||||
List<MaterialVo4Unit> dataList = materialService.findBySelectWithBarCode(categoryId, q, (currentPage-1)*pageSize, pageSize);
|
||||
List<MaterialVo4Unit> dataList = materialService.findBySelectWithBarCode(categoryId, q, enableSerialNumber,
|
||||
enableBatchNumber, (currentPage-1)*pageSize, pageSize);
|
||||
String[] mpArr = mpList.split(",");
|
||||
int total = materialService.findBySelectWithBarCodeCount(categoryId, q);
|
||||
int total = materialService.findBySelectWithBarCodeCount(categoryId, q, enableSerialNumber,
|
||||
enableBatchNumber);
|
||||
object.put("total", total);
|
||||
JSONArray dataArray = new JSONArray();
|
||||
//存放数据json数组
|
||||
@@ -293,11 +297,16 @@ public class MaterialController {
|
||||
|
||||
/**
|
||||
* 生成excel表格
|
||||
* @param barCode
|
||||
* @param name
|
||||
* @param standard
|
||||
* @param model
|
||||
* @param categoryId
|
||||
* @param materialParam
|
||||
* @param color
|
||||
* @param weight
|
||||
* @param expiryNum
|
||||
* @param enabled
|
||||
* @param enableSerialNumber
|
||||
* @param enableBatchNumber
|
||||
* @param remark
|
||||
* @param mpList
|
||||
* @param request
|
||||
* @param response
|
||||
*/
|
||||
|
||||
@@ -54,11 +54,15 @@ public interface MaterialMapperEx {
|
||||
|
||||
List<MaterialVo4Unit> findBySelectWithBarCode(@Param("idList") List<Long> idList,
|
||||
@Param("q") String q,
|
||||
@Param("enableSerialNumber") String enableSerialNumber,
|
||||
@Param("enableBatchNumber") String enableBatchNumber,
|
||||
@Param("offset") Integer offset,
|
||||
@Param("rows") Integer rows);
|
||||
|
||||
int findBySelectWithBarCodeCount(@Param("idList") List<Long> idList,
|
||||
@Param("q") String q);
|
||||
@Param("q") String q,
|
||||
@Param("enableSerialNumber") String enableSerialNumber,
|
||||
@Param("enableBatchNumber") String enableBatchNumber);
|
||||
|
||||
List<MaterialVo4Unit> exportExcel(
|
||||
@Param("materialParam") String materialParam,
|
||||
|
||||
@@ -390,7 +390,8 @@ public class MaterialService {
|
||||
return idList;
|
||||
}
|
||||
|
||||
public List<MaterialVo4Unit> findBySelectWithBarCode(Long categoryId, String q, Integer offset, Integer rows)throws Exception{
|
||||
public List<MaterialVo4Unit> findBySelectWithBarCode(Long categoryId, String q, String enableSerialNumber,
|
||||
String enableBatchNumber, Integer offset, Integer rows)throws Exception{
|
||||
List<MaterialVo4Unit> list =null;
|
||||
try{
|
||||
List<Long> idList = new ArrayList<>();
|
||||
@@ -402,14 +403,15 @@ public class MaterialService {
|
||||
q = q.replace("'", "");
|
||||
q = q.trim();
|
||||
}
|
||||
list= materialMapperEx.findBySelectWithBarCode(idList, q, offset, rows);
|
||||
list= materialMapperEx.findBySelectWithBarCode(idList, q, enableSerialNumber, enableBatchNumber, offset, rows);
|
||||
}catch(Exception e){
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public int findBySelectWithBarCodeCount(Long categoryId, String q)throws Exception{
|
||||
public int findBySelectWithBarCodeCount(Long categoryId, String q, String enableSerialNumber,
|
||||
String enableBatchNumber)throws Exception{
|
||||
int result=0;
|
||||
try{
|
||||
List<Long> idList = new ArrayList<>();
|
||||
@@ -420,7 +422,7 @@ public class MaterialService {
|
||||
if(StringUtil.isNotEmpty(q)) {
|
||||
q = q.replace("'", "");
|
||||
}
|
||||
result = materialMapperEx.findBySelectWithBarCodeCount(idList, q);
|
||||
result = materialMapperEx.findBySelectWithBarCodeCount(idList, q, 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