Commit e309c2c4 by 胡懿

二维码findlist增加根据货品信息查询

parent 693f5f8a
...@@ -22,6 +22,7 @@ public class QrCode extends DataEntity<QrCode> { ...@@ -22,6 +22,7 @@ public class QrCode extends DataEntity<QrCode> {
private String code; // 物资编码 private String code; // 物资编码
private String url; // 二维码存储路径 private String url; // 二维码存储路径
private String state; // 物资状态码 (0:未入库,1:已入库未入账,2:已入账未下账,3:下账) private String state; // 物资状态码 (0:未入库,1:已入库未入账,2:已入账未下账,3:下账)
private List<String> modelList; // 查询时使用的属性
public QrCode() { public QrCode() {
super(); super();
...@@ -66,4 +67,11 @@ public class QrCode extends DataEntity<QrCode> { ...@@ -66,4 +67,11 @@ public class QrCode extends DataEntity<QrCode> {
this.state = state; this.state = state;
} }
public List<String> getModelList() {
return modelList;
}
public void setModelList(List<String> modelList) {
this.modelList = modelList;
}
} }
\ No newline at end of file
...@@ -52,16 +52,19 @@ ...@@ -52,16 +52,19 @@
<if test="code != null and code != ''"> <if test="code != null and code != ''">
AND a.code like concat('%',#{code},'%') AND a.code like concat('%',#{code},'%')
</if> </if>
<if test="goodsInfo.goods.batchNum != null and goodsInfo.goods.batchNum != ''"> <if test="goodsInfo != null and goodsInfo.goods != null and goodsInfo.goods.batchNum != null and goodsInfo.goods.batchNum != ''">
AND g.batch_num = #{goodsInfo.goods.batchNum} AND g.batch_num = #{goodsInfo.goods.batchNum}
</if> </if>
<if test="goodsInfo.type.id != null and goodsInfo.type.id != ''"> <if test="goodsInfo != null and goodsInfo.name != null and goodsInfo.name != ''">
AND gi.name like concat('%',#{goodsInfo.name},'%')
</if>
<if test="goodsInfo != null and goodsInfo,type != null and goodsInfo.type.id != null and goodsInfo.type.id != ''">
AND gi.type_id = #{goodsInfo.type.id} AND gi.type_id = #{goodsInfo.type.id}
</if> </if>
<if test="state != null and state != ''"> <if test="state != null and state != ''">
AND a.state = #{state} AND a.state = #{state}
</if> </if>
<if test="goodsInfo.modelList != null and goodsInfo.modelList.size() != 0"> <if test="goodsInfo != null and goodsInfo.modelList != null and goodsInfo.modelList.size() != 0">
AND AND
<foreach collection="goodsInfo.modelList" item="model" index="index" separator=" AND" open="(" close=")"> <foreach collection="goodsInfo.modelList" item="model" index="index" separator=" AND" open="(" close=")">
gi.model like concat('%',#{model},'%') gi.model like concat('%',#{model},'%')
......
...@@ -5,6 +5,9 @@ package com.jeeplus.modules.warehouse.qrcode.service; ...@@ -5,6 +5,9 @@ package com.jeeplus.modules.warehouse.qrcode.service;
import java.util.List; import java.util.List;
import com.jeeplus.common.utils.StringUtils;
import com.jeeplus.modules.warehouse.goods.entity.GoodsInfo;
import com.jeeplus.modules.warehouse.ikanalyzer.IKSegmenter;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -31,6 +34,12 @@ public class QrCodeService extends CrudService<QrCodeMapper, QrCode> { ...@@ -31,6 +34,12 @@ public class QrCodeService extends CrudService<QrCodeMapper, QrCode> {
} }
public Page<QrCode> findPage(Page<QrCode> page, QrCode qrCode) { public Page<QrCode> findPage(Page<QrCode> page, QrCode qrCode) {
GoodsInfo goodsInfo = qrCode.getGoodsInfo();
if (null != goodsInfo) {
if (StringUtils.isNotBlank(goodsInfo.getModel())) {
qrCode.setModelList(IKSegmenter.splitStr(goodsInfo.getModel(), false));
}
}
return super.findPage(page, qrCode); return super.findPage(page, qrCode);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment