给商品查询接口增加扩展信息的查询

This commit is contained in:
季圣华
2022-12-15 23:53:15 +08:00
parent b00aa14c40
commit baf116d46a
4 changed files with 20 additions and 6 deletions

View File

@@ -19,6 +19,7 @@ public interface MaterialMapperEx {
List<MaterialVo4Unit> selectByConditionMaterial( List<MaterialVo4Unit> selectByConditionMaterial(
@Param("materialParam") String materialParam, @Param("materialParam") String materialParam,
@Param("color") String color, @Param("color") String color,
@Param("materialOther") String materialOther,
@Param("weight") String weight, @Param("weight") String weight,
@Param("expiryNum") String expiryNum, @Param("expiryNum") String expiryNum,
@Param("enableSerialNumber") String enableSerialNumber, @Param("enableSerialNumber") String enableSerialNumber,
@@ -33,6 +34,7 @@ public interface MaterialMapperEx {
Long countsByMaterial( Long countsByMaterial(
@Param("materialParam") String materialParam, @Param("materialParam") String materialParam,
@Param("color") String color, @Param("color") String color,
@Param("materialOther") String materialOther,
@Param("weight") String weight, @Param("weight") String weight,
@Param("expiryNum") String expiryNum, @Param("expiryNum") String expiryNum,
@Param("enableSerialNumber") String enableSerialNumber, @Param("enableSerialNumber") String enableSerialNumber,

View File

@@ -36,6 +36,7 @@ public class MaterialComponent implements ICommonQuery {
String categoryId = StringUtil.getInfo(search, "categoryId"); String categoryId = StringUtil.getInfo(search, "categoryId");
String materialParam = StringUtil.getInfo(search, "materialParam"); String materialParam = StringUtil.getInfo(search, "materialParam");
String color = StringUtil.getInfo(search, "color"); String color = StringUtil.getInfo(search, "color");
String materialOther = StringUtil.getInfo(search, "materialOther");
String weight = StringUtil.getInfo(search, "weight"); String weight = StringUtil.getInfo(search, "weight");
String expiryNum = StringUtil.getInfo(search, "expiryNum"); String expiryNum = StringUtil.getInfo(search, "expiryNum");
String enableSerialNumber = StringUtil.getInfo(search, "enableSerialNumber"); String enableSerialNumber = StringUtil.getInfo(search, "enableSerialNumber");
@@ -43,7 +44,7 @@ public class MaterialComponent implements ICommonQuery {
String enabled = StringUtil.getInfo(search, "enabled"); String enabled = StringUtil.getInfo(search, "enabled");
String remark = StringUtil.getInfo(search, "remark"); String remark = StringUtil.getInfo(search, "remark");
String mpList = StringUtil.getInfo(search, "mpList"); String mpList = StringUtil.getInfo(search, "mpList");
return materialService.select(materialParam, color, weight, expiryNum, return materialService.select(materialParam, color, materialOther, weight, expiryNum,
enableSerialNumber, enableBatchNumber, enabled, remark, categoryId, mpList, QueryUtils.offset(map), QueryUtils.rows(map)); enableSerialNumber, enableBatchNumber, enabled, remark, categoryId, mpList, QueryUtils.offset(map), QueryUtils.rows(map));
} }
@@ -53,6 +54,7 @@ public class MaterialComponent implements ICommonQuery {
String categoryId = StringUtil.getInfo(search, "categoryId"); String categoryId = StringUtil.getInfo(search, "categoryId");
String materialParam = StringUtil.getInfo(search, "materialParam"); String materialParam = StringUtil.getInfo(search, "materialParam");
String color = StringUtil.getInfo(search, "color"); String color = StringUtil.getInfo(search, "color");
String materialOther = StringUtil.getInfo(search, "materialOther");
String weight = StringUtil.getInfo(search, "weight"); String weight = StringUtil.getInfo(search, "weight");
String expiryNum = StringUtil.getInfo(search, "expiryNum"); String expiryNum = StringUtil.getInfo(search, "expiryNum");
String enableSerialNumber = StringUtil.getInfo(search, "enableSerialNumber"); String enableSerialNumber = StringUtil.getInfo(search, "enableSerialNumber");
@@ -60,7 +62,7 @@ public class MaterialComponent implements ICommonQuery {
String enabled = StringUtil.getInfo(search, "enabled"); String enabled = StringUtil.getInfo(search, "enabled");
String remark = StringUtil.getInfo(search, "remark"); String remark = StringUtil.getInfo(search, "remark");
String mpList = StringUtil.getInfo(search, "mpList"); String mpList = StringUtil.getInfo(search, "mpList");
return materialService.countMaterial(materialParam, color, weight, expiryNum, return materialService.countMaterial(materialParam, color, materialOther, weight, expiryNum,
enableSerialNumber, enableBatchNumber, enabled, remark, categoryId, mpList); enableSerialNumber, enableBatchNumber, enabled, remark, categoryId, mpList);
} }

View File

@@ -111,7 +111,7 @@ public class MaterialService {
return list; return list;
} }
public List<MaterialVo4Unit> select(String materialParam, String color, String weight, String expiryNum, public List<MaterialVo4Unit> select(String materialParam, String color, String materialOther, String weight, String expiryNum,
String enableSerialNumber, String enableBatchNumber, String enabled, String enableSerialNumber, String enableBatchNumber, String enabled,
String remark, String categoryId, String mpList, int offset, int rows) String remark, String categoryId, String mpList, int offset, int rows)
throws Exception{ throws Exception{
@@ -126,7 +126,7 @@ public class MaterialService {
if(StringUtil.isNotEmpty(categoryId)){ if(StringUtil.isNotEmpty(categoryId)){
idList = getListByParentId(Long.parseLong(categoryId)); idList = getListByParentId(Long.parseLong(categoryId));
} }
list= materialMapperEx.selectByConditionMaterial(materialParam, color, weight, expiryNum, list= materialMapperEx.selectByConditionMaterial(materialParam, color, materialOther, weight, expiryNum,
enableSerialNumber, enableBatchNumber, enabled, remark, idList, mpList, offset, rows); enableSerialNumber, enableBatchNumber, enabled, remark, idList, mpList, offset, rows);
if (null != list && list.size()>0) { if (null != list && list.size()>0) {
Map<Long,BigDecimal> currentStockMap = getCurrentStockMapByMaterialList(list); Map<Long,BigDecimal> currentStockMap = getCurrentStockMapByMaterialList(list);
@@ -143,7 +143,7 @@ public class MaterialService {
return resList; return resList;
} }
public Long countMaterial(String materialParam, String color, String weight, String expiryNum, public Long countMaterial(String materialParam, String color, String materialOther, String weight, String expiryNum,
String enableSerialNumber, String enableBatchNumber, String enabled, String enableSerialNumber, String enableBatchNumber, String enabled,
String remark, String categoryId,String mpList)throws Exception { String remark, String categoryId,String mpList)throws Exception {
Long result =null; Long result =null;
@@ -152,7 +152,7 @@ public class MaterialService {
if(StringUtil.isNotEmpty(categoryId)){ if(StringUtil.isNotEmpty(categoryId)){
idList = getListByParentId(Long.parseLong(categoryId)); idList = getListByParentId(Long.parseLong(categoryId));
} }
result= materialMapperEx.countsByMaterial(materialParam, color, weight, expiryNum, result= materialMapperEx.countsByMaterial(materialParam, color, materialOther, weight, expiryNum,
enableSerialNumber, enableBatchNumber, enabled, remark, idList, mpList); enableSerialNumber, enableBatchNumber, enabled, remark, idList, mpList);
}catch(Exception e){ }catch(Exception e){
JshException.readFail(logger, e); JshException.readFail(logger, e);

View File

@@ -51,6 +51,11 @@
<bind name="bindColor" value="'%'+color+'%'"/> <bind name="bindColor" value="'%'+color+'%'"/>
and m.color like #{bindColor} and m.color like #{bindColor}
</if> </if>
<if test="materialOther != null and materialOther !=''">
<bind name="bindOther" value="'%'+materialOther+'%'"/>
and (m.mfrs like #{bindOther} or m.other_field1 like #{bindOther}
or m.other_field2 like #{bindOther} or m.other_field3 like #{bindOther})
</if>
<if test="weight != null and weight !=''"> <if test="weight != null and weight !=''">
and m.weight = #{weight} and m.weight = #{weight}
</if> </if>
@@ -101,6 +106,11 @@
<bind name="bindColor" value="'%'+color+'%'"/> <bind name="bindColor" value="'%'+color+'%'"/>
and m.color like #{bindColor} and m.color like #{bindColor}
</if> </if>
<if test="materialOther != null and materialOther !=''">
<bind name="bindOther" value="'%'+materialOther+'%'"/>
and (m.mfrs like #{bindOther} or m.other_field1 like #{bindOther}
or m.other_field2 like #{bindOther} or m.other_field3 like #{bindOther})
</if>
<if test="weight != null and weight !=''"> <if test="weight != null and weight !=''">
and m.weight = #{weight} and m.weight = #{weight}
</if> </if>