给单据中商品的选择增加批次和序列号过滤的接口字段
This commit is contained in:
@@ -176,14 +176,18 @@ public class MaterialController {
|
|||||||
@RequestParam(value = "q", required = false) String q,
|
@RequestParam(value = "q", required = false) String q,
|
||||||
@RequestParam("mpList") String mpList,
|
@RequestParam("mpList") 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 = "enableBatchNumber", required = false) String enableBatchNumber,
|
||||||
@RequestParam("page") Integer currentPage,
|
@RequestParam("page") Integer currentPage,
|
||||||
@RequestParam("rows") Integer pageSize,
|
@RequestParam("rows") Integer pageSize,
|
||||||
HttpServletRequest request) throws Exception{
|
HttpServletRequest request) throws Exception{
|
||||||
JSONObject object = new JSONObject();
|
JSONObject object = new JSONObject();
|
||||||
try {
|
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(",");
|
String[] mpArr = mpList.split(",");
|
||||||
int total = materialService.findBySelectWithBarCodeCount(categoryId, q);
|
int total = materialService.findBySelectWithBarCodeCount(categoryId, q, enableSerialNumber,
|
||||||
|
enableBatchNumber);
|
||||||
object.put("total", total);
|
object.put("total", total);
|
||||||
JSONArray dataArray = new JSONArray();
|
JSONArray dataArray = new JSONArray();
|
||||||
//存放数据json数组
|
//存放数据json数组
|
||||||
@@ -293,11 +297,16 @@ public class MaterialController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成excel表格
|
* 生成excel表格
|
||||||
* @param barCode
|
|
||||||
* @param name
|
|
||||||
* @param standard
|
|
||||||
* @param model
|
|
||||||
* @param categoryId
|
* @param categoryId
|
||||||
|
* @param materialParam
|
||||||
|
* @param color
|
||||||
|
* @param weight
|
||||||
|
* @param expiryNum
|
||||||
|
* @param enabled
|
||||||
|
* @param enableSerialNumber
|
||||||
|
* @param enableBatchNumber
|
||||||
|
* @param remark
|
||||||
|
* @param mpList
|
||||||
* @param request
|
* @param request
|
||||||
* @param response
|
* @param response
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -54,11 +54,15 @@ public interface MaterialMapperEx {
|
|||||||
|
|
||||||
List<MaterialVo4Unit> findBySelectWithBarCode(@Param("idList") List<Long> idList,
|
List<MaterialVo4Unit> findBySelectWithBarCode(@Param("idList") List<Long> idList,
|
||||||
@Param("q") String q,
|
@Param("q") String q,
|
||||||
|
@Param("enableSerialNumber") String enableSerialNumber,
|
||||||
|
@Param("enableBatchNumber") String enableBatchNumber,
|
||||||
@Param("offset") Integer offset,
|
@Param("offset") Integer offset,
|
||||||
@Param("rows") Integer rows);
|
@Param("rows") Integer rows);
|
||||||
|
|
||||||
int findBySelectWithBarCodeCount(@Param("idList") List<Long> idList,
|
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(
|
List<MaterialVo4Unit> exportExcel(
|
||||||
@Param("materialParam") String materialParam,
|
@Param("materialParam") String materialParam,
|
||||||
|
|||||||
@@ -390,7 +390,8 @@ public class MaterialService {
|
|||||||
return idList;
|
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;
|
List<MaterialVo4Unit> list =null;
|
||||||
try{
|
try{
|
||||||
List<Long> idList = new ArrayList<>();
|
List<Long> idList = new ArrayList<>();
|
||||||
@@ -402,14 +403,15 @@ public class MaterialService {
|
|||||||
q = q.replace("'", "");
|
q = q.replace("'", "");
|
||||||
q = q.trim();
|
q = q.trim();
|
||||||
}
|
}
|
||||||
list= materialMapperEx.findBySelectWithBarCode(idList, q, offset, rows);
|
list= materialMapperEx.findBySelectWithBarCode(idList, q, enableSerialNumber, enableBatchNumber, offset, rows);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.readFail(logger, e);
|
JshException.readFail(logger, e);
|
||||||
}
|
}
|
||||||
return list;
|
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;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
List<Long> idList = new ArrayList<>();
|
List<Long> idList = new ArrayList<>();
|
||||||
@@ -420,7 +422,7 @@ public class MaterialService {
|
|||||||
if(StringUtil.isNotEmpty(q)) {
|
if(StringUtil.isNotEmpty(q)) {
|
||||||
q = q.replace("'", "");
|
q = q.replace("'", "");
|
||||||
}
|
}
|
||||||
result = materialMapperEx.findBySelectWithBarCodeCount(idList, q);
|
result = materialMapperEx.findBySelectWithBarCodeCount(idList, q, enableSerialNumber, enableBatchNumber);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
logger.error("异常码[{}],异常提示[{}],异常[{}]",
|
||||||
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
|
||||||
|
|||||||
@@ -290,7 +290,7 @@
|
|||||||
where m.enabled=1 and me.id is not null
|
where m.enabled=1 and me.id is not null
|
||||||
<if test="q != null and q !=''">
|
<if test="q != null and q !=''">
|
||||||
<bind name="bindKey" value="'%'+q+'%'"/>
|
<bind name="bindKey" value="'%'+q+'%'"/>
|
||||||
and (me.bar_code like #{bindKey} or m.name like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey})
|
and (me.bar_code like #{bindKey} or m.name like #{bindKey} or m.standard like #{bindKey} or m.model like #{bindKey} or m.color like #{bindKey})
|
||||||
</if>
|
</if>
|
||||||
<if test="idList.size()>0">
|
<if test="idList.size()>0">
|
||||||
and m.category_id in
|
and m.category_id in
|
||||||
@@ -298,6 +298,12 @@
|
|||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
|
<if test="enableSerialNumber != null and enableSerialNumber !=''">
|
||||||
|
and m.enable_serial_number = #{enableSerialNumber}
|
||||||
|
</if>
|
||||||
|
<if test="enableBatchNumber != null and enableBatchNumber !=''">
|
||||||
|
and m.enable_batch_number = #{enableBatchNumber}
|
||||||
|
</if>
|
||||||
and ifnull(m.delete_flag,'0') !='1'
|
and ifnull(m.delete_flag,'0') !='1'
|
||||||
ORDER BY m.id desc, me.default_flag desc, me.id asc
|
ORDER BY m.id desc, me.default_flag desc, me.id asc
|
||||||
<if test="offset != null and rows != null">
|
<if test="offset != null and rows != null">
|
||||||
@@ -320,6 +326,12 @@
|
|||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
|
<if test="enableSerialNumber != null and enableSerialNumber !=''">
|
||||||
|
and m.enable_serial_number = #{enableSerialNumber}
|
||||||
|
</if>
|
||||||
|
<if test="enableBatchNumber != null and enableBatchNumber !=''">
|
||||||
|
and m.enable_batch_number = #{enableBatchNumber}
|
||||||
|
</if>
|
||||||
and ifnull(m.delete_flag,'0') !='1'
|
and ifnull(m.delete_flag,'0') !='1'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user